Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Porter <slug@qwebirc.org>2012-01-26 14:48:25 (GMT)
committer Chris Porter <slug@qwebirc.org>2012-01-26 14:48:25 (GMT)
commit52244b1ceb3d5c742ef85ac0cb1eae9c61be0c74 (patch)
tree6678787b8a5e3554e66bfd150fd7b18eadbb0da6
parent4e3521a8ff00b8572f17a97748e1c726698eaed5 (diff)
Hacky support for foreground/background colours.
-rw-r--r--css/qui.mcss56
-rw-r--r--js/qwebircinterface.js25
-rw-r--r--js/ui/baseui.js20
3 files changed, 63 insertions, 38 deletions
diff --git a/css/qui.mcss b/css/qui.mcss
index 1aafc41..4ce32a5 100644
--- a/css/qui.mcss
+++ b/css/qui.mcss
@@ -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;
diff --git a/js/qwebircinterface.js b/js/qwebircinterface.js
index 5d5035b..c290d94 100644
--- a/js/qwebircinterface.js
+++ b/js/qwebircinterface.js
@@ -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);
diff --git a/js/ui/baseui.js b/js/ui/baseui.js
index 52d3538..ec54d47 100644
--- a/js/ui/baseui.js
+++ b/js/ui/baseui.js
@@ -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";