comparison client/digitallibrary/modules/pagesTotal.js @ 110:489f61d9feac

XUL Buttons in chrome
author engler
date Wed, 14 May 2003 12:00:40 +0200
parents 81f5e75718ac
children 1a0496201c75
comparison
equal deleted inserted replaced
109:200584e60a0b 110:489f61d9feac
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.3
19 */
1 /**************************************************************************** 20 /****************************************************************************
2 * - sample module for digilib * 21 * - sample module for digilib *
3 * * 22 * *
4 * christian luginbuehl (luginbuehl@student.unibe.ch) * 23 * christian luginbuehl (luginbuehl@student.unibe.ch) *
5 ****************************************************************************/ 24 ****************************************************************************/
11 //alert ("DEBUG message (parameters in init pagesTotal.js):\n\npu = " + pu + "\npn = " + pn + "\nws = " + ws + "\nmo = " + mo + "\nmk = " + mk + "\nwx = " + wx + "\nwy = " + wy + "\nww = " + ww + "\nwh = " + wh + "\npt = " + pt); 30 //alert ("DEBUG message (parameters in init pagesTotal.js):\n\npu = " + pu + "\npn = " + pn + "\nws = " + ws + "\nmo = " + mo + "\nmk = " + mk + "\nwx = " + wx + "\nwy = " + wy + "\nww = " + ww + "\nwh = " + wh + "\npt = " + pt);
12 31
13 // calling original init 32 // calling original init
14 init(pu, pn, ws, mo, mk, wx, wy, ww, wh); 33 init(pu, pn, ws, mo, mk, wx, wy, ww, wh);
15 34
16 att[9] = parseInt(pt); 35 att.pt = parseInt(pt);
17 36
18 pagesTotal(); 37 pagesTotal();
19 38
20 focus(); 39 focus();
21 } 40 }
31 50
32 if (parent.pageFrame) { 51 if (parent.pageFrame) {
33 parent.pageFrame.document.open(); 52 parent.pageFrame.document.open();
34 parent.pageFrame.document.write('<html><head></head><body bgcolor="#CCCCCC" topmargin="5" marginheight="5">'); 53 parent.pageFrame.document.write('<html><head></head><body bgcolor="#CCCCCC" topmargin="5" marginheight="5">');
35 parent.pageFrame.document.write('<p style="font-family: Verdana, Arial, Helvetica, sans-serif; text-align: center; color: #CC3333; font-size: 11px">'); 54 parent.pageFrame.document.write('<p style="font-family: Verdana, Arial, Helvetica, sans-serif; text-align: center; color: #CC3333; font-size: 11px">');
36 parent.pageFrame.document.write(att[1] + '<b> of </b>' + att[9] + '</p></body></html>'); 55 parent.pageFrame.document.write(att.pn + '<b> of </b>' + att.pt + '</p></body></html>');
37 parent.pageFrame.document.close(); 56 parent.pageFrame.document.close();
38 } 57 }
39 } 58 }
40 59
41 60
42 /** 61 /**
43 * overriding nextPage in navigation 62 * overriding nextPage in navigation
44 */ 63 */
45 function nextPage(keepArea) { 64 function nextPage(keepArea) {
46 65
47 att[1] = parseInt(att[1]) + 1; 66 att.pn = parseInt(att.pn) + 1;
48 67
49 if (att[1] <= att[9] || isNaN(att[9])) { 68 if (att.pn <= att.pt || isNaN(att.pt)) {
50 loadPicture(0, keepArea); 69 loadPicture(0, keepArea);
51 } else { 70 } else {
52 att[1] = parseInt(att[1]) - 1; 71 att.pn = parseInt(att.pn) - 1;
53 alert("You are already on the last page!"); 72 alert("You are already on the last page!");
54 } 73 }
55 } 74 }
56 75
57 76
59 * overriding 'page' in navigation 78 * overriding 'page' in navigation
60 */ 79 */
61 function page(keepArea) { 80 function page(keepArea) {
62 81
63 do { 82 do {
64 var page = prompt("Goto Page (1 - " + att[9] + "):", 1); 83 var page = prompt("Goto Page (1 - " + att.pt + "):", 1);
65 84
66 } while ((page != null) && ((isNaN(page)) || (page < 1) || (page > att[9]))); 85 } while ((page != null) && ((isNaN(page)) || (page < 1) || (page > att.pt)));
67 86
68 if ((page != null) && (page != att[1])) { 87 if ((page != null) && (page != att.pn)) {
69 att[1] = page; 88 att.pn = page;
70 loadPicture(0, keepArea); 89 loadPicture(0, keepArea);
71 } 90 }
72 } 91 }
73 92
74 93
80 // the different detailGrades: 99 // the different detailGrades:
81 // 0 -> back, next, page 100 // 0 -> back, next, page
82 // 1 -> zoomout 101 // 1 -> zoomout
83 // 2 -> zoomarea, zoompoint, moveto, scaledef 102 // 2 -> zoomarea, zoompoint, moveto, scaledef
84 103
85 var newQuery = "fn=" + att[0] + "&pn=" + att[1] + "&ws=" + att[2] + "&mo=" + att[3]; 104 var newQuery = "fn=" + att.fn + "&pn=" + att.pn + "&ws=" + att.ws + "&mo=" + att.mo;
86 105
87 if (detailGrade == 0) { 106 if (detailGrade == 0) {
88 att[4] = "0/0"; 107 att.mk = "0/0";
89 } 108 }
90 109
91 if ((detailGrade == 1) || (detailGrade == 0 && !keepArea)) { 110 if ((detailGrade == 1) || (detailGrade == 0 && !keepArea)) {
92 att[5] = 0; 111 att.wx = 0;
93 att[6] = 0; 112 att.wy = 0;
94 att[7] = 1; 113 att.ww = 1;
95 att[8] = 1; 114 att.wh = 1;
96 } 115 }
97 116
98 newQuery += "&mk=" + att[4] + "&wx=" + att[5] + "&wy=" + att[6] + "&ww=" + att[7] + "&wh=" + att[8]; 117 newQuery += "&mk=" + att.mk + "&wx=" + att.wx + "&wy=" + att.wy + "&ww=" + att.ww + "&wh=" + att.wh;
99 118
100 if (navigator.appName.toLowerCase() == "netscape") { // mozilla-browsers (netscape 4.xx, netscape 6.xx, etc.) 119 if (navigator.appName.toLowerCase() == "netscape") { // mozilla-browsers (netscape 4.xx, netscape 6.xx, etc.)
101 newQuery += "&dw=" + (innerWidth-30) + "&dh=" + (innerHeight-30); 120 newQuery += "&dw=" + (innerWidth-30) + "&dh=" + (innerHeight-30);
102 } else { // ie, opera 121 } else { // ie, opera
103 newQuery += "&dw=" + (document.body.clientWidth-30) + "&dh=" + (document.body.clientHeight-30); 122 newQuery += "&dw=" + (document.body.clientWidth-30) + "&dh=" + (document.body.clientHeight-30);
104 } 123 }
105 124
106 newQuery += "&pt=" + att[9]; 125 newQuery += "&pt=" + att.pt;
126 newQuery += "&lv=1";
107 127
108 // debug window - checking the parameters passed to the next image 128 // debug window - checking the parameters passed to the next image
109 //alert ("DEBUG MESSAGE (query-string in loadPicture):\n\n" + newQuery); 129 //alert ("DEBUG MESSAGE (query-string in loadPicture):\n\n" + newQuery);
110 130
111 location.href = location.pathname + "?" + newQuery; 131 location.href = location.protocol + "//" + location.host + location.pathname + "?" + newQuery;
112 } 132 }