-topic_background=f2f0ff
-lines_background=f2f0ff
-topic_border=c8d2dc
-tabbar_border=c3cee0
-tabbar_background=e2ecf9
-tabbar_text=000000
-tab_border=c8d2dc
-tab_text=000000
-tab_hover=ffffff
-tab_selected=ffffff
-tab_selected_border=c8d2dc
-tab_selected_text=333333
-input_border=c3cee0
-nicklist_border=c8d2dc
-nicklist_background=f2f0ff
-nicklist_text=000000
-nicklist_selected_border=c8d2dc
-menu_border=c8d2dc
-menu_background=f2f0ff
-menu_hover_background=FFFFFE
-lastpositionbar=C8D2DC
+topic_background=c,f2f0ff
+lines_background=c,f2f0ff
+topic_border=c,c8d2dc
+tabbar_border=c,c3cee0
+tabbar_background=c,e2ecf9
+tabbar_text=c,000000
+tab_border=c,c8d2dc
+tab_text=c,000000
+tab_hover=c,ffffff
+tab_selected=c,ffffff
+tab_selected_border=c,c8d2dc
+tab_selected_text=c,333333
+input_border=c,c3cee0
+nicklist_border=c,c8d2dc
+nicklist_background=c,f2f0ff
+nicklist_text=c,000000
+nicklist_selected_border=c,c8d2dc
+menu_border=c,c8d2dc
+menu_background=c,f2f0ff
+menu_hover_background=c,FFFFFE
+lastpositionbar=c,C8D2DC
body {
margin: 0;
/* how horribly inefficient */
String.prototype.replaceAll = function(f, t) {
+ //return new RegExp("/" + RegExp.escape(f) + "/g").replace(f, RegExp.escape(t));
var i = this.indexOf(f);
var c = this;
}
RegExp.escape = function(text) {
- if(!arguments.callee.sRE) {
- var specials = [
- '/', '.', '*', '+', '?', '|',
- '(', ')', '[', ']', '{', '}', '\\'
- ];
- arguments.callee.sRE = new RegExp('(\\' + specials.join('|\\') + ')', 'g');
- }
-
- return text.replace(arguments.callee.sRE, '\\$1');
+ return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
}
qwebirc.ui.insertAt = function(position, parent, element) {
this.uiOptions = new qwebirc.ui.DefaultOptionsClass(this, options.uiOptionsArg);
this.customWindows = {};
+ this.__styleValues = {hue: this.uiOptions.STYLE_HUE, saturation: 0, lightness: 0};
+ if($defined(this.options.hue)) this.__styleValues.hue = this.options.hue;
+ if($defined(this.options.saturation)) this.__styleValues.saturation = this.options.saturation;
+ if($defined(this.options.lightness)) this.__styleValues.lightness = this.options.lightness;
+
var ev;
if(Browser.Engine.trident) {
ev = "keydown";
},
setModifiableStylesheet: function(name) {
this.__styleSheet = new qwebirc.ui.style.ModifiableStylesheet(qwebirc.global.staticBaseURL + "css/" + name + qwebirc.FILE_SUFFIX + ".mcss");
-
- this.setModifiableStylesheetValues($defined(this.options.hue) ? this.options.hue : this.uiOptions.STYLE_HUE, $defined(this.options.saturation) ? this.options.saturation : 0, $defined(this.options.lightness) ? this.options.lightness : 0);
+ this.setModifiableStylesheetValues({});
},
- setModifiableStylesheetValues: function(hue, saturation, lightness) {
+ setModifiableStylesheetValues: function(values) {
+ for(var k in values)
+ this.__styleValues[k] = values[k];
+
if(!$defined(this.__styleSheet))
return;
- this.__styleSheet.set(function(x) {
- return x.setHue(hue).setSaturation(x.hsb[1] + saturation).setBrightness(x.hsb[2] + lightness);
- });
+
+ var hue = this.__styleValues.hue, lightness = this.__styleValues.lightness, saturation = this.__styleValues.saturation;
+
+ this.__styleSheet.set(function() {
+ var mode = arguments[0];
+ if(mode == "c") {
+ var x = new Color(arguments[1]);
+ var c = x.setHue(hue).setSaturation(x.hsb[1] + saturation).setBrightness(x.hsb[2] + lightness);
+ if(c == "255,255,255") /* IE confuses white with transparent... */
+ c = "255,255,254";
+
+ return "rgb(" + c + ")";
+ } else if(mode == "o") {
+ return this.uiOptions[arguments[1]] ? arguments[2] : arguments[3];
+ }
+ }.bind(this));
}
});
return {class_: qwebirc.config.HueOption, default_: 210};
}, {
applyChanges: function(value, ui) {
- ui.setModifiableStylesheetValues(value, 0, 0);
+ ui.setModifiableStylesheetValues({hue: value});
}
}],
[12, "QUERY_ON_NICK_CLICK", "Query on nickname click in channel", false],
var text = this.__cssText;
for(var key in this.rules) {
- var value = mutator(new Color(this.rules[key]));
+ var s = this.rules[key].split(",");
+ var value = mutator.pass(s);
- if(value == "255,255,255") /* IE confuses white with transparent... */
- value = "255,255,254";
-
- text = text.replaceAll("$(" + key + ")", "rgb(" + value + ")");
+ text = text.replaceAll("$(" + key + ")", value);
}
this.__setStylesheet(text);