Start reworking client UI

This commit is contained in:
calzoneman 2014-01-13 18:31:12 -06:00
parent 0a087c6507
commit 87f44b69e0
6 changed files with 86 additions and 113 deletions

View file

@ -516,12 +516,14 @@ Callbacks = {
},
voteskip: function(data) {
var icon = $("#voteskip").find(".glyphicon").remove();
if(data.count > 0) {
$("#voteskip").text("Voteskip ("+data.count+"/"+data.need+")");
}
else {
$("#voteskip").text("Voteskip");
$("#voteskip").text(" ("+data.count+"/"+data.need+")");
} else {
$("#voteskip").text("");
}
icon.prependTo($("#voteskip"));
},
/* REGION Rank Stuff */
@ -918,7 +920,7 @@ Callbacks = {
$("#qlockbtn").removeClass("btn-danger")
.addClass("btn-success")
.attr("title", "Playlist Unlocked");
$("#qlockbtn").find("i")
$("#qlockbtn").find("span")
.removeClass("glyphicon-lock")
.addClass("glyphicon-ok");
}
@ -926,7 +928,7 @@ Callbacks = {
$("#qlockbtn").removeClass("btn-success")
.addClass("btn-danger")
.attr("title", "Playlist Locked");
$("#qlockbtn").find("i")
$("#qlockbtn").find("span")
.removeClass("glyphicon-ok")
.addClass("glyphicon-lock");
}

View file

@ -240,30 +240,6 @@ $("#userpl_save").click(function() {
});
/* video controls */
// TODO this is ugly, change it?
(function() {
function qualHandler(select, preset) {
$(select).click(function() {
VIDEOQUALITY = preset;
USEROPTS.default_quality = select;
storeOpts();
var btn = $("#qdrop");
var caret = btn.find(".caret").detach();
btn.text($(select).text());
caret.appendTo(btn);
if(PLAYER.type == "yt" && PLAYER.player.setPlaybackQuality)
PLAYER.player.setPlaybackQuality(VIDEOQUALITY);
});
}
qualHandler("#quality_auto", "");
qualHandler("#quality_240p", "small");
qualHandler("#quality_360p", "medium");
qualHandler("#quality_480p", "large");
qualHandler("#quality_720p", "hd720");
qualHandler("#quality_1080p", "hd1080");
if($(USEROPTS.default_quality).length > 0)
$(USEROPTS.default_quality).click();
})();
$("#mediarefresh").click(function() {
PLAYER.type = "";
@ -502,3 +478,11 @@ function chanrankSubmit(rank) {
$("#cs-chanranks-mod").click(chanrankSubmit.bind(this, 2));
$("#cs-chanranks-adm").click(chanrankSubmit.bind(this, 3));
$("#cs-chanranks-owner").click(chanrankSubmit.bind(this, 4));
["#showmediaurl", "#showsearch", "#showcustomembed"].forEach(function (id) {
$(id).click(function () {
$(".plcontrol-collapse").collapse("hide");
});
});
$(".plcontrol-collapse").collapse();
$(".plcontrol-collapse").collapse("hide");

View file

@ -789,7 +789,8 @@ function handlePermissionChange() {
setVisible("#guestlogin", CLIENT.rank < 0);
setVisible("#chatline", CLIENT.rank >= 0);
setVisible("#playlistcontrolswrap", hasPermission("playlistadd"));
setVisible("#showmediaurl", hasPermission("playlistadd"));
setVisible("#showcustomembed", hasPermission("playlistaddcustom"));
$("#queue_next").attr("disabled", !hasPermission("playlistnext"));
$("#qlockbtn").attr("disabled", CLIENT.rank < 2);
@ -834,12 +835,6 @@ function handlePermissionChange() {
setVisible("#clearplaylist", hasPermission("playlistclear"));
setVisible("#shuffleplaylist", hasPermission("playlistshuffle"));
setVisible("#customembedwrap", hasPermission("playlistaddcustom"));
if(!hasPermission("playlistaddcustom")) {
$("#customembed_entry").hide();
$("#customembed_code").val("");
}
setVisible("#newpollbtn", hasPermission("pollctl"));
$("#voteskip").attr("disabled", !hasPermission("voteskip") ||