Fixes at Xaekai's request
This commit is contained in:
parent
c8684d58ed
commit
7b00ba10b9
|
|
@ -148,9 +148,7 @@ OptionsModule.prototype.handleSetOptions = function (user, data) {
|
||||||
var link = (""+data.externalcss).substring(0, 255);
|
var link = (""+data.externalcss).substring(0, 255);
|
||||||
if (!link) {
|
if (!link) {
|
||||||
this.opts.externalcss = "";
|
this.opts.externalcss = "";
|
||||||
return;
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var data = url.parse(link);
|
var data = url.parse(link);
|
||||||
if (!data.protocol || !data.protocol.match(/^(https?|ftp):/)) {
|
if (!data.protocol || !data.protocol.match(/^(https?|ftp):/)) {
|
||||||
|
|
@ -170,13 +168,13 @@ OptionsModule.prototype.handleSetOptions = function (user, data) {
|
||||||
|
|
||||||
this.opts.externalcss = link;
|
this.opts.externalcss = link;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ("externaljs" in data && user.account.effectiveRank >= 3) {
|
if ("externaljs" in data && user.account.effectiveRank >= 3) {
|
||||||
var link = (""+data.externaljs).substring(0, 255);
|
var link = (""+data.externaljs).substring(0, 255);
|
||||||
if (!link) {
|
if (!link) {
|
||||||
this.opts.externaljs = "";
|
this.opts.externaljs = "";
|
||||||
return;
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var data = url.parse(link);
|
var data = url.parse(link);
|
||||||
|
|
@ -197,6 +195,7 @@ OptionsModule.prototype.handleSetOptions = function (user, data) {
|
||||||
|
|
||||||
this.opts.externaljs = link;
|
this.opts.externaljs = link;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ("chat_antiflood" in data) {
|
if ("chat_antiflood" in data) {
|
||||||
this.opts.chat_antiflood = Boolean(data.chat_antiflood);
|
this.opts.chat_antiflood = Boolean(data.chat_antiflood);
|
||||||
|
|
|
||||||
|
|
@ -249,15 +249,20 @@ Callbacks = {
|
||||||
channelOpts: function(opts) {
|
channelOpts: function(opts) {
|
||||||
document.title = opts.pagetitle;
|
document.title = opts.pagetitle;
|
||||||
PAGETITLE = opts.pagetitle;
|
PAGETITLE = opts.pagetitle;
|
||||||
|
|
||||||
|
if (!USEROPTS.ignore_channelcss &&
|
||||||
|
opts.externalcss !== CHANNEL.opts.externalcss) {
|
||||||
$("#chanexternalcss").remove();
|
$("#chanexternalcss").remove();
|
||||||
|
|
||||||
if(opts.externalcss.trim() != "" && !USEROPTS.ignore_channelcss) {
|
if (opts.externalcss.trim() !== "") {
|
||||||
|
$("#chanexternalcss").remove();
|
||||||
$("<link/>")
|
$("<link/>")
|
||||||
.attr("rel", "stylesheet")
|
.attr("rel", "stylesheet")
|
||||||
.attr("href", opts.externalcss)
|
.attr("href", opts.externalcss)
|
||||||
.attr("id", "chanexternalcss")
|
.attr("id", "chanexternalcss")
|
||||||
.appendTo($("head"));
|
.appendTo($("head"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(opts.externaljs.trim() != "" && !USEROPTS.ignore_channeljs &&
|
if(opts.externaljs.trim() != "" && !USEROPTS.ignore_channeljs &&
|
||||||
opts.externaljs !== CHANNEL.opts.externaljs) {
|
opts.externaljs !== CHANNEL.opts.externaljs) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue