]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Hack in saturation/lightness hidden params.
authorChris Porter <redacted>
Tue, 4 Jan 2011 14:59:02 +0000 (14:59 +0000)
committerChris Porter <redacted>
Tue, 4 Jan 2011 14:59:02 +0000 (14:59 +0000)
js/qwebircinterface.js
js/ui/baseui.js

index 49897807b03481cf70ddcc0c3b5de273e3440908..046ddc681a65f058659c1bf3a1a9741b5e4d0414 100644 (file)
@@ -19,6 +19,8 @@ qwebirc.ui.Interface = new Class({
     theme: undefined,
     baseURL: null,
     hue: null,
+    saturation: null,
+    lightness: null,
     uiOptionsArg: null,
     dynamicBaseURL: "/",
     staticBaseURL: "/"
@@ -45,6 +47,8 @@ qwebirc.ui.Interface = new Class({
       if(this.options.searchURL) {
         var args = qwebirc.util.parseURI(String(document.location));
         this.options.hue = this.getHueArg(args);
+        this.options.saturation = this.getSaturationArg(args);
+        this.options.lightness = this.getLightnessArg(args);
         
         if($defined(args["uio"]))
           this.options.uiOptionsArg = args["uio"];
@@ -126,6 +130,24 @@ qwebirc.ui.Interface = new Class({
       return null;
     return hue;
   },
+  getSaturationArg: function(args) {
+    var saturation = args["saturation"];
+    if(!$defined(saturation))
+      return null;
+    saturation = parseInt(saturation);
+    if(saturation > 100 || saturation < -100)
+      return null;
+    return saturation;
+  },
+  getLightnessArg: function(args) {
+    var lightness = args["lightness"];
+    if(!$defined(lightness))
+      return null;
+    lightness = parseInt(lightness);
+    if(lightness > 100 || lightness < -100)
+      return null;
+    return lightness;
+  },
   randSub: function(nick) {
     var getDigit = function() { return Math.floor(Math.random() * 10); }
     
index c44fe99daccbf075b1ac43ec73c607db0ccb9c5f..0da6ec15203563e36a2262e1c0ed9d2b35a13ebe 100644 (file)
@@ -341,11 +341,7 @@ qwebirc.ui.StandardUI = new Class({
   setModifiableStylesheet: function(name) {
     this.__styleSheet = new qwebirc.ui.style.ModifiableStylesheet(qwebirc.global.staticBaseURL + "css/" + name + qwebirc.FILE_SUFFIX + ".mcss");
     
-    if($defined(this.options.hue)) {
-      this.setModifiableStylesheetValues(this.options.hue, 0, 0);
-    } else {
-      this.setModifiableStylesheetValues(this.uiOptions.STYLE_HUE, 0, 0);
-    }
+    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);
   },
   setModifiableStylesheetValues: function(hue, saturation, lightness) {
     if(!$defined(this.__styleSheet))