From 0365de5a1a9910a2f107900521dcac780f366869 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Sat, 6 Apr 2013 16:08:26 -0500 Subject: [PATCH] Tweaks to ACP and channel options --- user.js | 29 ++--------------------------- www/assets/js/acp.js | 3 +++ www/assets/js/callbacks.js | 4 ++-- www/assets/js/client.js | 2 -- 4 files changed, 7 insertions(+), 31 deletions(-) diff --git a/user.js b/user.js index 0d47cfa4..5fc1bd24 100644 --- a/user.js +++ b/user.js @@ -241,8 +241,8 @@ User.prototype.handleAdm = function(data) { var chans = []; for(var chan in Server.channels) { var nowplaying = "-"; - if(Server.channels[chan].currentMedia != null) - nowplaying = Server.channels[chan].currentMedia.title; + if(Server.channels[chan].media != null) + nowplaying = Server.channels[chan].media.title; chans.push({ name: chan, usercount: Server.channels[chan].users.length, @@ -254,31 +254,6 @@ User.prototype.handleAdm = function(data) { chans: chans }); } - else if(data.cmd == "listusers") { - var users = []; - var dbusers = Database.listUsers(); - if(!dbusers) - return; - for(var i = 0; i < dbusers.length; i++) { - users[i] = { - name: dbusers[i].uname, - rank: dbusers[i].global_rank - }; - } - this.socket.emit("adm", { - cmd: "listusers", - users: users - }); - } - else if(data.cmd == "listchannelranks") { - if(data.chan == undefined) - return; - this.socket.emit("adm", { - cmd: "listchannelranks", - ranks: Database.listChannelRanks(data.chan) - }); - } - }; // Attempt to login diff --git a/www/assets/js/acp.js b/www/assets/js/acp.js index b882ff2c..4bcce38c 100644 --- a/www/assets/js/acp.js +++ b/www/assets/js/acp.js @@ -48,6 +48,9 @@ function initCallbacks() { cmd: "listchannels" }); }, 10000); + socket.emit("adm", { + cmd: "listchannels" + }); }); } diff --git a/www/assets/js/callbacks.js b/www/assets/js/callbacks.js index 53a94c05..dc2476e3 100644 --- a/www/assets/js/callbacks.js +++ b/www/assets/js/callbacks.js @@ -57,9 +57,9 @@ function initCallbacks() { $("#opt_pagetitle").attr("placeholder", opts.pagetitle); document.title = opts.pagetitle; PAGETITLE = opts.pagetitle; - $("#opt_customcss").attr("placeholder", opts.customcss); + $("#opt_customcss").val(opts.customcss); $("#customCss").remove(); - if(opts.customcss != "") { + if(opts.customcss.trim() != "") { $("").attr("rel", "stylesheet") .attr("href", opts.customcss) .attr("id", "customCss") diff --git a/www/assets/js/client.js b/www/assets/js/client.js index 9595c7e9..b816df14 100644 --- a/www/assets/js/client.js +++ b/www/assets/js/client.js @@ -268,8 +268,6 @@ $("#opt_submit").click(function() { if(ptitle == "") ptitle = $("#opt_pagetitle").attr("placeholder") var css = $("#opt_customcss").val(); - if(css == "") - css = $("#opt_customcss").attr("placeholder"); opts = { qopen_allow_qnext: $("#opt_qopen_allow_qnext").prop("checked"), qopen_allow_move: $("#opt_qopen_allow_move").prop("checked"),