Add configurable voteskip ratio, show # voteskips to mods

This commit is contained in:
calzoneman 2013-04-20 20:17:38 -05:00
parent 6e6f6217b0
commit 40ad039a06
5 changed files with 42 additions and 5 deletions

View file

@ -75,6 +75,7 @@ function initCallbacks() {
.insertAfter($("link[href='./assets/css/ytsync.css']"));
}
$("#opt_allow_voteskip").prop("checked", opts.allow_voteskip);
$("#opt_voteskip_ratio").val(opts.voteskip_ratio);
if(opts.customjs.trim() != "") {
$.getScript(opts.customjs);
}
@ -100,6 +101,15 @@ function initCallbacks() {
updateBanlist(data.entries);
});
socket.on("voteskip", function(data) {
if(data.count > 0) {
$("#voteskip").text("Voteskip ("+data.count+"/"+data.need+")");
}
else {
$("#voteskip").text("Voteskip");
}
});
/* REGION Rank Stuff */
socket.on("rank", function(data) {

View file

@ -359,12 +359,14 @@ $("#opt_submit").click(function() {
if(ptitle == "")
ptitle = $("#opt_pagetitle").attr("placeholder")
var css = $("#opt_customcss").val();
var ratio = +$("#opt_voteskip_ratio").val() || 0.5;
opts = {
qopen_allow_qnext: $("#opt_qopen_allow_qnext").prop("checked"),
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"),
voteskip_ratio: ratio,
pagetitle: ptitle,
customcss: css,
customjs: $("#opt_customjs").val()

View file

@ -22,10 +22,10 @@
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="#">CyTube</a>
<a class="brand" href="index.html">CyTube</a>
<div class="">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li class="active"><a href="index.html">Home</a></li>
<li><a href="help.html">Help</a></li>
</ul>
<div class="navbar-form pull-right" id="loginform">
@ -120,7 +120,6 @@
<div class="span10 offset1">
<form action="javascript:void(0)">
<fieldset>
<legend>Channel Options</legend>
<div class="span4">
<label>When the queue is open:</label>
<label class="checkbox">
@ -157,6 +156,10 @@
<input type="checkbox" id="opt_allow_voteskip">
Allow voteskip
</label>
<br>
<label>Voteskip Ratio
<input type="text" id="opt_voteskip_ratio" class="pull-right">
</label>
</div>
<div class="span10">