Work on channel settings

This commit is contained in:
calzoneman 2014-01-15 00:16:29 -06:00
parent b1e6f696e8
commit 8aa92f73ec
4 changed files with 80 additions and 45 deletions

View file

@ -470,3 +470,30 @@ $("#cs-chanranks-owner").click(chanrankSubmit.bind(this, 4));
});
$(".plcontrol-collapse").collapse();
$(".plcontrol-collapse").collapse("hide");
$(".cs-checkbox").change(function () {
var box = $(this);
var key = box.attr("id").replace("cs-", "");
var value = box.prop("checked");
var data = {};
data[key] = value;
socket.emit("setOptions", data);
});
$(".cs-textbox").keyup(function () {
var box = $(this);
var key = box.attr("id").replace("cs-", "");
var value = box.val();
var lastkey = Date.now();
box.data("lastkey", lastkey);
setTimeout(function () {
if (box.data("lastkey") !== lastkey || box.val() !== value) {
return;
}
var data = {};
data[key] = value;
socket.emit("setOptions", data);
}, 1000);
});