annotate xul/content/alcatraz_toolbar.js @ 337:75efda795d7f

Servlet version 1.5.4b - filenames with dots (brr...) work when given without extension
author robcast
date Wed, 17 Nov 2004 19:30:34 +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.5
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
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
22 function dialog_page() {
49cb8a445126 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", "");
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
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 function dialog_options() {
49cb8a445126 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", "");
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
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 function updatePageDisplay() {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
33 if ( typeof(window.content.getParameter) == 'function' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
34 var actual = window.content.getParameter('pn');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
35 var total = window.content.getParameter('pt');
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 if ( (parseInt(actual) > 0) && (parseInt(total) > 0)) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
38 document.getElementById('button_page').setAttribute('label', actual + " of " + total);
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 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
41
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
42 setTimeout('updatePageDisplay()', 200);
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 setTimeout('updatePageDisplay()', 200);
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 function page(value) {
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 var keeparea = getSetting( 'keeparea' );
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 if ( keeparea == 'true' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
52 window.content.page(value, 2);
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
53 } else if ( keeparea == 'false' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
54 window.content.page(value, 1);
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
55 } else {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
56 // no preferences saved
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
57 window.content.page(value, 1);
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
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 function zoomIn() {
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 var zoomkind = getSetting( 'zoomkind' );
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 if ( zoomkind == 'zoomarea' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
68 window.content.zoomArea();
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
69 } else if ( zoomkind == 'zoompoint' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
70 window.content.zoomPoint();
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
71 } else {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
72 // no preferences saved
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
73 window.content.zoomArea();
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
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 function zoomOut() {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
80
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
81 var zoomkind = getSetting( 'zoomkind' );
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 if ( zoomkind == 'zoomarea' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
84 window.content.zoomExtends();
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
85 } else if ( zoomkind == 'zoompoint' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
86 window.content.zoomOut();
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
87 } else {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
88 // no preferences saved
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
89 window.content.zoomExtends();
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
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
92 }
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
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
95 function change_help() {
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 ( document.getElementById('item_contexthelp').getAttribute('checked') == 'true' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
98
49cb8a445126 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');
49cb8a445126 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');
49cb8a445126 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');
49cb8a445126 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');
49cb8a445126 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');
49cb8a445126 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');
49cb8a445126 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');
49cb8a445126 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)');
49cb8a445126 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)');
49cb8a445126 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');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
109
49cb8a445126 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');
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 document.getElementById('button_scale').setAttribute('tooltiptext', 'Select the factor the picture will be scaled to (relative to the size of the working area)');
49cb8a445126 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');
49cb8a445126 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');
49cb8a445126 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');
49cb8a445126 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');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
117
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
118 } else {
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 var buttons = document.getElementsByTagName('button');
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 for ( i = 0; i < buttons.length; i++ ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
123 buttons[i].removeAttribute('tooltiptext');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
124 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
125
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
126 }
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 }