From 94901463fe1b53312e9fd981200ceb5070a0174f Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Mon, 15 Mar 2021 18:07:28 -0400 Subject: [PATCH] show / hide irc channel names based on URL --- 2021/assets/js/stream.js | 22 ++++++++++++++++------ 2021/vip-abk2bvlwswnb/live | 1 + 2 files changed, 17 insertions(+), 6 deletions(-) create mode 120000 2021/vip-abk2bvlwswnb/live diff --git a/2021/assets/js/stream.js b/2021/assets/js/stream.js index fbe07237..42d75bf1 100644 --- a/2021/assets/js/stream.js +++ b/2021/assets/js/stream.js @@ -305,6 +305,21 @@ app.view = function(ctrl) { return m("span"); } + // show or hide irc info based on page URL + if (!window.location.pathname.match(RegExp("\/2021\/live.*"))) { + var irc_info = [ + "Freenode IRC channel for ", + stream.name, + ": ", + m("strong", ["/join ", stream.ircChannel]) + ]; + } else { + var irc_info = [ + m("strong", ["Register"]), + " to access IRC rooms" + ]; + } + return [ renderRoomSelector(), m("h2", stream.name), @@ -318,12 +333,7 @@ app.view = function(ctrl) { "Conference-wide Freenode IRC channel: ", m("strong", "/join #libreplanet") ]), - m("li", [ - "Freenode IRC channel for ", - stream.name, - ": ", - m("strong", ["/join ", stream.ircChannel]) - ]), + m("li", irc_info), // m("li", [ // "Conference-wide Mumble (voice chat) server: ", // m("strong", "mumble.fsf.org") diff --git a/2021/vip-abk2bvlwswnb/live b/2021/vip-abk2bvlwswnb/live new file mode 120000 index 00000000..bcc04b69 --- /dev/null +++ b/2021/vip-abk2bvlwswnb/live @@ -0,0 +1 @@ +../live/ \ No newline at end of file -- 2.25.1