comparison client/digitallibrary/navcat_n4.js @ 103:b04d96fd308f vendor start

XUL: Digilib Buttons in chrome
author engler
date Tue, 13 May 2003 21:02:22 +0200
parents d91c76d6b3d0
children
comparison
equal deleted inserted replaced
101:ef7ccc290d9a 103:b04d96fd308f
1 /* navcat_n4 -- JS library for digilib (Netscape4 version)
2
3 Digital Image Library servlet components
4
5 Copyright (C) 2001, 2002 Christian Luginbuehl (luginbuehl@student.unibe.ch)
6
7 This program is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2 of the License, or (at your
10 option) any later version.
11
12 Please read license.txt for the full details. A copy of the GPL
13 may be found at http://www.gnu.org/copyleft/lgpl.html
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19 */
20
21 // these two global variables have to be initialised before the frist use of the functions below 1 // these two global variables have to be initialised before the frist use of the functions below
22 // to fill in the attributes you can use the function initPicture provided below 2 // to fill in the attributes you can use the function initPicture provided below
23 // - array with all attributes 3 // - array with all attributes
24 var att = new Array(); 4 var att = new Array();
25 5
42 whichFrame.document.open(); 22 whichFrame.document.open();
43 whichFrame.document.write('<html><head>'); 23 whichFrame.document.write('<html><head>');
44 whichFrame.document.write('<style type="text/css">.myFont {font-family: sans-serif, Arial; font-size: 11px; color: #FFFFFF}</style>'); 24 whichFrame.document.write('<style type="text/css">.myFont {font-family: sans-serif, Arial; font-size: 11px; color: #FFFFFF}</style>');
45 whichFrame.document.write('<script language="Javascript">'); 25 whichFrame.document.write('<script language="Javascript">');
46 whichFrame.document.write('function loadDigilib(idx) {'); 26 whichFrame.document.write('function loadDigilib(idx) {');
47 whichFrame.document.write('linkRef = "http://' + location.host + '/docuserver/digitallibrary/digilib.html?' + parent.att[0] + '+" + idx;'); 27 whichFrame.document.write('linkRef = "' + parent.baseUrl + '/digilib.jsp?' + parent.att[0] + '+" + idx;');
48 whichFrame.document.write('win = window.open(linkRef, "digilib");'); 28 whichFrame.document.write('win = window.open(linkRef, "digilib");');
49 whichFrame.document.write('win.focus();'); 29 whichFrame.document.write('win.focus();');
50 whichFrame.document.write('}'); 30 whichFrame.document.write('}');
51 whichFrame.document.write('</script>'); 31 whichFrame.document.write('</script>');
52 32
55 whichFrame.document.write('<table border="1" width="' + tableWidth + '" height="' + tableHeight + '">'); 35 whichFrame.document.write('<table border="1" width="' + tableWidth + '" height="' + tableHeight + '">');
56 for (i = 0; i < att[2]; i++) { 36 for (i = 0; i < att[2]; i++) {
57 whichFrame.document.write('<tr>'); 37 whichFrame.document.write('<tr>');
58 for (j = 0; j < att[3]; j++) { 38 for (j = 0; j < att[3]; j++) {
59 indexNr = parseInt(att[1])+i*parseInt(att[3])+j; 39 indexNr = parseInt(att[1])+i*parseInt(att[3])+j;
60 thumb = "http://" + location.host + "/docuserver/digitallibrary/servlet/Scaler/" 40 thumb = parent.baseUrl + "/servlet/Scaler/";
61 thumb += att[0] + "?" + "pn=" + indexNr + "&ws=1.0&mo=fit&dw=" + cellWidth + "&dh=" + (cellHeight-25); 41 thumb += att[0] + "?" + "pn=" + indexNr + "&ws=1.0&mo=fit&dw=" + cellWidth + "&dh=" + (cellHeight-25);
62 whichFrame.document.write('<td align="center" valign="middle" width="' + cellWidth + '" height="' + cellHeight + '" class="myFont">'); 42 whichFrame.document.write('<td align="center" valign="middle" width="' + cellWidth + '" height="' + cellHeight + '" class="myFont">');
63 whichFrame.document.write('<a href="javascript:loadDigilib(' + indexNr + ')">'); 43 whichFrame.document.write('<a href="javascript:loadDigilib(' + indexNr + ')">');
64 whichFrame.document.write('<img src="' + thumb + '" border="0">'); 44 whichFrame.document.write('<img src="' + thumb + '" border="0">');
65 whichFrame.document.write('</a><br>'); 45 whichFrame.document.write('</a><br>');