Skip to content

Commit 9632953

Browse files
authored
Merge pull request #108 from robots-from-jupyter/username
docs: Add username field for lite form
2 parents 717eb56 + f1293f0 commit 9632953

File tree

2 files changed

+39
-4
lines changed

2 files changed

+39
-4
lines changed

.github/workflows/rtd-preview.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: RTD Preview
2+
on:
3+
pull_request_target:
4+
types: [opened]
5+
6+
permissions:
7+
pull-requests: write
8+
9+
jobs:
10+
binder:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Comment on the PR with the RTD preview
14+
uses: actions/github-script@v5
15+
with:
16+
github-token: ${{secrets.GITHUB_TOKEN}}
17+
script: |
18+
var PR_NUMBER = context.issue.number
19+
github.rest.issues.createComment({
20+
issue_number: context.issue.number,
21+
owner: context.repo.owner,
22+
repo: context.repo.repo,
23+
body: `[![lite-badge](https://.rtfd.io/en/latest/_static/badge.svg)](https://robotkernel--${PR_NUMBER}.org.readthedocs.build/en/${PR_NUMBER}/_static/lab/index.html) :point_left: Try it on ReadTheDocs`
24+
})

_templates/lite-demo.html

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ <h2>DEMO</h2>
66
type="text"
77
placeholder="nobody else"
88
title="give a room name to enable shared editing with videochat"
9+
/><br/>as <input
10+
id="user-name"
11+
type="text"
12+
placeholder="nobody"
13+
title="give your username for shared editing with videochat"
914
/> in...</em>
1015
</div>
1116
<form
@@ -21,6 +26,7 @@ <h2>DEMO</h2>
2126
/>
2227
<input name="path" type="hidden" value="Example.ipynb" />
2328
<input name="room" type="hidden" value="" />
29+
<input name="username" type="hidden" value="" />
2430
<input name="JVC-PUBLIC" type="hidden" value="" />
2531
</form>
2632
<div class="demo-label">
@@ -31,8 +37,15 @@ <h2>DEMO</h2>
3137
<script>
3238
$(function () {
3339
const roomName = $("#room-name");
40+
const userName = $("#user-name");
3441
roomName.on("input", () => {
3542
$("input[name='room']").prop("value", roomName.prop("value"));
43+
$("input[name='username']").prop("value", userName.prop("value"));
44+
$("input[name='JVC-PUBLIC']").prop("value", roomName.prop("value"));
45+
});
46+
userName.on("input", () => {
47+
$("input[name='room']").prop("value", roomName.prop("value"));
48+
$("input[name='username']").prop("value", userName.prop("value"));
3649
$("input[name='JVC-PUBLIC']").prop("value", roomName.prop("value"));
3750
});
3851
});
@@ -95,14 +108,12 @@ <h2>DEMO</h2>
95108
color: var(--pg-layout-color0);
96109
font-weight: bold;
97110
}
98-
99-
100111
.navbar-demo-box > .demo-label {
101112
flex: 1;
102113
width: 100%;
103114
min-width: 100%;
104115
}
105-
#room-name {
116+
#room-name, #user-name {
106117
margin-left: 0.5em;
107118
display: inline-box;
108119
max-width: 6em;
@@ -113,7 +124,7 @@ <h2>DEMO</h2>
113124
text-align: center;
114125
font-weight: bold;
115126
}
116-
#room-name::placeholder{
127+
#room-name::placeholder, #user-name::placeholder {
117128
font-style: italic;
118129
color: var(--pg-layout-color0);
119130
font-weight: 400;

0 commit comments

Comments
 (0)