From dc5c6801ed0eb82775abecd4efeebdf1ff7b1fbb Mon Sep 17 00:00:00 2001 From: calzoneman Date: Tue, 18 Jun 2013 16:18:41 -0400 Subject: [PATCH] Add voteskip button, fix bugs --- www/assets/css/ytsync.css | 4 ++++ www/assets/js/channelsettings.js | 7 ++++++ www/assets/js/ui.js | 4 ++++ www/assets/js/util.js | 38 +++++++++++++++++--------------- www/channel.html | 1 + www/channeloptions.html | 1 + 6 files changed, 37 insertions(+), 18 deletions(-) diff --git a/www/assets/css/ytsync.css b/www/assets/css/ytsync.css index f2b1682c..c9f9025d 100644 --- a/www/assets/css/ytsync.css +++ b/www/assets/css/ytsync.css @@ -318,3 +318,7 @@ html, body { border: 1px solid #aaaaaa; border-radius: 5px; } + +#channelsettingswrap3 { + margin-top: 20px; +} diff --git a/www/assets/js/channelsettings.js b/www/assets/js/channelsettings.js index 49df1834..ae2bdb82 100644 --- a/www/assets/js/channelsettings.js +++ b/www/assets/js/channelsettings.js @@ -14,6 +14,13 @@ }); } + $("#hide_settings").click(function() { + $("#csdropdown_title").text("Moderation Menu"); + $("#channelsettingswrap div.span12").each(function() { + $(this).hide(); + }); + }); + clickHandler("#show_optedit", "#optedit"); clickHandler("#show_permedit", "#permedit"); clickHandler("#show_motdedit", "#motdedit"); diff --git a/www/assets/js/ui.js b/www/assets/js/ui.js index 06d1c9bb..b6e896b7 100644 --- a/www/assets/js/ui.js +++ b/www/assets/js/ui.js @@ -215,6 +215,10 @@ $("#qlockbtn").click(function() { socket.emit("togglePlaylistLock"); }); +$("#voteskip").click(function() { + socket.emit("voteskip"); +}); + $("#getplaylist").click(function() { var callback = function(data) { PLAYER.hide(); diff --git a/www/assets/js/util.js b/www/assets/js/util.js index d50272dd..b790f504 100644 --- a/www/assets/js/util.js +++ b/www/assets/js/util.js @@ -661,24 +661,26 @@ function handlePermissionChange() { if(CLIENT.rank >= 2) { $("#channelsettingswrap3").show(); - if($("#channelsettingswrap").html() == "") - $("#channelsettingswrap").load("channeloptions.html"); - /* update channel controls */ - $("#opt_pagetitle").val(CHANNEL.opts.pagetitle); - $("#opt_externalcss").val(CHANNEL.opts.externalcss); - $("#opt_externaljs").val(CHANNEL.opts.externaljs); - $("#opt_chat_antiflood").prop("checked", CHANNEL.opts.chat_antiflood); - $("#opt_show_public").prop("checked", CHANNEL.opts.show_public); - $("#opt_enable_link_regex").prop("checked", CHANNEL.opts.enable_link_regex); - $("#opt_allow_voteskip").prop("checked", CHANNEL.opts.allow_voteskip); - $("#opt_voteskip_ratio").val(CHANNEL.opts.voteskip_ratio); - setVisible("#permedit_tab", CLIENT.rank >= 3); - setVisible("#banlist_tab", hasPermission("ban")); - setVisible("#motdedit_tab", hasPermission("motdedit")); - setVisible("#cssedit_tab", CLIENT.rank >= 3); - setVisible("#jsedit_tab", CLIENT.rank >= 3); - setVisible("#filteredit_tab", hasPermission("filteredit")); - setVisible("#channelranks_tab", CLIENT.rank >= 3); + if($("#channelsettingswrap").html() == "") { + $("#channelsettingswrap").load("channeloptions.html", function() { + /* update channel controls */ + $("#opt_pagetitle").val(CHANNEL.opts.pagetitle); + $("#opt_externalcss").val(CHANNEL.opts.externalcss); + $("#opt_externaljs").val(CHANNEL.opts.externaljs); + $("#opt_chat_antiflood").prop("checked", CHANNEL.opts.chat_antiflood); + $("#opt_show_public").prop("checked", CHANNEL.opts.show_public); + $("#opt_enable_link_regex").prop("checked", CHANNEL.opts.enable_link_regex); + $("#opt_allow_voteskip").prop("checked", CHANNEL.opts.allow_voteskip); + $("#opt_voteskip_ratio").val(CHANNEL.opts.voteskip_ratio); + setVisible("#permedit_tab", CLIENT.rank >= 3); + setVisible("#banlist_tab", hasPermission("ban")); + setVisible("#motdedit_tab", hasPermission("motdedit")); + setVisible("#cssedit_tab", CLIENT.rank >= 3); + setVisible("#jsedit_tab", CLIENT.rank >= 3); + setVisible("#filteredit_tab", hasPermission("filteredit")); + setVisible("#channelranks_tab", CLIENT.rank >= 3); + }); + } } else { $("#channelsettingswrap").html(""); diff --git a/www/channel.html b/www/channel.html index a9509272..722f813e 100644 --- a/www/channel.html +++ b/www/channel.html @@ -162,6 +162,7 @@ + diff --git a/www/channeloptions.html b/www/channeloptions.html index d8910c3b..172cd41d 100644 --- a/www/channeloptions.html +++ b/www/channeloptions.html @@ -14,6 +14,7 @@
  • Ban List
  • Channel Ranks
  • Recent Connections
  • +
  • Hide Menu