annotate xul/content/dialog_page.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
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 markCurrentPage() {
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 current_page = opener.content.getParameter('pn');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
24 var total_pages = opener.content.getParameter('pt');
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 if ( total_pages ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
27 document.getElementById('dialog_desc').setAttribute('value', "Choose the page to go (1 - " + total_pages + ") :");
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
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
30 document.getElementById('page_value').setAttribute('value', current_page);
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 function go() {
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 var old_current_page = opener.content.getParameter('pn');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
38 var total_pages = opener.content.getParameter('pt');
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 var page = document.getElementById('page_value').value;
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 if ( parseInt(page) != page ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
43 alert ("Illegal value!");
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
44 } else if ( parseInt(page) < 1 ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
45 alert ("Illegal value!");
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
46 } else if ( total_pages && parseInt(page) > total_pages ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
47 alert ("Illegal value!");
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
48 } else {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
49 var allcookies = opener.content.document.cookie;
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 pos = allcookies.indexOf('keeparea=');
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
52
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
53 if ( pos > -1 ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
54 var start = pos + 9;
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
55 var end = allcookies.indexOf(';', start);
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
56 if ( end == -1 ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
57 end = allcookies.length;
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 if ( allcookies.slice(start, end) == 'true' ) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
61 opener.content.page(page, 2);
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
62 } else {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
63 opener.content.page(page, 1);
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 } else {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
66 // default
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
67 opener.content.page(page, 2);
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
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
70 close();
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 }
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 function cancel() {
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 close();
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 }