Fix a few things

This commit is contained in:
CyTube 2014-02-28 06:38:22 +01:00
parent fd328d443d
commit 0dfb6df8a7
3 changed files with 12 additions and 3 deletions

View File

@ -445,6 +445,9 @@ Callbacks = {
if (!CLIENT.guest) { if (!CLIENT.guest) {
socket.emit("initUserPLCallbacks"); socket.emit("initUserPLCallbacks");
if ($("#loginform").length === 0) {
return;
}
var logoutform = $("<p/>").attr("id", "logoutform") var logoutform = $("<p/>").attr("id", "logoutform")
.addClass("navbar-text pull-right") .addClass("navbar-text pull-right")
.insertAfter($("#loginform")); .insertAfter($("#loginform"));
@ -1151,7 +1154,7 @@ try {
} }
} }
if (ALLOW_SSL && (location.protocol === "https:" || USEROPTS.secure_connection)) { if (ALLOW_SSL && (location.protocol === "https:" || USEROPTS.secure_connection)) {
socket = io.connect(IO_URL, opts); socket = io.connect(IO_URL, { secure: true });
} else { } else {
socket = io.connect(IO_URL); socket = io.connect(IO_URL);
} }

View File

@ -11,6 +11,10 @@
} }
} }
if (theme == null || !theme.match(/^\/css\/themes\/\w+.css$/)) {
return;
}
if (theme !== "/css/themes/slate.css") { if (theme !== "/css/themes/slate.css") {
console.log("THEME COOKIE:", theme); console.log("THEME COOKIE:", theme);
var cur = document.getElementById("usertheme"); var cur = document.getElementById("usertheme");

View File

@ -864,14 +864,16 @@ function handleModPermissions() {
$("#cs-jstext").val(CHANNEL.js); $("#cs-jstext").val(CHANNEL.js);
$("#cs-motdtext").val(CHANNEL.motd_text); $("#cs-motdtext").val(CHANNEL.motd_text);
setParentVisible("a[href='#cs-motdeditor']", hasPermission("motdedit")); 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-banlist']", hasPermission("ban"));
setParentVisible("a[href='#cs-csseditor']", CLIENT.rank >= 3); setParentVisible("a[href='#cs-csseditor']", CLIENT.rank >= 3);
setParentVisible("a[href='#cs-jseditor']", 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-chanranks']", CLIENT.rank >= 3);
setParentVisible("a[href='#cs-chanlog']", CLIENT.rank >= 3); setParentVisible("a[href='#cs-chanlog']", CLIENT.rank >= 3);
$("#cs-chatfilters-import").attr("disabled", !hasPermission("filterimport")); $("#cs-chatfilters-import").attr("disabled", !hasPermission("filterimport"));
$("#cs-emotes-import").attr("disabled", !hasPermission("filterimport"));
} }
function handlePermissionChange() { function handlePermissionChange() {