annotate xul/content/dialog_page.js @ 252:59250ea2ad55

servlet version 1.19b5 - filename and dpi in request - filename and dpi in dlInfo-*
author robcast
date Wed, 25 Aug 2004 01:06:30 +0200
parents bf945fcf9105
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.3
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 function markCurrentPage() {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
22
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
23 var current_page = opener.content.getParameter('pn');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
24 var total_pages = opener.content.getParameter('pt');
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 if ( total_pages ) {
bf945fcf9105 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 + ") :");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
28 }
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 document.getElementById('page_value').setAttribute('value', current_page);
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 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
33
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
34
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
35 function go() {
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 var old_current_page = opener.content.getParameter('pn');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
38 var total_pages = opener.content.getParameter('pt');
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 var page = document.getElementById('page_value').value;
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 if ( parseInt(page) != page ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
43 alert ("Illegal value!");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
44 } else if ( parseInt(page) < 1 ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
45 alert ("Illegal value!");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
46 } else if ( total_pages && parseInt(page) > total_pages ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
47 alert ("Illegal value!");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
48 } else {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
49 var allcookies = opener.content.document.cookie;
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 var pos = allcookies.indexOf('keeparea=');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
52
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
53 if ( pos > -1 ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
54 var start = pos + 9;
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
55 var end = allcookies.indexOf(';', start);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
56 if ( end == -1 ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
57 end = allcookies.length;
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 if ( allcookies.slice(start, end) == 'true' ) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
61 opener.content.page(page, 2);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
62 } else {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
63 opener.content.page(page, 1);
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 } else {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
66 // default
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
67 opener.content.page(page, 2);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
68 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
69
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
70 close();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
71 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
72
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
73 }
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 function cancel() {
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 close();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
79
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
80 }