annotate xul/content/alcatraz_toolbar.js @ 203:bf945fcf9105

restarting with version control of xul sidebar/toolbar
author luginbue
date Fri, 27 Feb 2004 11:24:53 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
1 /*
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
2 Copyright (C) 2003 WTWG, Uni Bern
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
3
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
4 This program is free software; you can redistribute it and/or
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
5 modify it under the terms of the GNU General Public License
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
6 as published by the Free Software Foundation; either version 2
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
7 of the License, or (at your option) any later version.
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
8
bf945fcf9105 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,
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
12 GNU General Public License for more details.
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
13
bf945fcf9105 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
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
15 along with this program; if not, write to the Free Software
bf945fcf9105 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
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
17
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
18 Author: Christian Luginbuehl, 01.05.2003 , Version Alcatraz 0.5
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
19 */
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
20
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
21
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
22 function dialog_page() {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
23 window.openDialog("chrome://alcatraz/content/dialog_page.xul", "dialog_page", "chrome,dialog,resizable=no", "");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
24 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
25
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
26
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
27 function dialog_options() {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
28 window.openDialog("chrome://alcatraz/content/dialog_options.xul", "dialog_options", "chrome,dialog,resizable=no", "");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
29 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
30
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
31
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
32 function updatePageDisplay() {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
33 if ( typeof(window.content.getParameter) == 'function' ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
34 var actual = window.content.getParameter('pn');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
35 var total = window.content.getParameter('pt');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
36
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
37 if ( (parseInt(actual) > 0) && (parseInt(total) > 0)) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
38 document.getElementById('button_page').setAttribute('label', actual + " of " + total);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
39 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
40 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
41
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
42 setTimeout('updatePageDisplay()', 200);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
43 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
44 setTimeout('updatePageDisplay()', 200);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
45
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
46
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
47 function page(value) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
48
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
49 var keeparea = getSetting( 'keeparea' );
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
50
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
51 if ( keeparea == 'true' ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
52 window.content.page(value, 2);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
53 } else if ( keeparea == 'false' ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
54 window.content.page(value, 1);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
55 } else {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
56 // no preferences saved
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
57 window.content.page(value, 1);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
58 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
59
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
60 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
61
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
62
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
63 function zoomIn() {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
64
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
65 var zoomkind = getSetting( 'zoomkind' );
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
66
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
67 if ( zoomkind == 'zoomarea' ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
68 window.content.zoomArea();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
69 } else if ( zoomkind == 'zoompoint' ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
70 window.content.zoomPoint();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
71 } else {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
72 // no preferences saved
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
73 window.content.zoomArea();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
74 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
75
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
76 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
77
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
78
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
79 function zoomOut() {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
80
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
81 var zoomkind = getSetting( 'zoomkind' );
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
82
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
83 if ( zoomkind == 'zoomarea' ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
84 window.content.zoomExtends();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
85 } else if ( zoomkind == 'zoompoint' ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
86 window.content.zoomOut();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
87 } else {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
88 // no preferences saved
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
89 window.content.zoomExtends();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
90 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
91
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
92 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
93
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
94
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
95 function change_help() {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
96
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
97 if ( document.getElementById('item_contexthelp').getAttribute('checked') == 'true' ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
98
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
99 document.getElementById('button_first').setAttribute('tooltiptext', 'Go to the first page of this document');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
100 document.getElementById('button_prev').setAttribute('tooltiptext', 'Go to the previous page of this document');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
101 document.getElementById('button_page').setAttribute('tooltiptext', 'Go to a specific page you enter');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
102 document.getElementById('button_next').setAttribute('tooltiptext', 'Go to the next page of this document');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
103 document.getElementById('button_last').setAttribute('tooltiptext', 'Go to the last page of this document');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
104 document.getElementById('button_mark').setAttribute('tooltiptext', 'Place marks on the picture. Left-click on the image to place a numbered mark');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
105 document.getElementById('button_ref').setAttribute('tooltiptext', 'Get a hyperlink eighter which can reproduce your selected area and marks');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
106 document.getElementById('button_thumbs').setAttribute('tooltiptext', 'Open a thumbnailview of the current document (image serie)');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
107 document.getElementById('button_zoomin').setAttribute('tooltiptext', 'Zoom into the picture (behaviour is selected under ? -> Options)');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
108 document.getElementById('button_zoomout').setAttribute('tooltiptext', 'Zooms out of the selected region');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
109
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
110 document.getElementById('button_help').setAttribute('tooltiptext', 'Change default options or (de)select the context-help');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
111
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
112 document.getElementById('button_scale').setAttribute('tooltiptext', 'Select the factor the picture will be scaled to (relative to the size of the working area)');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
113 document.getElementById('button_mirror').setAttribute('tooltiptext', 'Mirrors the image eighter horizontally or vertically');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
114 document.getElementById('button_rotate').setAttribute('tooltiptext', 'Rotate the image by the angle you specify');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
115 document.getElementById('button_brightnesscontrast').setAttribute('tooltiptext', 'Adjust the brightness and contrast of the picture');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
116 document.getElementById('button_colors').setAttribute('tooltiptext', 'Adjust the values of each RGB color-channel');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
117
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
118 } else {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
119
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
120 var buttons = document.getElementsByTagName('button');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
121
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
122 for ( i = 0; i < buttons.length; i++ ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
123 buttons[i].removeAttribute('tooltiptext');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
124 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
125
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
126 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
127
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
128 }