diff --git a/www/js/callbacks.js b/www/js/callbacks.js index ea45fed2..59cc34a6 100644 --- a/www/js/callbacks.js +++ b/www/js/callbacks.js @@ -445,6 +445,9 @@ Callbacks = { if (!CLIENT.guest) { socket.emit("initUserPLCallbacks"); + if ($("#loginform").length === 0) { + return; + } var logoutform = $("

").attr("id", "logoutform") .addClass("navbar-text pull-right") .insertAfter($("#loginform")); @@ -1151,7 +1154,7 @@ try { } } if (ALLOW_SSL && (location.protocol === "https:" || USEROPTS.secure_connection)) { - socket = io.connect(IO_URL, opts); + socket = io.connect(IO_URL, { secure: true }); } else { socket = io.connect(IO_URL); } diff --git a/www/js/theme.js b/www/js/theme.js index d9310267..e5588b0e 100644 --- a/www/js/theme.js +++ b/www/js/theme.js @@ -11,6 +11,10 @@ } } + if (theme == null || !theme.match(/^\/css\/themes\/\w+.css$/)) { + return; + } + if (theme !== "/css/themes/slate.css") { console.log("THEME COOKIE:", theme); var cur = document.getElementById("usertheme"); diff --git a/www/js/util.js b/www/js/util.js index ada1d80a..d0c59897 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -864,14 +864,16 @@ function handleModPermissions() { $("#cs-jstext").val(CHANNEL.js); $("#cs-motdtext").val(CHANNEL.motd_text); setParentVisible("a[href='#cs-motdeditor']", hasPermission("motdedit")); - setParentVisible("a[href='#cs-permissions']", CLIENT.rank >= 3); + setParentVisible("a[href='#cs-permedit']", CLIENT.rank >= 3); setParentVisible("a[href='#cs-banlist']", hasPermission("ban")); setParentVisible("a[href='#cs-csseditor']", CLIENT.rank >= 3); setParentVisible("a[href='#cs-jseditor']", CLIENT.rank >= 3); - setParentVisible("a[href='#cs-filtereditor']", CLIENT.rank >= 3); + setParentVisible("a[href='#cs-chatfilters']", hasPermission("filteredit")); + setParentVisible("a[href='#cs-emotes']", hasPermission("emoteedit")); setParentVisible("a[href='#cs-chanranks']", CLIENT.rank >= 3); setParentVisible("a[href='#cs-chanlog']", CLIENT.rank >= 3); $("#cs-chatfilters-import").attr("disabled", !hasPermission("filterimport")); + $("#cs-emotes-import").attr("disabled", !hasPermission("filterimport")); } function handlePermissionChange() {