annotate xul/content/dialog_brightnesscontrast.js @ 377:040a4fa48b37

grey icons
author hertzhaft
date Wed, 07 Dec 2005 16:01:22 +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 markCurrentBrightnessContrast() {
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 brightness = opener.content.getParameter('brgt');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
24
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
25 var items = document.getElementById('brightness_popup').childNodes;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
26
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
27 for ( i = 0; i < items.length; i++ ) {
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 if ( parseFloat(items[i].getAttribute('value')) == parseFloat(brightness) ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
30 document.getElementById('brightness_list').selectedItem = items[i];
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
31 }
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
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
35
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
36 var contrast = opener.content.getParameter('cont');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
37
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
38 items = document.getElementById('contrast_popup').childNodes;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
39
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
40 for ( i = 0; i < items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
41 if ( parseFloat(items[i].getAttribute('value')) == parseFloat(contrast) ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
42 document.getElementById('contrast_list').selectedItem = items[i];
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
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
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
48
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
49 function change() {
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 var brightness = 0.0;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
52 var contrast = 0.0;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
53
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
54 var old_brightness = opener.content.getParameter('brgt');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
55 var old_contrast = opener.content.getParameter('cont');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
56
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
57 var items = document.getElementById('brightness_popup').childNodes;
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 for ( i = 0; i <items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
60 if ( items[i].getAttribute('selected') == 'true' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
61 brightness = items[i].getAttribute('value');
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 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
64
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
65 items = document.getElementById('contrast_popup').childNodes;
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 for ( i = 0; i <items.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
68 if ( items[i].getAttribute('selected') == 'true' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
69 contrast = items[i].getAttribute('value');
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 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
72
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
73 if ( (brightness != old_brightness) || (contrast != old_contrast) ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
74 opener.content.brightnessContrast(brightness, contrast);
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 }
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
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
80 function close_dialog() {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
81
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
82 close();
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 }