From df34cc44bbb06730cf0f844790ed3eface38baf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Tue, 21 Jul 2015 16:23:32 +0200 Subject: [PATCH] Fixed #129 --- php/panel.php | 6 ++++++ server/server.js | 12 +++++++++--- static/css/style.css | 6 +++++- static/js/admin.js | 5 +++++ 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/php/panel.php b/php/panel.php index 9a82c519..781a331a 100755 --- a/php/panel.php +++ b/php/panel.php @@ -144,3 +144,9 @@ + diff --git a/server/server.js b/server/server.js index 5bd7f392..537b6383 100755 --- a/server/server.js +++ b/server/server.js @@ -186,7 +186,7 @@ io.on('connection', function(socket){ }else { db.createCollection(coll, function(err, docs){ - db.collection(coll).insert({"addsongs":false, "adminpass":"", "allvideos":false, "frontpage":true, "longsongs":false, "removeplay": false, "shuffle": true, "skip": false, "skips": [], "startTime":get_time(), "views": [], "vote": false}, function(err, docs) + db.collection(coll).insert({"addsongs":false, "adminpass":"", "allvideos":false, "frontpage":true, "longsongs":false, "removeplay": false, "shuffle": true, "skip": false, "skips": [], "startTime":get_time(), "views": [], "vote": false, "desc": ""}, function(err, docs) { send_list(coll, socket, true, false, true); @@ -432,6 +432,8 @@ io.on('connection', function(socket){ var adminpass = params[6]; var skipping = params[7]; var shuffling = params[8]; + var description = ""; + if(params.length == 10) description = params[9]; if(adminpass != "") var hash = hash_pass(adminpass); @@ -450,7 +452,8 @@ io.on('connection', function(socket){ removeplay:removeplay, shuffle:shuffling, longsongs:longsongs, - adminpass:hash}}, function(err, docs){ + adminpass:hash, + desc: description}}, function(err, docs){ db.collection(coll).find({views:{$exists:true}}, function(err, docs) { io.to(coll).emit("conf", docs); @@ -692,7 +695,10 @@ function send_list(coll, socket, send, list_send, configs) if(configs) { - db.collection(coll).find({views:{$exists:true}}, function(err, conf){ + db.collection(coll).find({views:{$exists:true}}, function(err, conf){ + if(conf[0].desc === undefined) + db.collection(coll).update({views:{$exists:true}}, {$set:{"desc":""}}); + //db.collection(coll).update({views:{$exists:true}}, {$set:{"desc":""}}, function(err, d){console.log(d)}); io.to(coll).emit("conf", conf); }); } diff --git a/static/css/style.css b/static/css/style.css index c5b668e1..5d9811e2 100755 --- a/static/css/style.css +++ b/static/css/style.css @@ -261,6 +261,10 @@ hide mdi-action-visibility mdi-action-visibility-off /*------------------- Channel page ---------------------------------------------------------------------------- */ +#description, #desc-title{ + color:#444; +} + #main-row{ margin-bottom:-64px; } @@ -496,7 +500,7 @@ ul #chat-log{ text-transform: none; text-rendering: auto; -webkit-font-smoothing: antialiased; - content: "\e684";/*"\e800";*/ + content: "\e686";/*"\e800";*/ color:white; font-size:65px; position:absolute; diff --git a/static/js/admin.js b/static/js/admin.js index ad0fd0f1..ae292a1a 100755 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -149,6 +149,11 @@ var Admin = { $("#admin-lock").addClass("mdi-action-lock"); $("#admin-lock").removeClass("mdi-action-lock-open clickable"); } + + /*if(conf_array.desc !== undefined) + { + document.getElementById("description").innerHTML = conf_array.desc; + }*/ }, submitAdmin: function(form)