Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/console.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<div class="room">
<strong id="roomName"></strong>
<a id="viewerLink" target="_blank" rel="noopener">open viewer</a>
<a id="agendaLink" target="_blank" rel="noopener">open agenda</a>
</div>
<div class="conn">
<span id="clients" class="clients"></span>
Expand Down
1 change: 1 addition & 0 deletions web/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const room = roomFromPath();
document.title = `${room} — console`;
el('roomName').textContent = room;
el('viewerLink').href = `/${room}`;
el('agendaLink').href = `/${room}/agenda`;

const QUICK_MINUTES = [5, 10, 15, 20, 30];
const TONES = ['neutral', 'warn', 'alert'];
Expand Down
7 changes: 6 additions & 1 deletion web/picker.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ <h2>Point the stage display here</h2>
<span>Console</span>
<input id="consoleUrl" type="text" readonly />
</label>
<label class="field">
<span>Agenda</span>
<input id="agendaUrl" type="text" readonly />
</label>
<p class="hint">
The viewer needs no token. Keep the console link to yourself.
The viewer and the agenda need no token. Keep the console link to
yourself.
</p>
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion web/picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function showLinks(room) {
const links = urls(room);
el('viewerUrl').value = links.viewer;
el('consoleUrl').value = links.console;
el('agendaUrl').value = links.agenda;
el('qr').src = `/api/qr?text=${encodeURIComponent(links.viewer)}`;
el('linksPanel').hidden = false;
}
Expand Down Expand Up @@ -68,13 +69,16 @@ async function loadRooms() {
const edit = document.createElement('a');
edit.href = urls(room).console;
edit.textContent = 'console';
const agenda = document.createElement('a');
agenda.href = `/${room}/agenda`;
agenda.textContent = 'agenda';
const remove = document.createElement('button');
remove.type = 'button';
remove.className = 'removeRoom';
remove.textContent = 'delete';
remove.addEventListener('click', () => deleteRoom(room));

item.append(name, view, edit, remove);
item.append(name, view, edit, agenda, remove);
list.append(item);
}
} catch {
Expand Down
5 changes: 5 additions & 0 deletions web/picker.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ test('builds a console link that carries the token', () => {
assert.equal(links.console, 'http://192.168.1.20:8080/keynote/edit?token=s3cret');
});

test('builds an agenda link that carries no token', () => {
const links = roomLinks('http://192.168.1.20:8080', 'keynote', 's3cret');
assert.equal(links.agenda, 'http://192.168.1.20:8080/keynote/agenda');
});

test('omits the query when there is no token', () => {
const links = roomLinks('http://host', 'keynote', '');
assert.equal(links.console, 'http://host/keynote/edit');
Expand Down
1 change: 1 addition & 0 deletions web/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ export function roomLinks(origin, room, token) {
return {
viewer: `${origin}/${room}`,
console: `${origin}/${room}/edit${suffix}`,
agenda: `${origin}/${room}/agenda`,
};
}

Expand Down
Loading