# HG changeset patch # User robcast # Date 1098995158 -7200 # Node ID 05e51532a9826d79f9cdc89a452b34acfb05e0cc # Parent 661a911a95d68f2349aac66c9af866b4e0feffc5 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 661a911a95d6 -r 05e51532a982 client/digitallibrary/modules/contextMenu.js --- a/client/digitallibrary/modules/contextMenu.js Thu Oct 28 22:25:58 2004 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -/**************************************************************************** - * - module for digilib: adds a menu for digilib functionality * - * * - * pressing [ctrl] + [left mousebutton] to bring it up * - * * - * to install this module, you do not just have to load it in * - * dlImage.jsp (like every module), but you also have to put the * - * following three lines in the of dlImage.jsp: * - * * - * * - * * - * christian luginbuehl (luginbuehl@student.unibe.ch) * - ****************************************************************************/ - -browser = new checkBrowser(); - -var menu = false; - -if (browser.ns4) { - document.captureEvents(Event.MOUSEDOWN); - document.onmousedown = showmenu; -} else if (browser.ns6) { - document.addEventListener("mousedown", showmenu, true); -} else { - document.onmousedown = showmenu; -} - - -function checkBrowser() { - - this.ua = navigator.userAgent; - this.ver = navigator.appVersion; - this.dom = ( document.getElementById ); - this.opera = ( this.dom ) && ( this.ua.toLowerCase().indexOf("opera") > -1 ); - this.ie4 = ( document.all ) && ( !this.dom ); - this.ie5 = ( this.ver.indexOf("MSIE 5") > -1 ) && ( this.dom ); - this.ie6 = ( this.ver.indexOf("MSIE 6") > -1 ) && ( this.dom ); - this.ns4 = ( document.layers ) && ( !this.dom ); - this.ns6 = ( this.dom ) && ( parseInt(this.ver) >= 5 ) && ( !this.opera ); - this.ns = ( this.ns4 ) || ( this.ns6 ); - this.ie = ( this.ie4 ) || ( this.ie5 ) || ( this.ie6 ); - - return this; -} - - -function showmenu(event) { - - if (browser.ns4) { - if (event.which == 1 && (event.modifiers == Event.CONTROL_MASK) && !menu) { - menu = true; - document.layers["menu"].left = Math.min(event.pageX + 3, innerWidth - 160 + pageXOffset); - document.layers["menu"].top = Math.min(event.pageY + 3, innerHeight - 180 + pageYOffset); - document.layers["menu"].clip.width = 140; - document.layers["menu"].bgColor = "#DDDDDD"; - document.layers["menu"].margin = 4; - document.layers["menu"].visibility = "show"; - } else if (menu) { - menu = false; - document.layers["menu"].visibility = "hide"; - } - - } else if (browser.ns6) { - if (event.which == 1 && event.ctrlKey && !menu) { - menu = true; - document.getElementById("menu").style.left = Math.min(event.pageX + 3, innerWidth - 160 + pageXOffset); - document.getElementById("menu").style.top = Math.min(event.pageY + 3, innerHeight - 160 + pageYOffset); - document.getElementById("menu").style.visibility = "visible"; - } else if (menu) { - menu = false; - document.getElementById("menu").style.visibility = "hidden"; - } - } else { - event = window.event; - - if (event.button == 1 && event.ctrlKey && !menu) { - menu = true; - document.all["menu"].style.left = event.x + 3; - document.all["menu"].style.top = event.y + 3; - document.all["menu"].style.visibility = "visible"; - } else if (menu) { - menu = false; - document.all["menu"].style.visibility = "hidden"; - } - } -} - - -function cm_htmlCode() { - - document.write('\n'); - document.write('\n'); - -} diff -r 661a911a95d6 -r 05e51532a982 client/digitallibrary/modules/fitGIFs.js --- a/client/digitallibrary/modules/fitGIFs.js Thu Oct 28 22:25:58 2004 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* - -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, 22.05.2003 , Version Alcatraz 0.4 - -*/ - -/************************************************************************* - * fitGIFs.js : digilib-module * - * * - * desc: enable od disable the fitting of GIF/PNG images to the * - * drawing area. - * * - *************************************************************************/ - - -/** - * fitGIFs - */ -function fitGIFs() { - - if ( dlParams.mo.value != '' ) { - - idx_plus_after = dlParams.mo.value.indexOf("fit,"); - idx_plus_before = dlParams.mo.value.indexOf(",fit"); - idx_noplus = dlParams.mo.value.indexOf("fit"); - - if ( idx_plus_after > -1 ) { - dlParams.mo.value = dlParams.mo.value.slice(0, idx_plus_after) + dlParams.mo.value.slice(idx_plus_after+5); - } else if ( idx_plus_before > -1 ) { - dlParams.mo.value = dlParams.mo.value.slice(0, idx_plus_before) + dlParams.mo.value.slice(idx_plus_before+5); - } else if ( idx_noplus > -1 ) { - dlParams.mo.value = dlParams.mo.value.slice(0, idx_noplus) + dlParams.mo.value.slice(idx_noplus+4); - } else { - dlParams.mo.value += ",fit"; - } - } else { - dlParams.mo.value = "fit"; - } - - display(3); - -} \ No newline at end of file diff -r 661a911a95d6 -r 05e51532a982 client/digitallibrary/modules/pagesTotal.js --- a/client/digitallibrary/modules/pagesTotal.js Thu Oct 28 22:25:58 2004 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* - -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, 22.05.2003 , Version Alcatraz 0.4 - -*/ - -/************************************************************************* - * pagesTotal.js : digilib-module * - * * - * desc: displaying the total number of pages in a designated frame, * - * when calling pagesTotal(). also overrides nextPage() and * - * page() functions, by adding last-page tests. * - * * - *************************************************************************/ - - -/** - * shows 'page XX of YY' in a designated frame - */ -function showTotalPages() { - - var pf = parent.pageFrame; - - if ( pf ) { - pf.document.open(); - pf.document.write(''); - pf.document.write(''); - pf.document.write('

'); - pf.document.write(dlParams.pn.value + ' of ' + dlParams.pt.value + '

'); - pf.document.close(); - } - -} - - -/** - * extending init from novaigation.js - */ -function init_pagesTotal() { - - init(); - - showTotalPages(); - -} - - -/** - * overriding 'page' in navigation.js - */ -function page(page, details) { - - if ( details == null ) { - details = 1; - } - - if ( page && page.indexOf('-') == 0 ) { - if ( dlParams.pn.value > 1 ) { - page = Math.max(parseInt(dlParams.pn.value) - parseInt(page.slice(1)), 1); - dlParams.pn.value = page; - display(details); - } else { - alert("You are already on the first page!"); - } - - } else if ( page && page.indexOf('+') == 0 ) { - if ( parseInt(dlParams.pn.value) < parseInt(dlParams.pt.value) ) { - page = Math.min(parseInt(dlParams.pn.value) + parseInt(page.slice(1)), dlParams.pt.value); - dlParams.pn.value = page; - display(details); - } else { - alert("You are already on the last page!"); - } - } else if ( page && page == parseInt(page) ) { - if ( (page > 0) && (page <= parseInt(dlParams.pt.value)) ) { - dlParams.pn.value = parseInt(page); - display(details); - } else { - alert ("Illegal page number (1 - " + dlParams.pt.value + ")!"); - } - } - -} \ No newline at end of file diff -r 661a911a95d6 -r 05e51532a982 client/digitallibrary/modules/pdfMaker.js --- a/client/digitallibrary/modules/pdfMaker.js Thu Oct 28 22:25:58 2004 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -/**************************************************************************** - * - sample module for digilib * - * * - * christian luginbuehl (luginbuehl@student.unibe.ch) * - ****************************************************************************/ - -/** - * generates a pdf-file using a perl-script called makepdf - * - * ATTENTION: the script and this function are only in alpha stadium - */ -function makePDF() { - var pages = prompt("Enter the pages you like to make a PDF of:", att[1]); - if (pages != null && pages != "") { - top.location = "http://penelope.unibe.ch/cgi-bin/cgiwrap/luginbul/makepdf.cgi?dir=" + att[0] + "&pages=" + pages; - } -} diff -r 661a911a95d6 -r 05e51532a982 client/digitallibrary/oldskin/dcMain.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/oldskin/dcMain.jsp Thu Oct 28 22:25:58 2004 +0200 @@ -0,0 +1,82 @@ +<%@ page language="java" %><%! +// authentication stuff - robert +// ----------------------------- +// create DocumentBean instance for all JSP requests +digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean(); + +// initialize DocumentBean instance in JSP init +public void jspInit() { + try { + // set servlet init-parameter + docBean.setConfig(getServletConfig()); + } catch (javax.servlet.ServletException e) { + System.out.println(e); + } +} +%><% + +// parsing the query +// ----------------- + +digilib.servlet.DigilibRequest dcRequest = new digilib.servlet.DigilibRequest(request); +// check if authentication is needed and redirect if necessary +docBean.doAuthentication(dcRequest, response); +// set number of pages +dcRequest.setValue("pt", docBean.getNumPages(dcRequest)); +// chop off /oldskin -- ugly ;-( +String baseUrl = dcRequest.getAsString("base.url"); +int p = baseUrl.lastIndexOf("/oldskin"); +if (p > 0) { + baseUrl = baseUrl.substring(0, p); +} +%> + + + + + + + + + + + +
+ +
+ + + +