Mercurial > hg > digilib-old
diff 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 |
line wrap: on
line diff
--- a/client/digitallibrary/modules/pagesTotal.js Wed May 14 00:11:15 2003 +0200 +++ b/client/digitallibrary/modules/pagesTotal.js Wed May 14 12:00:40 2003 +0200 @@ -1,3 +1,22 @@ +/* +Copyright (C) 2003 WTWG, Uni Bern + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + +Author: Christian Luginbuehl, 01.05.2003 , Version Alcatraz 0.3 +*/ /**************************************************************************** * - sample module for digilib * * * @@ -13,7 +32,7 @@ // calling original init init(pu, pn, ws, mo, mk, wx, wy, ww, wh); - att[9] = parseInt(pt); + att.pt = parseInt(pt); pagesTotal(); @@ -33,7 +52,7 @@ parent.pageFrame.document.open(); parent.pageFrame.document.write('<html><head></head><body bgcolor="#CCCCCC" topmargin="5" marginheight="5">'); parent.pageFrame.document.write('<p style="font-family: Verdana, Arial, Helvetica, sans-serif; text-align: center; color: #CC3333; font-size: 11px">'); - parent.pageFrame.document.write(att[1] + '<b> of </b>' + att[9] + '</p></body></html>'); + parent.pageFrame.document.write(att.pn + '<b> of </b>' + att.pt + '</p></body></html>'); parent.pageFrame.document.close(); } } @@ -44,12 +63,12 @@ */ function nextPage(keepArea) { - att[1] = parseInt(att[1]) + 1; + att.pn = parseInt(att.pn) + 1; - if (att[1] <= att[9] || isNaN(att[9])) { + if (att.pn <= att.pt || isNaN(att.pt)) { loadPicture(0, keepArea); } else { - att[1] = parseInt(att[1]) - 1; + att.pn = parseInt(att.pn) - 1; alert("You are already on the last page!"); } } @@ -61,12 +80,12 @@ function page(keepArea) { do { - var page = prompt("Goto Page (1 - " + att[9] + "):", 1); + var page = prompt("Goto Page (1 - " + att.pt + "):", 1); - } while ((page != null) && ((isNaN(page)) || (page < 1) || (page > att[9]))); + } while ((page != null) && ((isNaN(page)) || (page < 1) || (page > att.pt))); - if ((page != null) && (page != att[1])) { - att[1] = page; + if ((page != null) && (page != att.pn)) { + att.pn = page; loadPicture(0, keepArea); } } @@ -82,20 +101,20 @@ // 1 -> zoomout // 2 -> zoomarea, zoompoint, moveto, scaledef - var newQuery = "fn=" + att[0] + "&pn=" + att[1] + "&ws=" + att[2] + "&mo=" + att[3]; + var newQuery = "fn=" + att.fn + "&pn=" + att.pn + "&ws=" + att.ws + "&mo=" + att.mo; if (detailGrade == 0) { - att[4] = "0/0"; + att.mk = "0/0"; } if ((detailGrade == 1) || (detailGrade == 0 && !keepArea)) { - att[5] = 0; - att[6] = 0; - att[7] = 1; - att[8] = 1; + att.wx = 0; + att.wy = 0; + att.ww = 1; + att.wh = 1; } - newQuery += "&mk=" + att[4] + "&wx=" + att[5] + "&wy=" + att[6] + "&ww=" + att[7] + "&wh=" + att[8]; + newQuery += "&mk=" + att.mk + "&wx=" + att.wx + "&wy=" + att.wy + "&ww=" + att.ww + "&wh=" + att.wh; if (navigator.appName.toLowerCase() == "netscape") { // mozilla-browsers (netscape 4.xx, netscape 6.xx, etc.) newQuery += "&dw=" + (innerWidth-30) + "&dh=" + (innerHeight-30); @@ -103,10 +122,11 @@ newQuery += "&dw=" + (document.body.clientWidth-30) + "&dh=" + (document.body.clientHeight-30); } - newQuery += "&pt=" + att[9]; + newQuery += "&pt=" + att.pt; + newQuery += "&lv=1"; // debug window - checking the parameters passed to the next image //alert ("DEBUG MESSAGE (query-string in loadPicture):\n\n" + newQuery); - location.href = location.pathname + "?" + newQuery; -} \ No newline at end of file + location.href = location.protocol + "//" + location.host + location.pathname + "?" + newQuery; +}
