Skip to content

Commit

Permalink
Add object to chat.js to sort buttons
Browse files Browse the repository at this point in the history
Used the config settings for mapping room ids to room names and changed
the order accordingly.
  • Loading branch information
splattater committed Apr 12, 2024
1 parent 91888da commit 0ab0096
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions resources/js/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,24 @@ function updateVideo(videoUrl) {
socket.on('streams_update', (streamList) => {
const stream_selection = document.getElementById('stream_selection');
stream_selection.innerHTML = '';
let streams = {
'stream_1_1': "!irnMvwCKJtUyHjAAwI:matrix.org", // Menschen vernetzen - Daten nutzen
'stream_1_2': "!EgEHuNVtcBsfkKBzBJ:matrix.org", // Data Science Mania
'stream_2_1': "!UPyDoiPIBTThTPDQXF:matrix.org", // Kommunen für Kommunen 1 (Sitzungssaal)
'stream_2_2': "!LXXKyxfLmjTtRTzzAc:matrix.org", // Kommunen für Kommunen 2 (Festsaal)
'stream_3_1': "!wGwIOvxQCUcVwiKPQk:matrix.org", // Urban Data Summit
'stream_4_1': "!pEreTkmeqwWZPtAWpA:matrix.org", // LSWT
}
console.log(streamList);
for (let stream_id in streamList) {
for (let stream_id in streams) {
let stream_link = document.createElement('a');
stream_link.setAttribute("href", "javascript:zapp('" + stream_id + "')");
if (room_id == stream_id) {
stream_link.setAttribute("href", `javascript:zapp('${streams[stream_id]}')`);
if (room_id == streams[stream_id]) {
stream_link.setAttribute("class", "btn");
} else {
stream_link.setAttribute("class", "btn2");
}
stream_link.append(streamList[stream_id]);
stream_link.append(streamList[streams[stream_id]]);
stream_selection.append(stream_link);
stream_selection.append(" ");
}
Expand Down

0 comments on commit 0ab0096

Please sign in to comment.