Support custom CSS

This commit is contained in:
calzoneman 2013-03-23 17:15:19 -05:00
parent 05fd0f26a8
commit 98b3587341
4 changed files with 143 additions and 12 deletions

View file

@ -85,9 +85,14 @@ function initCallbacks() {
$('#opt_qopen_allow_playnext').prop('checked', opts.qopen_allow_playnext);
$('#opt_pagetitle').attr('placeholder', opts.pagetitle);
document.title = opts.pagetitle;
$('#opt_bgimage').attr('placeholder', opts.bgimage);
if(opts.bgimage != "")
$('body').css("background", "url('" + opts.bgimage + "') no-repeat fixed");
$('#customCss').remove();
if(opts.customcss != "") {
$('<link/>').attr("rel", "stylesheet")
.attr("href", opts.customcss)
.attr("id", "customCss")
.insertAfter($('link[href="./assets/css/ytsync.css"]'));
}
CHANNELOPTS = opts;
if(opts.qopen_allow_qnext)
$('#queue_next').attr('disabled', false);

View file

@ -221,16 +221,13 @@ $('#opt_submit').click(function() {
var ptitle = $('#opt_pagetitle').val();
if(ptitle == '')
ptitle = $('#opt_pagetitle').attr('placeholder')
var bgimage = $('#opt_bgimage').val();
if(bgimage == '')
bgimage = $('#opt_bgimage').attr('placeholder')
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'),
pagetitle: ptitle,
bgimage: $('#opt_bgimage').val()
customcss: $('#opt_customcss').val()
};
socket.emit('channelOpts', opts);
});