Change modflair label to "Name Color"

Also combined adminflair and modflair into one button (the button has 2
states if you're a moderator, or 3 states if you're a site
administrator).  Resolves #517
This commit is contained in:
calzoneman 2016-03-29 22:30:16 -07:00
parent 9debebd4b9
commit 4e011c0d26
3 changed files with 13 additions and 19 deletions

View File

@ -41,8 +41,7 @@ html(lang="en")
#chatheader #chatheader
i#userlisttoggle.glyphicon.glyphicon-chevron-down.pull-left.pointer(title="Show/Hide Userlist") i#userlisttoggle.glyphicon.glyphicon-chevron-down.pull-left.pointer(title="Show/Hide Userlist")
span#usercount.pointer Not Connected span#usercount.pointer Not Connected
span#modflair.label.label-default.pull-right.pointer M span#modflair.label.label-default.pull-right.pointer Name Color
span#adminflair.label.label-default.pull-right.pointer A
#userlist #userlist
#messagebuffer.linewrap #messagebuffer.linewrap
input#chatline.form-control(type="text", maxlength="240", style="display: none") input#chatline.form-control(type="text", maxlength="240", style="display: none")

View File

@ -28,7 +28,16 @@ $("#modflair").click(function () {
var m = $("#modflair"); var m = $("#modflair");
if (m.hasClass("label-success")) { if (m.hasClass("label-success")) {
USEROPTS.modhat = false; USEROPTS.modhat = false;
m.removeClass("label-success") m.removeClass("label-success");
if (SUPERADMIN) {
USEROPTS.adminhat = true;
m.addClass("label-danger");
} else {
m.addClass("label-default");
}
} else if (m.hasClass("label-danger")) {
USEROPTS.adminhat = false;
m.removeClass("label-danger")
.addClass("label-default"); .addClass("label-default");
} else { } else {
USEROPTS.modhat = true; USEROPTS.modhat = true;
@ -37,19 +46,6 @@ $("#modflair").click(function () {
} }
}); });
$("#adminflair").click(function () {
var m = $("#adminflair");
if (m.hasClass("label-danger")) {
USEROPTS.adminhat = false;
m.removeClass("label-danger")
.addClass("label-default");
} else {
USEROPTS.adminhat = true;
m.removeClass("label-default")
.addClass("label-danger");
}
});
$("#usercount").mouseenter(function (ev) { $("#usercount").mouseenter(function (ev) {
var breakdown = calcUserBreakdown(); var breakdown = calcUserBreakdown();
// re-using profile-box class for convenience // re-using profile-box class for convenience

View File

@ -930,7 +930,6 @@ function handlePermissionChange() {
setVisible("#showchansettings", CLIENT.rank >= 2); setVisible("#showchansettings", CLIENT.rank >= 2);
setVisible("#playlistmanagerwrap", CLIENT.rank >= 1); setVisible("#playlistmanagerwrap", CLIENT.rank >= 1);
setVisible("#modflair", CLIENT.rank >= 2); setVisible("#modflair", CLIENT.rank >= 2);
setVisible("#adminflair", CLIENT.rank >= 255);
setVisible("#guestlogin", CLIENT.rank < 0); setVisible("#guestlogin", CLIENT.rank < 0);
setVisible("#chatline", CLIENT.rank >= 0); setVisible("#chatline", CLIENT.rank >= 0);
setVisible("#queue", hasPermission("seeplaylist")); setVisible("#queue", hasPermission("seeplaylist"));