]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Hacky support for foreground/background colours.
authorChris Porter <redacted>
Thu, 26 Jan 2012 14:48:25 +0000 (14:48 +0000)
committerChris Porter <redacted>
Thu, 26 Jan 2012 14:48:25 +0000 (14:48 +0000)
css/qui.mcss
js/qwebircinterface.js
js/ui/baseui.js

index 1aafc41c2fecc9d6337f80a416faadacde25f8d2..4ce32a5ea196c45171081b0d899ef3ea2d2c0848 100644 (file)
@@ -1,27 +1,31 @@
-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
+topic_background=c,f2f0ff,back
+lines_background=c,f2f0ff,back
+topic_border=c,c8d2dc,front
+tabbar_border=c,c3cee0,front
+tabbar_background=c,e2ecf9,back
+tabbar_text=c,000000,front
+tab_border=c,c8d2dc,front
+tab_text=c,000000,front
+tab_hover=c,ffffff,back
+tab_selected=c,ffffff,back
+tab_selected_border=c,c8d2dc,back
+tab_selected_text=c,333333,front
+input_border=c,c3cee0,front
+nicklist_border=c,c8d2dc,front
+nicklist_background=c,f2f0ff,back
+nicklist_text=c,000000,front
+nicklist_selected_border=c,c8d2dc,front
+menu_border=c,c8d2dc,front
+menu_background=c,f2f0ff,back
+menu_hover_background=c,FFFFFE,back
+lastpositionbar=c,C8D2DC,front
 timestamp_display=o,SHOW_TIMESTAMPS,inline,none
 timestamp_padding_left=o,SHOW_TIMESTAMPS,7px,11px
 timestamp_text_indent=o,SHOW_TIMESTAMPS,-7px,-9px
+nicklist_text=c,000000,front
+lines_text=c,000000,front
+menu_text=c,000000,front
+nicklist_selected_background=c,ffffff,back
 
 body {
   margin: 0;
@@ -64,7 +68,7 @@ html {
 }
 
 .qwebirc-qui .lines {
-  color: black;
+  color: $(lines_text);
   overflow: auto;
   font-size: 0.8em;
   background: $(lines_background);
@@ -211,7 +215,7 @@ html {
 
 .qwebirc-qui .nicklist a {
   display: block;
-  color: black;
+  color: $(nicklist_text);
   text-decoration: none;
   cursor: default;
   border-top: 1px solid $(nicklist_background);
@@ -221,8 +225,8 @@ html {
 
 .qwebirc-qui .nicklist a.selected {
   display: block;
-  color: black;
-  background: white;
+  color: $(nicklist_text);
+  background: $(nicklist_selected_background);
   text-decoration: none;
   border-bottom: $(nicklist_selected_border) 1px solid;
   cursor: default;
@@ -275,7 +279,7 @@ div#noscript {
 .qwebirc-qui .dropdownmenu a {
   display: block;
   font-size: 0.7em;
-  color: black;
+  color: $(menu_text);
   cursor: pointer;
   cursor: hand;  
   padding-top: 1px;
index 5d5035b715d8ae5d09ad0dc83aea309ba327f730..c290d947c3ccab1a5810c698d5f065ba72eb7c5d 100644 (file)
@@ -21,6 +21,9 @@ qwebirc.ui.Interface = new Class({
     hue: null,
     saturation: null,
     lightness: null,
+    thue: null,
+    tsaturation: null,
+    tlightness: null,
     uiOptionsArg: null,
     nickValidation: null,
     dynamicBaseURL: "/",
@@ -52,9 +55,13 @@ 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);
+        this.options.hue = this.getHueArg(args, "");
+        this.options.saturation = this.getSaturationArg(args, "");
+        this.options.lightness = this.getLightnessArg(args, "");
+
+        this.options.thue = this.getHueArg(args, "t");
+        this.options.tsaturation = this.getSaturationArg(args, "t");
+        this.options.tlightness = this.getLightnessArg(args, "t");
         
         if($defined(args["uio"]))
           this.options.uiOptionsArg = args["uio"];
@@ -127,8 +134,8 @@ qwebirc.ui.Interface = new Class({
       var details = ui_.loginBox(callback, inick, ichans, autoConnect, usingAutoNick);
     }.bind(this));
   },
-  getHueArg: function(args) {
-    var hue = args["hue"];
+  getHueArg: function(args, t) {
+    var hue = args[t + "hue"];
     if(!$defined(hue))
       return null;
     hue = parseInt(hue);
@@ -136,8 +143,8 @@ qwebirc.ui.Interface = new Class({
       return null;
     return hue;
   },
-  getSaturationArg: function(args) {
-    var saturation = args["saturation"];
+  getSaturationArg: function(args, t) {
+    var saturation = args[t + "saturation"];
     if(!$defined(saturation))
       return null;
     saturation = parseInt(saturation);
@@ -145,8 +152,8 @@ qwebirc.ui.Interface = new Class({
       return null;
     return saturation;
   },
-  getLightnessArg: function(args) {
-    var lightness = args["lightness"];
+  getLightnessArg: function(args, t) {
+    var lightness = args[t + "lightness"];
     if(!$defined(lightness))
       return null;
     lightness = parseInt(lightness);
index 52d353857775e6f50f5c4de52a735fa2d3c03c8d..ec54d473b1e1cc064ebfc7e118468de99b7d40b7 100644 (file)
@@ -220,6 +220,10 @@ qwebirc.ui.StandardUI = new Class({
     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;
+
+    if(this.options.thue !== null) this.__styleValues.textHue = this.options.thue;
+    if(this.options.tsaturation !== null) this.__styleValues.textSaturation = this.options.tsaturation;
+    if(this.options.tlightness !== null) this.__styleValues.textLightness = this.options.tlightness;
     
     var ev;
     if(Browser.Engine.trident) {
@@ -377,13 +381,23 @@ qwebirc.ui.StandardUI = new Class({
     if(!$defined(this.__styleSheet))
       return;
       
-    var hue = this.__styleValues.hue, lightness = this.__styleValues.lightness, saturation = this.__styleValues.saturation;
-    
+    var back = {hue: this.__styleValues.hue, lightness: this.__styleValues.lightness, saturation: this.__styleValues.saturation};
+    var front = {hue: this.__styleValues.textHue, lightness: this.__styleValues.textLightness, saturation: this.__styleValues.textSaturation};
+
+    if(!this.__styleValues.textHue && !this.__styleValues.textLightness && !this.__styleValues.textSaturation)
+      front = back;
+
+    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(hue).setSaturation(x.hsb[1] + saturation).setBrightness(x.hsb[2] + lightness);
+        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";