annotate xul/content/dialog_colors.js @ 317:e4391c7e68dc

more clean-up: external JAR files no longer in CVS
author robcast
date Mon, 01 Nov 2004 18:42:29 +0100
parents 49cb8a445126
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
199
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
1 /*
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
2 Copyright (C) 2003 WTWG, Uni Bern
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
3
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
4 This program is free software; you can redistribute it and/or
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
5 modify it under the terms of the GNU General Public License
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
6 as published by the Free Software Foundation; either version 2
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
7 of the License, or (at your option) any later version.
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
8
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
12 GNU General Public License for more details.
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
13
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
15 along with this program; if not, write to the Free Software
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
17
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
18 Author: Christian Luginbuehl, 01.05.2003 , Version Alcatraz 0.3
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
19 */
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
20
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
21 function markCurrentColors() {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
22
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
23 var add = opener.content.getParameter('rgba');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
24 var mult = opener.content.getParameter('rgbm');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
25
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
26 if ( add == '' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
27 add = "0/0/0";
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
28 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
29
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
30 if ( mult == '' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
31 mult = "0/0/0";
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
32 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
33
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
34 add = add.split("/");
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
35 mult = mult.split("/");
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
36
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
37 var items = document.getElementById('add_red_popup').childNodes;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
38
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
39 for ( i = 0; i < items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
40 if ( parseFloat(items[i].getAttribute('value')) == parseFloat(add[0]) ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
41 document.getElementById('add_red_list').selectedItem = items[i];
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
42 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
43 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
44
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
45 items = document.getElementById('add_green_popup').childNodes;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
46
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
47 for ( i = 0; i < items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
48 if ( parseFloat(items[i].getAttribute('value')) == parseFloat(add[1]) ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
49 document.getElementById('add_green_list').selectedItem = items[i];
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
50 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
51 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
52
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
53 items = document.getElementById('add_blue_popup').childNodes;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
54
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
55 for ( i = 0; i < items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
56 if ( parseFloat(items[i].getAttribute('value')) == parseFloat(add[2]) ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
57 document.getElementById('add_blue_list').selectedItem = items[i];
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
58 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
59 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
60
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
61 items = document.getElementById('mult_red_popup').childNodes;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
62
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
63 for ( i = 0; i < items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
64 if ( parseFloat(items[i].getAttribute('value')) == parseFloat(mult[0]) ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
65 document.getElementById('mult_red_list').selectedItem = items[i];
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
66 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
67 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
68
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
69 items = document.getElementById('mult_green_popup').childNodes;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
70
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
71 for ( i = 0; i < items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
72 if ( parseFloat(items[i].getAttribute('value')) == parseFloat(mult[1]) ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
73 document.getElementById('mult_green_list').selectedItem = items[i];
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
74 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
75 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
76
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
77 items = document.getElementById('mult_blue_popup').childNodes;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
78
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
79 for ( i = 0; i < items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
80 if ( parseFloat(items[i].getAttribute('value')) == parseFloat(mult[2]) ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
81 document.getElementById('mult_blue_list').selectedItem = items[i];
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
82 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
83 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
84
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
85
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
86 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
87
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
88
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
89 function change() {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
90
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
91 var old_add = opener.content.getParameter('rgba');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
92 var old_mult = opener.content.getParameter('rgbm');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
93
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
94 var add = new Array();
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
95 var mult = new Array();
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
96
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
97 if ( old_add == '' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
98 old_add = "0/0/0";
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
99 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
100
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
101 if ( old_mult == '' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
102 old_mult = "0/0/0";
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
103 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
104
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
105
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
106 var items = document.getElementById('add_red_popup').childNodes;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
107
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
108 for ( i = 0; i <items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
109 if ( items[i].getAttribute('selected') == 'true' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
110 add[0] = items[i].getAttribute('value');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
111 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
112 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
113
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
114 items = document.getElementById('add_green_popup').childNodes;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
115
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
116 for ( i = 0; i <items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
117 if ( items[i].getAttribute('selected') == 'true' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
118 add[1] = items[i].getAttribute('value');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
119 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
120 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
121
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
122 items = document.getElementById('add_blue_popup').childNodes;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
123
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
124 for ( i = 0; i <items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
125 if ( items[i].getAttribute('selected') == 'true' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
126 add[2] = items[i].getAttribute('value');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
127 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
128 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
129
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
130 add = add.join("/");
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
131
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
132 items = document.getElementById('mult_red_popup').childNodes;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
133
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
134 for ( i = 0; i <items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
135 if ( items[i].getAttribute('selected') == 'true' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
136 mult[0] = items[i].getAttribute('value');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
137 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
138 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
139
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
140 items = document.getElementById('mult_green_popup').childNodes;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
141
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
142 for ( i = 0; i <items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
143 if ( items[i].getAttribute('selected') == 'true' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
144 mult[1] = items[i].getAttribute('value');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
145 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
146 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
147
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
148 items = document.getElementById('mult_blue_popup').childNodes;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
149
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
150 for ( i = 0; i <items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
151 if ( items[i].getAttribute('selected') == 'true' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
152 mult[2] = items[i].getAttribute('value');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
153 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
154 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
155
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
156 mult = mult.join("/");
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
157
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
158 if ( (add != old_add) || (mult != old_mult) ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
159 opener.content.colors(add, mult);
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
160 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
161 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
162
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
163
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
164 function close_dialog() {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
165
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
166 window.close();
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
167
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
168 }