Mercurial > hg > digilib
annotate xul/content/dialog_rotate.js @ 476:f87cefeafd7b
new ant build file for digilib (Servlet and Webapp)
author | robcast |
---|---|
date | Fri, 09 Feb 2007 16:48:14 +0100 |
parents | 49cb8a445126 |
children |
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 markCurrentRotation() { |
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 angle = opener.content.getParameter('rot'); |
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 if ( angle && (angle == 0.0 || angle == 90.0 || angle == 180.0 || angle == 270.0) ) { |
49cb8a445126
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
26 var item = "rotation_" + parseInt(angle); |
49cb8a445126
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
27 document.getElementById(item).setAttribute('selected', 'true'); |
49cb8a445126
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
28 } else if ( angle && angle == parseFloat(angle) ) { |
49cb8a445126
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
29 document.getElementById('rotation_custom').setAttribute('selected', 'true'); |
49cb8a445126
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
30 document.getElementById('rotation_custom_value').setAttribute('value', angle); |
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 function input() { |
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 document.getElementById('rotation_custom').setAttribute('selected', 'true'); |
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 function rotate() { |
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 var angle = 0.0; |
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 var items = document.getElementById('rotation_group').childNodes; |
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 if ( document.getElementById('rotation_custom').getAttribute('selected') == 'true' ) { |
49cb8a445126
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
49 angle = document.getElementById('rotation_custom_value').value; |
49cb8a445126
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
50 } else { |
49cb8a445126
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
51 for ( i = 0; i <items.length; i++ ) { |
49cb8a445126
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
52 if ( items[i].getAttribute('selected') == 'true' ) { |
49cb8a445126
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
53 angle = items[i].getAttribute('value'); |
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 } |
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 |
49cb8a445126
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
58 if ( angle != parseFloat(angle) ) { |
49cb8a445126
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
59 alert ("Illegal value!" + angle); |
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 if ( angle != opener.content.getParameter('rot') ) { |
49cb8a445126
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
63 opener.content.rotation(angle); |
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 close(); |
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 function cancel() { |
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 close(); |
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 } |