mirror of https://github.com/calzoneman/sync.git
Add quick mute buttons, fix delete not updating playlist meta
This commit is contained in:
parent
cd73653451
commit
8c47221a22
|
@ -1765,6 +1765,7 @@ Channel.prototype.deleteMedia = function (uid, callback) {
|
|||
self.sendAll("delete", {
|
||||
uid: uid
|
||||
});
|
||||
self.updatePlaylistMeta();
|
||||
self.sendPlaylistMeta(self.users);
|
||||
callback(null);
|
||||
} else {
|
||||
|
|
|
@ -528,7 +528,7 @@ Callbacks = {
|
|||
return;
|
||||
}
|
||||
|
||||
user.data("meta", data);
|
||||
user.data("meta", data.meta);
|
||||
if (data.meta.muted || data.meta.smuted) {
|
||||
user.data("icon", "glyphicon-volume-off");
|
||||
} else {
|
||||
|
@ -586,7 +586,7 @@ Callbacks = {
|
|||
},
|
||||
|
||||
setUserRank: function (data) {
|
||||
var entries = $("#cs-chanranks table").data("entries");
|
||||
var entries = $("#cs-chanranks table").data("entries") || [];
|
||||
var found = false;
|
||||
for (var i = 0; i < entries.length; i++) {
|
||||
if (entries[i].name === data.name) {
|
||||
|
|
|
@ -159,7 +159,8 @@ function getNameColor(rank) {
|
|||
function addUserDropdown(entry) {
|
||||
var name = entry.data("name"),
|
||||
rank = entry.data("rank"),
|
||||
leader = entry.data("leader");
|
||||
leader = entry.data("leader"),
|
||||
meta = entry.data("meta") || {};
|
||||
entry.find(".user-dropdown").remove();
|
||||
var menu = $("<div/>")
|
||||
.addClass("user-dropdown")
|
||||
|
@ -222,6 +223,49 @@ function addUserDropdown(entry) {
|
|||
.appendTo(btngroup);
|
||||
}
|
||||
|
||||
/* mute buttons */
|
||||
if (hasPermission("mute")) {
|
||||
var mute = $("<button/>").addClass("btn btn-xs btn-default")
|
||||
.text("Mute")
|
||||
.click(function () {
|
||||
socket.emit("chatMsg", {
|
||||
msg: "/mute " + name
|
||||
});
|
||||
mute.hide();
|
||||
smute.hide();
|
||||
unmute.show();
|
||||
})
|
||||
.appendTo(btngroup);
|
||||
var smute = $("<button/>").addClass("btn btn-xs btn-default")
|
||||
.text("Shadow Mute")
|
||||
.click(function () {
|
||||
socket.emit("chatMsg", {
|
||||
msg: "/smute " + name
|
||||
});
|
||||
mute.hide();
|
||||
smute.hide();
|
||||
unmute.show();
|
||||
})
|
||||
.appendTo(btngroup);
|
||||
var unmute = $("<button/>").addClass("btn btn-xs btn-default")
|
||||
.text("Unmute")
|
||||
.click(function () {
|
||||
socket.emit("chatMsg", {
|
||||
msg: "/unmute " + name
|
||||
});
|
||||
unmute.hide();
|
||||
mute.show();
|
||||
smute.show();
|
||||
})
|
||||
.appendTo(btngroup);
|
||||
if (meta.muted) {
|
||||
mute.hide();
|
||||
smute.hide();
|
||||
} else {
|
||||
unmute.hide();
|
||||
}
|
||||
}
|
||||
|
||||
/* ban buttons */
|
||||
if(hasPermission("ban")) {
|
||||
$("<button/>").addClass("btn btn-xs btn-default")
|
||||
|
|
Loading…
Reference in New Issue