# HG changeset patch # User robcast # Date 1098995158 -7200 # Node ID 24dbc008be149028cc6c53c857168fb4827de4b0 # Parent e1d587a4e9b146f78926ba4fbba95e2ada5b05dd big autumn cleaning :-) - finally digilib.jsp uses the new javascript code - dito digicat.jsp - all files corresponding to the old frontend moved into /oldskin - all icons moved into /img diff -r e1d587a4e9b1 -r 24dbc008be14 client/digitallibrary/oldskin/dclib.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/oldskin/dclib.js Thu Oct 28 22:25:58 2004 +0200 @@ -0,0 +1,122 @@ +/* +Copyright (C) 2003-2004 WTWG Uni Bern, MPIWG Berlin + +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 + Robert Casties 28.10.2004 + +!! requires baselib.js !! + +*/ + +function identify() { + return 'Digicat v0.4'; +} + +var cells = null; + + +function dc_init() { + + // put the query parameters (sans "?") in the parameters array + parseParameters(location.search.slice(1)); +} + +function display(detail) { + // redisplay the page + if (! detail) { + detail = 9; + } + var queryString = getAllParameters(detail); + location.href = location.protocol + "//" + location.host + location.pathname + "?" + queryString; +} + +function dc_render(doc) { + + var fWidth = document.body ? document.body.clientWidth : innerWidth; + var fHeight = document.body ? document.body.clientHeight : innerHeight; + + var mx = getParameter("mx"); + cells = mx.split('x'); + + var dw = getParameter("dw"); + var dh = getParameter("dh"); + var pt = getParameter("pt"); + var pn = getParameter("pn"); + + var picWidth = (dw != 0) ? dw : Math.floor((fWidth-30)/cells[0])-2*cells[0]-1; + var picHeight = (dh != 0) ? dh : picWidth; + + if (cells.length > 1) { + picHeight = (dh != 0) ? dh : Math.floor(((fHeight-30)-12*cells[1])/cells[1])-2*cells[1]-1; + } else { + cells[1] = Math.ceil(pt/cells[0]); + } + + var cellWidth = parseInt(picWidth)+8; + var cellHeight = parseInt(picHeight)+18; + + doc.writeln(''); + + for (var j = 0; j < cells[1]; j++) { + doc.writeln(''); + for (var i = 0; i < cells[0]; i++) { + var idx = parseInt(pn)+i+j*cells[0]; + var img = baseUrl + "/servlet/Scaler?fn=" + getParameter("fn") + "&pn=" + idx; + img += "&dw=" + picWidth + "&dh=" + picHeight + "&mo=" + getParameter("mo"); + doc.write(''); + } + doc.writeln(' '); + } + doc.writeln('
'); + if (idx <= pt) { + doc.write('
'+idx+'
'); + } else { + doc.write('
'+idx+'
'); + } + doc.writeln('
'); +} + + +function dl_link(i) { + var link = baseUrl+"/digilib.jsp?fn="+getParameter("fn")+"&pn="+i+"&mo="+getParameter("mo"); + return link; +} + + +function Backpage() { + var pn = parseInt(getParameter("pn")); + if (pn <= 1) { + pn = 1; + alert("You are already on the first page!"); + } + + pn = pn - parseInt(cells[0]*cells[1]); + + if (pn < 1) { + pn = 1; + } + setParameter("pn", pn); + display(); +} + +function Nextpage() { + var pn = parseInt(getParameter("pn")); + pn = pn + parseInt(cells[0]*cells[1]); + setParameter("pn", pn); + display(); +}