mirror of https://github.com/calzoneman/sync.git
Start working on channel settings
This commit is contained in:
parent
f6615f1f20
commit
00abe7ced1
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
})();
|
|
@ -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"));
|
||||
|
||||
|
|
|
@ -163,6 +163,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- moderator controls -->
|
||||
<div class="span12 row-fluid" id="channelsettingswrap">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="push"></div>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<script src="/assets/js/channelsettings.js"></script>
|
||||
<ul class="nav nav-pills" id="channelsettings_nav">
|
||||
<li id="optedit_tab"><a href="javascript:void(0);" id="show_optedit">Channel Options</a></li>
|
||||
<li id="permedit_tab"><a href="javascript:void(0);" id="show_permedit">Permissions</a></li>
|
||||
<li id="motdedit_tab"><a href="javascript:void(0);" id="show_motdedit">MOTD Editor</a></li>
|
||||
<li id="filteredit_tab"><a href="javascript:void(0);" id="show_filteredit">Chat Filters</a></li>
|
||||
<li id="cssedit_tab"><a href="javascript:void(0);" id="show_cssedit">CSS Editor</a></li>
|
||||
<li id="jsedit_tab"><a href="javascript:void(0);" id="show_jsedit">JS Editor</a></li>
|
||||
<li id="banlist_tab"><a href="javascript:void(0);" id="show_banlist">Ban List</a></li>
|
||||
<li id="recentconn_tab"><a href="javascript:void(0);" id="show_recentconn">Recent Connections</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="optedit" class="span12">
|
||||
Wut
|
||||
</div>
|
||||
<div id="permedit" class="span12">
|
||||
Permissions shit
|
||||
</div>
|
||||
<div id="motdedit" class="span12">
|
||||
MOTD shit
|
||||
</div>
|
Loading…
Reference in New Issue