mirror of https://github.com/calzoneman/sync.git
Add option for old-style playlist buttons (#174)
This commit is contained in:
parent
59df3924f8
commit
247862355c
|
@ -34,8 +34,10 @@ var CHANNEL = {
|
|||
|
||||
var PLAYER = false;
|
||||
var FLUIDLAYOUT = false;
|
||||
var VWIDTH = $("#ytapiplayer").parent().css("width").replace("px", "");
|
||||
var VHEIGHT = ""+parseInt(parseInt(VWIDTH) * 9 / 16);
|
||||
if($("ytapiplayer").length > 0) {
|
||||
var VWIDTH = $("#ytapiplayer").parent().css("width").replace("px", "");
|
||||
var VHEIGHT = ""+parseInt(parseInt(VWIDTH) * 9 / 16);
|
||||
}
|
||||
var POSITION = -1;
|
||||
var socket = {
|
||||
emit: function() {
|
||||
|
@ -89,7 +91,8 @@ var USEROPTS = {
|
|||
chatbtn : getOrDefault("chatbtn", false),
|
||||
altsocket : getOrDefault("altsocket", false),
|
||||
joinmessage : getOrDefault("joinmessage", true),
|
||||
qbtn_hide : getOrDefault("qbtn_hide", false)
|
||||
qbtn_hide : getOrDefault("qbtn_hide", false),
|
||||
qbtn_idontlikechange : getOrDefault("qbtn_idontlikechange", false)
|
||||
};
|
||||
|
||||
var Rank = {
|
||||
|
|
|
@ -261,9 +261,23 @@ function addQueueButtons(li) {
|
|||
.appendTo(menu);
|
||||
}
|
||||
|
||||
if(USEROPTS.qbtn_hide)
|
||||
if(USEROPTS.qbtn_hide && !USEROPTS.qbtn_idontlikechange)
|
||||
menu.hide();
|
||||
|
||||
// I DON'T LIKE CHANGE
|
||||
if(USEROPTS.qbtn_idontlikechange) {
|
||||
menu.addClass("pull-left");
|
||||
menu.detach().prependTo(li);
|
||||
menu.find(".btn").each(function() {
|
||||
// Clear icon
|
||||
var icon = $(this).find("i");
|
||||
$(this).html("");
|
||||
icon.appendTo(this);
|
||||
});
|
||||
menu.find(".qbtn-play").addClass("btn-success");
|
||||
menu.find(".qbtn-delete").addClass("btn-danger");
|
||||
}
|
||||
else {
|
||||
li.contextmenu(function(ev) {
|
||||
ev.preventDefault();
|
||||
if(menu.css("display") == "none")
|
||||
|
@ -272,6 +286,7 @@ function addQueueButtons(li) {
|
|||
menu.hide("blind");
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function rebuildPlaylist() {
|
||||
|
@ -331,11 +346,17 @@ function showOptionsMenu() {
|
|||
addOption("", warn);
|
||||
$("<hr>").appendTo(form);
|
||||
|
||||
var qbtncontainer = $("<label/>").addClass("checkbox")
|
||||
var hqbtncontainer = $("<label/>").addClass("checkbox")
|
||||
.text("Hide playlist buttons by default");
|
||||
var qbtn = $("<input/>").attr("type", "checkbox").appendTo(qbtncontainer);
|
||||
qbtn.prop("checked", USEROPTS.qbtn_hide);
|
||||
addOption("Playlist Buttons", qbtncontainer);
|
||||
var hqbtn = $("<input/>").attr("type", "checkbox").appendTo(hqbtncontainer);
|
||||
hqbtn.prop("checked", USEROPTS.qbtn_hide);
|
||||
addOption("Playlist Buttons", hqbtncontainer);
|
||||
|
||||
var oqbtncontainer = $("<label/>").addClass("checkbox")
|
||||
.text("Old style playlist buttons");
|
||||
var oqbtn = $("<input/>").attr("type", "checkbox").appendTo(oqbtncontainer);
|
||||
oqbtn.prop("checked", USEROPTS.qbtn_idontlikechange);
|
||||
addOption("Playlist Buttons (Old)", oqbtncontainer);
|
||||
|
||||
var synchcontainer = $("<label/>").addClass("checkbox")
|
||||
.text("Synchronize Media");
|
||||
|
@ -417,7 +438,8 @@ function showOptionsMenu() {
|
|||
USEROPTS.blink_title = blink.prop("checked");
|
||||
USEROPTS.chatbtn = sendbtn.prop("checked");
|
||||
USEROPTS.altsocket = altsocket.prop("checked");
|
||||
USEROPTS.qbtn_hide = qbtn.prop("checked");
|
||||
USEROPTS.qbtn_hide = hqbtn.prop("checked");
|
||||
USEROPTS.qbtn_idontlikechange = oqbtn.prop("checked");
|
||||
if(CLIENT.rank >= Rank.Moderator) {
|
||||
USEROPTS.modhat = modhat.prop("checked");
|
||||
USEROPTS.joinmessage = join.prop("checked");
|
||||
|
|
Loading…
Reference in New Issue