Merge branch 'stable' of ssh://vcs.fsf.org/libreplanet-static into stable
[libreplanet-static.git] / 2021 / assets / js / stream.js
index fbe072373a4025181a858a8f3033989ee23011dc..f2cfc1570ec0eff40fc620b85b983eeaece6e9ec 100644 (file)
@@ -305,6 +305,26 @@ 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 = [
+      "This room's channel: ",
+      m("strong", ["/join ", stream.ircChannel])
+    ];
+    // set css to show irc links in sidebar
+    document.querySelector('#irc-links-panel').style.display = "block";
+  } else {
+    var irc_info = [
+      m("strong", [
+        m("a", { target: "_blank", href: "https://my.fsf.org/civicrm/event/info?reset=1&id=92" }, "Register"),
+      ]),
+      " gratis to access more IRC rooms. ",
+      m("strong", [
+        m("a", { href: "/2021/registered/live/" }, "Already registered?"),
+      ])
+    ];
+  }
+
   return [
     renderRoomSelector(),
     m("h2", stream.name),
@@ -318,24 +338,21 @@ 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",
+        m("div", { class: "special-irc" },
+          irc_info)
+      ),
       // m("li", [
       //   "Conference-wide Mumble (voice chat) server: ",
       //   m("strong", "mumble.fsf.org")
       // ]),
       m("li", [
         "Conference hashtag for ",
-        m("a", { href: "https://fsf.org/twitter" }, "microblogging"),
+        m("a", { target: "_blank", href: "https://www.fsf.org/share" }, "microblogging"),
         ": ",
         m("strong", "#libreplanet")
       ])
     ]),
-    m("h2", "IRC")
   ];
 };