Mercurial > hg > digilib-old
changeset 224:b51840f2ff75
new digicat version with only one js file
author | luginbue |
---|---|
date | Fri, 09 Jul 2004 02:15:54 +0200 (2004-07-09) |
parents | 41de43a00bf8 |
children | 7349d58cd391 |
files | client/digitallibrary/dcMenu.html client/digitallibrary/navcat.js |
diffstat | 2 files changed, 238 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/dcMenu.html Fri Jul 09 02:15:54 2004 +0200 @@ -0,0 +1,50 @@ +<html> +<head> +<style type="text/css"> +.menu1 {position:absolute; top:122; left:41; width:44; height:138; clip:rect(0,44,138,0); visibility:hidden} +.item1 {position:absolute; left:43; width:40; height:14; clip:rect(0,40,14,0); visibility:hidden} + +.text {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; text-decoration: none} +</style> +<script language="JavaScript" src="buttons/menu.js"></script> +<script language="JavaScript"> +// because on a netscape 4.xx bug (messing up with layers on resize) we cache the window +// resize event and redisplay the navigation frame +if (document.layers && !document.getElementById) { + window.onresize = function() {parent.rightFrame.location.reload();} +} + +function reloadTable(row, col) { + parent.att[2] = row; + parent.att[3] = col; + parent.loadThumbTable(); +} + +// turn off the contexthelp +var showHelp = false; +</script> +</head> + +<body bgcolor="#CCCCCC" leftmargin="8" marginwidth="8" topmargin="20" marginheight="20" onload="preloadImages();"> +<a href="#" onClick="parent.Backpage(); return false;" onmouseover="overButton(0)" onmouseout="awayButton(0)"><img src="buttons/back0.gif" width="73" height="30" border="0"></a><br> +<a href="#" onClick="parent.Nextpage(); return false;" onmouseover="overButton(1)" onmouseout="awayButton(1)"><img src="buttons/next0.gif" width="73" height="30" border="0"></a><br><br> +<a href="#" onclick="hideMenu(); showMenu(1); return false;" onmouseover="overButton(2)" onmouseout="awayButton(2)"><img src="buttons/matrix0.gif" width="73" height="30" border="0"></a><br> + +<div id="menu1" class="menu1"></div> + <div id="menu11" class="item1" style="top:124"><center><a href="#" class="text" onClick="hideMenu(); reloadTable(1, 2); return false;" onmouseover="overItem(11)" onmouseout="awayItem(11)">1x2</a></center></div> + <div id="menu12" class="item1" style="top:139"><center><a href="#" class="text" onClick="hideMenu(); reloadTable(2, 3); return false;" onmouseover="overItem(12)" onmouseout="awayItem(12)">2x3</a></center></div> + <div id="menu13" class="item1" style="top:154"><center><a href="#" class="text" onClick="hideMenu(); reloadTable(2, 4); return false;" onmouseover="overItem(13)" onmouseout="awayItem(13)">2x4</a></center></div> + <div id="menu14" class="item1" style="top:169"><center><a href="#" class="text" onClick="hideMenu(); reloadTable(3, 2); return false;" onmouseover="overItem(14)" onmouseout="awayItem(14)">3x2</a></center></div> + <div id="menu15" class="item1" style="top:184"><center><a href="#" class="text" onClick="hideMenu(); reloadTable(3, 3); return false;" onmouseover="overItem(15)" onmouseout="awayItem(15)">3x3</a></center></div> + <div id="menu16" class="item1" style="top:199"><center><a href="#" class="text" onClick="hideMenu(); reloadTable(3, 4); return false;" onmouseover="overItem(16)" onmouseout="awayItem(16)">3x4</a></center></div> + <div id="menu17" class="item1" style="top:214"><center><a href="#" class="text" onClick="hideMenu(); reloadTable(3, 5); return false;" onmouseover="overItem(17)" onmouseout="awayItem(17)">3x5</a></center></div> + <div id="menu18" class="item1" style="top:229"><center><a href="#" class="text" onClick="hideMenu(); reloadTable(4, 5); return false;" onmouseover="overItem(18)" onmouseout="awayItem(18)">4x5</a></center></div> + <div id="menu19" class="item1" style="top:244"><center><a href="#" class="text" onClick="hideMenu(); reloadTable(4, 6); return false;" onmouseover="overItem(19)" onmouseout="awayItem(19)">4x6</a></center></div> + +<script language="Javascript"> +// initial background color of the menues (has to be done like this, +// otherwise menues in ns4 you will have wrong dimensions) +changeBc("menu1", "#666666"); +</script> +</body> +</html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/navcat.js Fri Jul 09 02:15:54 2004 +0200 @@ -0,0 +1,188 @@ +/* + +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, 07.04.2004 , Version Alcatraz 0.6 + +*/ + +function identify() { + return 'Digicat v0.3'; +} + + +dcParams = new Object(); + +function newParameter(name, value, defaultValue, detail) { + + if ( !dcParams[name] ) { + + dcParams[name] = new Object(); + + dcParams[name].value = value; + dcParams[name].defaultValue = defaultValue; + dcParams[name].detail = detail; + + return dcParams[name]; + + } else { + + alert("Fatal: An object with name '" + name + "' already exists - cannot recreate!"); + return false; + + } +} + +function getParameter(name) { + + if ( dcParams[name] ) { + return dcParams[name].value; + } else { + return false; + } +} + + + +function listParametersAsString() { + + var params = new Array(); + + for ( param in dcParams ) { + params.push(param); + } + + return params.join(","); + +} + + +function listParameters() { + + var params = new Array(); + + for ( param in dcParams ) { + params.push(param); + } + + return params; + +} + + +function init() { + + var fWidth = document.body ? document.body.clientWidth : innerWidth; + var fHeight = document.body ? document.body.clientHeight : innerHeight; + + if (!dcParams.mo.value) { + dcParams.mo.value = dcParams.mo.defaultValue; + } + + var cells = dcParams.mo.value.split('x'); + + var picWidth = (dcParams.dw.value != 0) ? dcParams.dw.value : Math.floor((fWidth-30)/cells[0])-2*cells[0]-1; + var picHeight = (dcParams.dh.value != 0) ? dcParams.dh.value : picWidth; + + if (cells.length > 1) { + picHeight = (dcParams.dh.value != 0) ? dcParams.dh.value : Math.floor(((fHeight-30)-12*cells[1])/cells[1])-2*cells[1]-1; + } else { + cells[1] = Math.ceil(dcParams.pt.value/cells[0]); + } + + var cellWidth = parseInt(picWidth)+8; + var cellHeight = parseInt(picHeight)+18; + + document.write('<table border="0" cellspacing="1" cellpadding="0">'); + + for (var j = 0; j < cells[1]; j++) { + document.write(' <tr>'); + for (var i = 0; i < cells[0]; i++) { + var idx = parseInt(dcParams.pn.value)+i+j*cells[0]; + var img = baseUrl + "/servlet/Scaler/?fn=" + dcParams.fn.value + "&pn=" + idx; + img += "&dw=" + picWidth + "&dh=" + picHeight + "&mo=q0"; + document.write(' <td width="' + cellWidth + '" height="' + cellHeight + '">'); + if (idx <= dcParams.pt.value) { + document.write(' <a href="javascript:load(' + idx + ')"><img src="' + img + '" border="0"></a><br>' + idx); + } else { + document.write(' '); + } + document.write(' </td>'); + + } + document.write(' </tr>'); + } + + document.write('</table>'); +} + + +function load(i) { + var link = baseUrl + "/digilib.jsp?fn=" + dcParams.fn.value + "&pn=" + i + "&lv=3"; + + if (typeof(top.loadFocusedFrame) == 'function') { + top.loadFocusedFrame(link); + } else { + var win = window.open(link, 'digilib'); + win.focus(); + } +} + + +function Backpage() { + + if (att[1] <= 1) { + att[1] = 1; + alert("You are already on the first page!"); + } + + att[1] = parseInt(att[1])-parseInt(att[2]*att[3]); + + if (att[1] < 1) { + att[1] = 1; + } + loadThumbTable(); +} + + + +function Nextpage() { + + att[1] = parseInt(att[1])+parseInt(att[2]*att[3]); + loadThumbTable(); +} + + +// capturing keypresses for next and previous page +// ascii-values of n = 110, b = 98 +function parseKeypress (event) { + if (event.charCode == 110) { + Nextpage(); + } + if (event.charCode == 98) { + Backpage(); + } +} + + +// initialize browser specific things (keypress caputring) +function initScripts() { + for (var f = 0; f < frames.length; f++) { + frames[f].document.addEventListener('keypress', parseKeypress, true); + } + whichFrame.focus(); +}