+ },
+ tabComplete: function(element, backwards) {
+ this.tabCompleter.tabComplete(element, backwards);
+ },
+ resetTabComplete: function() {
+ this.tabCompleter.reset();
+ },
+ setModifiableStylesheet: function(name) {
+ this.__styleSheet = new qwebirc.ui.style.ModifiableStylesheet(qwebirc.global.staticBaseURL + "css/" + name + qwebirc.FILE_SUFFIX + ".mcss");
+ this.setModifiableStylesheetValues({});
+ },
+ setModifiableStylesheetValues: function(values) {
+ for (var k in values)
+ this.__styleValues[k] = values[k];
+
+ if (!$defined(this.__styleSheet))
+ return;
+
+ var back = {hue: this.__styleValues.hue, lightness: this.__styleValues.lightness, saturation: this.__styleValues.saturation};
+ var front;
+ if (!$defined(this.__styleValues.textHue) && !$defined(this.__styleValues.textLightness) && !$defined(this.__styleValues.textSaturation)) {
+ front = back;
+ } else {
+ front = {hue: Number(this.__styleValues.textHue), lightness: Number(this.__styleValues.textLightness), saturation: Number(this.__styleValues.textSaturation)}
+ }
+ var colours = {
+ back: back,
+ front: front
+ };
+
+ this.__styleSheet.set(function() {
+ var mode = arguments[0];
+ if(mode == "c") {
+ var t = colours[arguments[2]];
+ var x = new Color(arguments[1]);
+ var c = x.setHue(t.hue).setSaturation(x.hsb[1] + t.saturation).setBrightness(x.hsb[2] + t.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));