This commit is contained in:
Calvin Montgomery 2013-06-25 22:03:14 -04:00
parent 770f252105
commit 4ce0ac646a
3 changed files with 24 additions and 17 deletions

View File

@ -270,14 +270,14 @@ Callbacks = {
document.title = opts.pagetitle;
PAGETITLE = opts.pagetitle;
$("#chanexternalcss").remove();
if(opts.externalcss.trim() != "") {
if(opts.externalcss.trim() != "" && !USEROPTS.ignore_channelcss) {
$("<link/>")
.attr("rel", "stylesheet")
.attr("href", opts.externalcss)
.attr("id", "chanexternalcss")
.appendTo($("head"));
}
if(opts.externaljs.trim() != "") {
if(opts.externaljs.trim() != "" && !USEROPTS.ignore_channeljs) {
if(opts.externaljs != CHANNEL.opts.externaljs) {
$.getScript(opts.externaljs);
}
@ -301,22 +301,20 @@ Callbacks = {
channelCSSJS: function(data) {
$("#chancss").remove();
$("#chanjs").remove();
CHANNEL.css = data.css;
CHANNEL.js = data.js;
$("#csstext").val(data.css);
$("#jstext").val(data.js);
if(data.css) {
if(data.css && !USEROPTS.ignore_channelcss) {
$("<style/>").attr("type", "text/css")
.attr("id", "chancss")
.text(data.css)
.appendTo($("head"));
}
if(data.js) {
$("#chanjs").remove();
CHANNEL.js = data.js;
$("#jstext").val(data.js);
if(data.js && !USEROPTS.ignore_channeljs) {
$("<script/>").attr("type", "text/javascript")
.attr("id", "chanjs")
.text(data.js)

View File

@ -95,7 +95,9 @@ var USEROPTS = {
joinmessage : getOrDefault("joinmessage", true),
qbtn_hide : getOrDefault("qbtn_hide", false),
qbtn_idontlikechange : getOrDefault("qbtn_idontlikechange", false),
first_visit : getOrDefault("first_visit", true)
first_visit : getOrDefault("first_visit", true),
ignore_channelcss : getOrDefault("ignore_channelcss", false),
ignore_channeljs : getOrDefault("ignore_channeljs", false)
};
var Rank = {

View File

@ -384,6 +384,17 @@ function showOptionsMenu() {
.text("Changing layouts may require a refresh")
addOption("", warn);
$("<hr>").appendTo(form);
var nocsscontainer = $("<label/>").addClass("checkbox")
.text("Ignore channel CSS");
var nocss = $("<input/>").attr("type", "checkbox").appendTo(nocsscontainer);
nocss.prop("checked", USEROPTS.ignore_channelcss);
addOption("Channel CSS", nocsscontainer);
var nojscontainer = $("<label/>").addClass("checkbox")
.text("Ignore channel JS");
var nojs = $("<input/>").attr("type", "checkbox").appendTo(nojscontainer);
nojs.prop("checked", USEROPTS.ignore_channeljs);
addOption("Channel JS", nojscontainer);
$("<hr>").appendTo(form);
var hqbtncontainer = $("<label/>").addClass("checkbox")
.text("Hide playlist buttons by default");
@ -440,12 +451,6 @@ function showOptionsMenu() {
altsocket.prop("checked", USEROPTS.altsocket);
addOption("Alternate Socket", altsocketcontainer);
var profile = $("<a/>").attr("target", "_blank")
.addClass("btn")
.attr("href", "./account.html")
.text("Profile has moved to the account page");
addOption("Profile", profile);
if(CLIENT.rank >= Rank.Moderator) {
$("<hr>").appendTo(form);
var modhatcontainer = $("<label/>").addClass("checkbox")
@ -479,6 +484,8 @@ function showOptionsMenu() {
USEROPTS.altsocket = altsocket.prop("checked");
USEROPTS.qbtn_hide = hqbtn.prop("checked");
USEROPTS.qbtn_idontlikechange = oqbtn.prop("checked");
USEROPTS.ignore_channelcss = nocss.prop("checked");
USEROPTS.ignore_channeljs = nojs.prop("checked");
if(CLIENT.rank >= Rank.Moderator) {
USEROPTS.modhat = modhat.prop("checked");
USEROPTS.joinmessage = join.prop("checked");