Change some permissions to channel admins (#67)
This commit is contained in:
parent
184fbcd971
commit
9350ef6d75
7 changed files with 45 additions and 16 deletions
|
|
@ -181,6 +181,7 @@ function initCallbacks() {
|
|||
socket.on("updateUser", function(data) {
|
||||
if(data.name == uname) {
|
||||
LEADER = data.leader;
|
||||
RANK = data.rank;
|
||||
handleRankChange();
|
||||
if(LEADER) {
|
||||
// I'm a leader! Set up sync function
|
||||
|
|
|
|||
|
|
@ -429,22 +429,32 @@ $("#show_motdeditor").click(function() {
|
|||
});
|
||||
|
||||
$("#show_filtereditor").click(function() {
|
||||
$("#modnav li").each(function() {
|
||||
$(this).removeClass("active");
|
||||
});
|
||||
$(".modonly").hide();
|
||||
$("#show_filtereditor").parent().addClass("active");
|
||||
$("#filtereditor").show();
|
||||
if(RANK >= Rank.Owner) {
|
||||
$("#modnav li").each(function() {
|
||||
$(this).removeClass("active");
|
||||
});
|
||||
$(".modonly").hide();
|
||||
$("#show_filtereditor").parent().addClass("active");
|
||||
$("#filtereditor").show();
|
||||
}
|
||||
else {
|
||||
alert("Only channel administrators can change filters");
|
||||
}
|
||||
});
|
||||
|
||||
$("#show_acl").click(function() {
|
||||
$("#modnav li").each(function() {
|
||||
$(this).removeClass("active");
|
||||
});
|
||||
$(".modonly").hide();
|
||||
$("#show_acl").parent().addClass("active");
|
||||
$("#channelranks").show();
|
||||
socket.emit("requestAcl");
|
||||
if(RANK >= Rank.Owner) {
|
||||
$("#modnav li").each(function() {
|
||||
$(this).removeClass("active");
|
||||
});
|
||||
$(".modonly").hide();
|
||||
$("#show_acl").parent().addClass("active");
|
||||
$("#channelranks").show();
|
||||
socket.emit("requestAcl");
|
||||
}
|
||||
else {
|
||||
alert("Only channel administrators can use the ACL");
|
||||
}
|
||||
});
|
||||
|
||||
function searchLibrary() {
|
||||
|
|
|
|||
|
|
@ -760,6 +760,15 @@ function handleRankChange() {
|
|||
$("#shuffleplaylist").css("display", "");
|
||||
$("#modnav").show();
|
||||
$("#chancontrols").show();
|
||||
var val = false;
|
||||
if(RANK < Rank.Owner) {
|
||||
val = "disabled";
|
||||
}
|
||||
$("#opt_pagetitle").attr("disabled", val);
|
||||
$("#opt_customcss").attr("disabled", val);
|
||||
$("#opt_customjs").attr("disabled", val);
|
||||
$("#show_filtereditor").attr("disabled", val);
|
||||
$("#show_acl").attr("disabled", val);
|
||||
}
|
||||
else if(!LEADER) {
|
||||
if(OPENQUEUE) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue