Skip to content

Commit bb6a9e6

Browse files
committed
docs: Add username field for lite form
1 parent 717eb56 commit bb6a9e6

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

_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)