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