Implement voteskip

This commit is contained in:
calzoneman 2013-04-02 14:07:22 -05:00
parent 2ee182eb48
commit 52fe508628
5 changed files with 40 additions and 1 deletions

View file

@ -90,6 +90,7 @@ function initCallbacks() {
.attr("id", "customCss")
.insertAfter($("link[href='./assets/css/ytsync.css']"));
}
$("#opt_allow_voteskip").prop("checked", opts.allow_voteskip);
CHANNELOPTS = opts;
if(opts.qopen_allow_qnext)
@ -98,6 +99,11 @@ function initCallbacks() {
$("#play_next").attr("disabled", false);
else if(RANK < Rank.Moderator && !LEADER)
$("#play_next").attr("disabled", true);
if(opts.allow_voteskip)
$("#voteskip").attr("disabled", false);
else
$("#voteskip").attr("disabled", true);
rebuildPlaylist();
});
@ -195,6 +201,7 @@ function initCallbacks() {
var linew = $("#queue").children()[data.idx];
$(linew).addClass("alert alert-info");
POSITION = data.idx;
$("#voteskip").attr("disabled", false);
});
socket.on("mediaUpdate", function(data) {

View file

@ -157,6 +157,11 @@ $("#play_next").click(function() {
socket.emit("playNext");
});
$("#voteskip").click(function() {
socket.emit("voteskip");
$("#voteskip").attr("disabled", true);
});
$("#qlockbtn").click(function() {
socket.emit("queueLock", {
locked: OPENQUEUE
@ -272,6 +277,7 @@ $("#opt_submit").click(function() {
qopen_allow_move: $("#opt_qopen_allow_move").prop("checked"),
qopen_allow_delete: $("#opt_qopen_allow_delete").prop("checked"),
qopen_allow_playnext: $("#opt_qopen_allow_playnext").prop("checked"),
allow_voteskip: $("#opt_allow_voteskip").prop("checked"),
pagetitle: ptitle,
customcss: css
};

View file

@ -80,8 +80,9 @@
<button class="btn" id="queue_next">Queue Next</button>
<button class="btn" id="queue_end">Queue @ End</button>
</div>
<button class="btn btn-primary pull-right" id="play_next">Play Next</button>
<button class="btn btn-primary" id="play_next">Play Next</button>
</div>
<button class="btn btn-danger" id="voteskip">Voteskip</button>
<ul id="queue" class="videolist">
</ul>
<button class="btn btn-danger" id="qlockbtn" style="width: 100%; display:none;">Unlock Queue</button>
@ -143,6 +144,10 @@
<label>Custom CSS<sup class="text-warning">BETA</sup>
<input type="text" id="opt_customcss" class="pull-right">
</label>
<label class="checkbox">
<input type="checkbox" id="opt_allow_voteskip">
Allow voteskip
</label>
</div>
<div class="span10">