diff --git a/channel.js b/channel.js index ee634fdc..3cc478c0 100644 --- a/channel.js +++ b/channel.js @@ -568,7 +568,7 @@ Channel.prototype.userJoin = function(user) { } user.socket.emit("channelOpts", this.opts); user.socket.emit("setPermissions", this.permissions); - user.socket.emit("updateMotd", this.motd); + user.socket.emit("setMotd", this.motd); user.socket.emit("drinkCount", this.drinks); // Send things that require special permission diff --git a/www/assets/css/ytsync.css b/www/assets/css/ytsync.css index 969da0b5..cee604ab 100644 --- a/www/assets/css/ytsync.css +++ b/www/assets/css/ytsync.css @@ -93,7 +93,8 @@ html, body { } #leftpane-inner div.span12, #rightpane-inner div.span12, -#leftpane-inner ul, #rightpane-inner ul { +#leftpane-inner ul, #rightpane-inner ul, +#channelsettingswrap div.span12 { margin-left: 0; } diff --git a/www/assets/js/channelsettings.js b/www/assets/js/channelsettings.js new file mode 100644 index 00000000..a0367ae8 --- /dev/null +++ b/www/assets/js/channelsettings.js @@ -0,0 +1,24 @@ +(function() { + + $("#channelsettingswrap div").each(function() { + $(this).hide(); + }); + + function clickHandler(selector, div) { + $(selector).click(function() { + $("#channelsettings_nav li").each(function() { + $(this).removeClass("active"); + }); + $(selector).parent().addClass("active"); + + $("#channelsettingswrap div").each(function() { + $(this).hide(); + }); + $(div).show(); + }); + } + + clickHandler("#show_optedit", "#optedit"); + clickHandler("#show_permedit", "#permedit"); + clickHandler("#show_motdedit", "#motdedit"); +})(); diff --git a/www/assets/js/util.js b/www/assets/js/util.js index 5bba0d5e..353a5ff9 100644 --- a/www/assets/js/util.js +++ b/www/assets/js/util.js @@ -646,8 +646,11 @@ function handlePermissionChange() { $(selector).css("display", disp); } - if(CLIENT.rank < 2) { - $(".modonly").hide(); + if(CLIENT.rank >= 2) { + $("#channelsettingswrap").load("channeloptions.html"); + } + else { + $("#channelsettingswrap").html(""); } setVisible("#userpltoggle", CLIENT.rank >= 1); @@ -669,15 +672,14 @@ function handlePermissionChange() { setVisible("#clearplaylist", hasPermission("playlistclear")); setVisible("#shuffleplaylist", hasPermission("playlistshuffle")); - setVisible("#modnav", CLIENT.rank >= 2); - setVisible("#chanperms_tab", CLIENT.rank >= 3); + setVisible("#permedit_tab", CLIENT.rank >= 3); setVisible("#banlist_tab", hasPermission("ban")); - setVisible("#motdeditor_tab", hasPermission("motdedit")); - setVisible("#csseditor_tab", CLIENT.rank >= 3); - setVisible("#jseditor_tab", CLIENT.rank >= 3); - setVisible("#filtereditor_tab", hasPermission("filteredit")); - setVisible("#acl_tab", CLIENT.rank >= 3); - setVisible("#dropchannel_tab", CLIENT.rank >= 10); + setVisible("#motdedit_tab", hasPermission("motdedit")); + setVisible("#cssedit_tab", CLIENT.rank >= 3); + setVisible("#jsedit_tab", CLIENT.rank >= 3); + setVisible("#filteredit_tab", hasPermission("filteredit")); + // TODO add acl back? + setVisible("#recentconn_tab", CLIENT.rank >= 3); setVisible("#newpollbtn", hasPermission("pollctl")); diff --git a/www/channel.html b/www/channel.html index 20ed17b3..2dff557b 100644 --- a/www/channel.html +++ b/www/channel.html @@ -163,6 +163,9 @@ + +
+
diff --git a/www/channeloptions.html b/www/channeloptions.html new file mode 100644 index 00000000..306091d6 --- /dev/null +++ b/www/channeloptions.html @@ -0,0 +1,21 @@ + + + +
+ Wut +
+
+ Permissions shit +
+
+ MOTD shit +