# HG changeset patch # User casties # Date 1282753748 -7200 # Node ID e758a49258e875bcf1e7503f963b5ef381692b50 # Parent 87cb3dc2aa12f53281efe7bd2e3569bfd4e48980# Parent 9936604d466e3c44d8a2609519848f33f2801629 Merge with 9936604d466e3c44d8a2609519848f33f2801629 (changes to HEAD) diff -r 87cb3dc2aa12 -r e758a49258e8 .hgtags --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgtags Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,9 @@ +07bb7d594477a2d2291b0730d7ce56847a4f7b54 Root_gen2 +1b2f8a9762ab308f930fbdfb1ab3791e19e4a047 ver_1_6 +39ee473b4711047d304271a8ed1efb6647a020e9 MAIN +5d0c0da080ecfef3149cf92c5ab1ae7c30dbe797 scaleable_1 +72604a10ee1a7d94d678aa99dd429db60dac1fb6 Root_jquery +85126da2ae2113b60adc42a70bb6002b47071c11 start +87d2ed21bdec2253e10d53f00b8f507af335b7a0 Root_digilibPDF +a336f89a9fbf0a79f964d9750b56d4e6f83bb4c8 release_1_2 +e1c10653f14311e6d048df4daf10e921d6631caf Root_gen2_1 diff -r 87cb3dc2aa12 -r e758a49258e8 CVSROOT/checkoutlist --- a/CVSROOT/checkoutlist Fri Apr 09 18:22:05 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -# The "checkoutlist" file is used to support additional version controlled -# administrative files in $CVSROOT/CVSROOT, such as template files. -# -# The first entry on a line is a filename which will be checked out from -# the corresponding RCS file in the $CVSROOT/CVSROOT directory. -# The remainder of the line is an error message to use if the file cannot -# be checked out. -# -# File format: -# -# [] -# -# comment lines begin with '#' diff -r 87cb3dc2aa12 -r e758a49258e8 CVSROOT/commitinfo --- a/CVSROOT/commitinfo Fri Apr 09 18:22:05 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -# The "commitinfo" file is used to control pre-commit checks. -# The filter on the right is invoked with the repository and a list -# of files to check. A non-zero exit of the filter program will -# cause the commit to be aborted. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being committed to, relative -# to the $CVSROOT. For the first match that is found, then the remainder -# of the line is the name of the filter to run. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". diff -r 87cb3dc2aa12 -r e758a49258e8 CVSROOT/config --- a/CVSROOT/config Fri Apr 09 18:22:05 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -# Set this to "no" if pserver shouldn't check system users/passwords -#SystemAuth=no - -# Put CVS lock files in this directory rather than directly in the repository. -#LockDir=/var/lock/cvs - -# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top -# level of the new working directory when using the `cvs checkout' -# command. -#TopLevelAdmin=no - -# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the -# history file, or a subset as needed (ie `TMAR' logs all write operations) -#LogHistory=TOFEWGCMAR diff -r 87cb3dc2aa12 -r e758a49258e8 CVSROOT/cvswrappers --- a/CVSROOT/cvswrappers Fri Apr 09 18:22:05 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -# This file affects handling of files based on their names. -# -# The -t/-f options allow one to treat directories of files -# as a single file, or to transform a file in other ways on -# its way in and out of CVS. -# -# The -m option specifies whether CVS attempts to merge files. -# -# The -k option specifies keyword expansion (e.g. -kb for binary). -# -# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) -# -# wildcard [option value][option value]... -# -# where option is one of -# -f from cvs filter value: path to filter -# -t to cvs filter value: path to filter -# -m update methodology value: MERGE or COPY -# -k expansion mode value: b, o, kkv, &c -# -# and value is a single-quote delimited value. -# For example: -#*.gif -k 'b' diff -r 87cb3dc2aa12 -r e758a49258e8 CVSROOT/editinfo --- a/CVSROOT/editinfo Fri Apr 09 18:22:05 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# The "editinfo" file is used to allow verification of logging -# information. It works best when a template (as specified in the -# rcsinfo file) is provided for the logging procedure. Given a -# template with locations for, a bug-id number, a list of people who -# reviewed the code before it can be checked in, and an external -# process to catalog the differences that were code reviewed, the -# following test can be applied to the code: -# -# Making sure that the entered bug-id number is correct. -# Validating that the code that was reviewed is indeed the code being -# checked in (using the bug-id number or a seperate review -# number to identify this particular code set.). -# -# If any of the above test failed, then the commit would be aborted. -# -# Actions such as mailing a copy of the report to each reviewer are -# better handled by an entry in the loginfo file. -# -# One thing that should be noted is the the ALL keyword is not -# supported. There can be only one entry that matches a given -# repository. diff -r 87cb3dc2aa12 -r e758a49258e8 CVSROOT/loginfo --- a/CVSROOT/loginfo Fri Apr 09 18:22:05 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -# The "loginfo" file controls where "cvs commit" log information -# is sent. The first entry on a line is a regular expression which must match -# the directory that the change is being made to, relative to the -# $CVSROOT. If a match is found, then the remainder of the line is a filter -# program that should expect log information on its standard input. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name ALL appears as a regular expression it is always used -# in addition to the first matching regex or DEFAULT. -# -# You may specify a format string as part of the -# filter. The string is composed of a `%' followed -# by a single format character, or followed by a set of format -# characters surrounded by `{' and `}' as separators. The format -# characters are: -# -# s = file name -# V = old version number (pre-checkin) -# v = new version number (post-checkin) -# -# For example: -#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog -# or -#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog diff -r 87cb3dc2aa12 -r e758a49258e8 CVSROOT/modules --- a/CVSROOT/modules Fri Apr 09 18:22:05 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -# Three different line formats are valid: -# key -a aliases... -# key [options] directory -# key [options] directory files... -# -# Where "options" are composed of: -# -i prog Run "prog" on "cvs commit" from top-level of module. -# -o prog Run "prog" on "cvs checkout" of module. -# -e prog Run "prog" on "cvs export" of module. -# -t prog Run "prog" on "cvs rtag" of module. -# -u prog Run "prog" on "cvs update" of module. -# -d dir Place module in directory "dir" instead of module name. -# -l Top-level directory only -- do not recurse. -# -# NOTE: If you change any of the "Run" options above, you'll have to -# release and re-checkout any working directories of these modules. -# -# And "directory" is a path to a directory relative to $CVSROOT. -# -# The "-a" option specifies an alias. An alias is interpreted as if -# everything on the right of the "-a" had been typed on the command line. -# -# You can encode a module within a module by using the special '&' -# character to interpose another module into the current module. This -# can be useful for creating a module that consists of many directories -# spread out over the entire source repository. diff -r 87cb3dc2aa12 -r e758a49258e8 CVSROOT/notify --- a/CVSROOT/notify Fri Apr 09 18:22:05 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -# The "notify" file controls where notifications from watches set by -# "cvs watch add" or "cvs edit" are sent. The first entry on a line is -# a regular expression which is tested against the directory that the -# change is being made to, relative to the $CVSROOT. If it matches, -# then the remainder of the line is a filter program that should contain -# one occurrence of %s for the user to notify, and information on its -# standard input. -# -# "ALL" or "DEFAULT" can be used in place of the regular expression. -# -# For example: -#ALL mail %s -s "CVS notification" diff -r 87cb3dc2aa12 -r e758a49258e8 CVSROOT/rcsinfo --- a/CVSROOT/rcsinfo Fri Apr 09 18:22:05 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -# The "rcsinfo" file is used to control templates with which the editor -# is invoked on commit and import. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being made to, relative to the -# $CVSROOT. For the first match that is found, then the remainder of the -# line is the name of the file that contains the template. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". diff -r 87cb3dc2aa12 -r e758a49258e8 CVSROOT/taginfo --- a/CVSROOT/taginfo Fri Apr 09 18:22:05 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -# The "taginfo" file is used to control pre-tag checks. -# The filter on the right is invoked with the following arguments: -# -# $1 -- tagname -# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d -# $3 -- repository -# $4-> file revision [file revision ...] -# -# A non-zero exit of the filter program will cause the tag to be aborted. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being committed to, relative -# to the $CVSROOT. For the first match that is found, then the remainder -# of the line is the name of the filter to run. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". diff -r 87cb3dc2aa12 -r e758a49258e8 CVSROOT/verifymsg --- a/CVSROOT/verifymsg Fri Apr 09 18:22:05 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# The "verifymsg" file is used to allow verification of logging -# information. It works best when a template (as specified in the -# rcsinfo file) is provided for the logging procedure. Given a -# template with locations for, a bug-id number, a list of people who -# reviewed the code before it can be checked in, and an external -# process to catalog the differences that were code reviewed, the -# following test can be applied to the code: -# -# Making sure that the entered bug-id number is correct. -# Validating that the code that was reviewed is indeed the code being -# checked in (using the bug-id number or a seperate review -# number to identify this particular code set.). -# -# If any of the above test failed, then the commit would be aborted. -# -# Actions such as mailing a copy of the report to each reviewer are -# better handled by an entry in the loginfo file. -# -# One thing that should be noted is the the ALL keyword is not -# supported. There can be only one entry that matches a given -# repository. diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/WEB-INF/classes/Relato.class Binary file client/digitallibrary/WEB-INF/classes/Relato.class has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/WEB-INF/classes/Relato.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/WEB-INF/classes/Relato.java Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,74 @@ +import java.io.*; +import java.net.*; +import java.util.*; +import javax.servlet.*; +import javax.servlet.http.*; +import javax.xml.transform.*; +import javax.xml.transform.dom.*; +import javax.xml.transform.stream.*; +import org.apache.xerces.parsers.DOMParser; +import org.apache.xpath.*; +import org.w3c.dom.*; + +public class Relato extends HttpServlet { + + public final static String FS = System.getProperty("file.separator"); + + // Respond to HTTP GET requests from browsers. + public void doGet (HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + Hashtable params = new Hashtable(); + Enumeration enum = request.getParameterNames(); + while (enum.hasMoreElements()) { + String pName = (String) enum.nextElement(); + params.put(pName, request.getParameter(pName)); + + } + // Set content type for HTML. + response.setContentType("text/html; charset=UTF-8"); + // Output goes to the response PrintWriter. + PrintWriter out = response.getWriter(); + DOMParser parser = new DOMParser(); + + try { + TransformerFactory tFactory = TransformerFactory.newInstance(); + //get the real path for xml and xsl files. + String ctx = getServletContext().getRealPath("") + FS; + + parser.parse(ctx + (String) params.get("xml")); + Document document = parser.getDocument(); + + Element topFrameset = (Element) XPathAPI.selectSingleNode(document, "/relato/frames/frameset"); + topFrameset.setAttribute("onload", "init();"); + + NodeList nodelist = XPathAPI.selectNodeList(document, "//frameset/frame"); + for (int i = 0; i < nodelist.getLength(); i++) { + Element elem = (Element)nodelist.item(i); + String name = elem.getAttribute("name"); + if (name != "") { + if (params.containsKey(name)) { + String src = (String) params.get(name); + elem.setAttribute("src", src); + } + } + } + + Source xmlSource = new DOMSource (document); + Source xslSource = new StreamSource (new URL("file", "", ctx+"relato/relato.xsl").openStream()); + // Generate the transformer. + Transformer transformer = tFactory.newTransformer(xslSource); + // Perform the transformation, sending the output to the response. + transformer.transform(xmlSource, new StreamResult(out)); + } + + // If an Exception occurs, return the error to the client. + catch (Exception e) { + out.write(e.getMessage()); + e.printStackTrace(out); + } + + // Close the PrintWriter. + out.close(); + } +} diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/WEB-INF/classes/info.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/WEB-INF/classes/info.txt Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,4 @@ +# hier zusaetzliche klassen zum kompilieren, diese muessen im laufenden +# tomcat system in WEB-INF/lib sein. + +export CLASSPATH=$CLASSPATH:/opt/javalibs/xerces/xercesImpl.jar:/opt/javalibs/xerces/xml-apis.jar:/opt/javalibs/xalan/bin/xalan.jar:/opt/tomcat/common/lib/servlet-api.jar diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/WEB-INF/digilib-auth.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/WEB-INF/digilib-auth.xml Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,27 @@ + + + + + + + + + + + + +
+
+
+ + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/WEB-INF/digilib-config.xml diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/WEB-INF/digilib-map.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/WEB-INF/digilib-map.xml Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/WEB-INF/lib/DigilibServlet.jar Binary file client/digitallibrary/WEB-INF/lib/DigilibServlet.jar has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/WEB-INF/lib/imageinfo.jar Binary file client/digitallibrary/WEB-INF/lib/imageinfo.jar has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/WEB-INF/log4j-config.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/WEB-INF/log4j-config.xml Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/WEB-INF/web.xml diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/baselib.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/baselib.js Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,638 @@ +/* Copyright (C) 2003,2004 IT-Group MPIWG, WTWG Uni Bern and others + +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 + +Authors: + Christian Luginbuehl, 01.05.2003 (first version) + DW 24.03.2004 (Changed for digiLib in Zope) + Robert Casties, 22.1.2008 + +*/ + +function base_init() { + // init function + baseScriptVersion = "1.2.4"; + dlParams = new Object(); + browserType = getBrowserType(); +} + + +function getInt(n) { + // returns always an integer + n = parseInt(n); + if (isNaN(n)) return 0; + return n; +} + +function defined(x) { + // returns if x is defined + return (typeof arguments[0] != "undefined"); +} + +function cropFloat(x) { + // auxiliary function to crop senseless precision + return parseInt(10000*x)/10000; +} + +function getBrowserType() { + // browser sniffer + var bt = Object(); + bt.doDHTML = false; + bt.versIE = 0; + + if ((! document.cssonly && document.layers) || document.all || document.getElementById) { + var vers = navigator.appVersion.split('MSIE '); + vers = vers[vers.length - 1]; + bt.versIE = getInt(vers); + bt.isIE = navigator.userAgent.indexOf('MSIE') >= 0; + bt.isMac = navigator.platform.indexOf('Mac') >= 0; + bt.isWin = navigator.platform.indexOf('Win') >= 0; + bt.isN4 = (navigator.userAgent.indexOf('Mozilla/4.') >= 0) && ! bt.isIE; + bt.isIEWin = bt.versIE > 0 && bt.isWin; + if (navigator.appVersion.indexOf('MSIE') < 0 || ! bt.isMac || bt.versIE >= 5) { + bt.doDHTML = true; + bt.isOpera = navigator.userAgent.indexOf(' Opera ') >= 0; + bt.isKonq = navigator.userAgent.indexOf(' Konqueror') >= 0; + } + } + return bt; +} + +// fixes for javascript < 1.2 +if (! Array.prototype.push) { + Array.prototype.push = function(val) { + this[this.length] = val; + return this.length; + } + Array.prototype.pop = function() { + var val = this[this.length-1]; + this.length -= 1; + return val; + } +} + + +/* ********************************************** + * geometry classes + * ******************************************** */ + +/* + * Size class + */ +function Size(w, h) { + this.width = parseFloat(w); + this.height = parseFloat(h); + return this; +} +Size.prototype.toString = function() { + return this.width + "x" + this.height; +} + + +/* + * Position class + */ +function Position(x, y) { + this.x = parseFloat(x); + this.y = parseFloat(y); + return this; +} +Position.prototype.toString = function() { + return this.x + "," + this.y; +} + +/* + * Rectangle class + */ +function Rectangle(x, y, w, h) { + this.x = parseFloat(x); + this.y = parseFloat(y); + this.width = parseFloat(w); + this.height = parseFloat(h); + return this; +} +Rectangle.prototype.toString = function() { + return this.width+"x"+this.height+"@"+this.x+","+this.y; +} +Rectangle.prototype.copy = function() { + // returns a copy of this Rectangle + return new Rectangle(this.x, this.y, this.width, this.height); +} +Rectangle.prototype.getPosition = function() { + // returns the position of this Rectangle + return new Position(this.x, this.y); +} +Rectangle.prototype.getSize = function() { + // returns the size of this Rectangle + return new Size(this.width, this.height); +} +Rectangle.prototype.getArea = function() { + // returns the area of this Rectangle + return (this.width * this.height); +} +Rectangle.prototype.containsPosition = function(pos) { + // returns if the given Position lies in this Rectangle + return ((pos.x >= this.x)&&(pos.y >= this.y)&&(pos.x <= this.x+this.width)&&(pos.y <= this.y+this.width)); +} +Rectangle.prototype.intersect = function(rect) { + // returns the intersection of the given Rectangle and this one + var sec = rect.copy(); + if (sec.x < this.x) { + sec.width = sec.width - (this.x - sec.x); + sec.x = this.x; + } + if (sec.y < this.y) { + sec.height = sec.height - (this.y - sec.y); + sec.y = this.y; + } + if (sec.x + sec.width > this.x + this.width) { + sec.width = (this.x + this.width) - sec.x; + } + if (sec.y + sec.height > this.y + this.height) { + sec.height = (this.y + this.height) - sec.y; + } + return sec; +} +Rectangle.prototype.fit = function(rect) { + // returns a Rectangle that fits into this one (by moving first) + var sec = rect.copy(); + sec.x = Math.max(sec.x, this.x); + sec.x = Math.max(sec.x, this.x); + if (sec.x + sec.width > this.x + this.width) { + sec.x = this.x + this.width - sec.width; + } + if (sec.y + sec.height > this.y + this.height) { + sec.y = this.y + this.height - sec.height; + } + return sec.intersect(this); +} + +/* + * Transform class + * + * defines a class of affine transformations + */ +function Transform() { + this.m00 = 1.0; + this.m01 = 0.0; + this.m02 = 0.0; + this.m10 = 0.0; + this.m11 = 1.0; + this.m12 = 0.0; + this.m20 = 0.0; + this.m21 = 0.0; + this.m22 = 1.0; + return this; +} +Transform.prototype.concat = function(traf) { + // add Transform traf to this Transform + for (var i = 0; i < 3; i++) { + for (var j = 0; j < 3; j++) { + var c = 0.0; + for (var k = 0; k < 3; k++) { + c += traf["m"+i+k] * this["m"+k+j]; + } + this["m"+i+j] = c; + } + } + return this; +} +Transform.prototype.transform = function(rect) { + // returns transformed Rectangle or Position with this Transform applied + var x = this.m00 * rect.x + this.m01 * rect.y + this.m02; + var y = this.m10 * rect.x + this.m11 * rect.y + this.m12; + if (rect.width) { + var width = this.m00 * rect.width + this.m01 * rect.height; + var height = this.m10 * rect.width + this.m11 * rect.height; + return new Rectangle(x, y, width, height); + } + return new Position(x, y); +} +Transform.prototype.invtransform = function(pos) { + // returns transformed Position pos with the inverse of this Transform applied + var det = this.m00 * this.m11 - this.m01 * this.m10; + var x = (this.m11 * pos.x - this.m01 * pos.y - this.m11 * this.m02 + this.m01 * this.m12) / det; + var y = (- this.m10 * pos.x + this.m00 * pos.y + this.m10 * this.m02 - this.m00 * this.m12) / det; + return new Position(x, y); +} +function getRotation(angle, pos) { + // returns a Transform that is a rotation by angle degrees around [pos.x, pos.y] + var traf = new Transform(); + if (angle != 0) { + var t = 2.0 * Math.PI * parseFloat(angle) / 360.0; + traf.m00 = Math.cos(t); + traf.m01 = - Math.sin(t); + traf.m10 = Math.sin(t); + traf.m11 = Math.cos(t); + traf.m02 = pos.x - pos.x * Math.cos(t) + pos.y * Math.sin(t); + traf.m12 = pos.y - pos.x * Math.sin(t) - pos.y * Math.cos(t); + } + return traf; +} +function getTranslation(pos) { + // returns a Transform that is a translation by [pos.x, pos,y] + var traf = new Transform(); + traf.m02 = pos.x; + traf.m12 = pos.y; + return traf; +} +function getScale(size) { + // returns a Transform that is a scale by [size.width, size.height] + var traf = new Transform(); + traf.m00 = size.width; + traf.m11 = size.height; + return traf; +} + + +/* ********************************************** + * parameter routines + * ******************************************** */ + +function newParameter(name, defaultValue, detail) { + // create a new parameter with a name and a default value + if (defined(dlParams[name])) { + alert("Fatal: An object with name '" + name + "' already exists - cannot recreate!"); + return false; + } else { + dlParams[name] = new Object(); + dlParams[name].defaultValue = defaultValue; + dlParams[name].hasValue = false; + dlParams[name].value = defaultValue; + dlParams[name].detail = detail; + return dlParams[name]; + } +} + +function getParameter(name) { + // returns the named parameter value or its default value + if (defined(dlParams[name])) { + if (dlParams[name].hasValue) { + return dlParams[name].value; + } else { + return dlParams[name].defaultValue; + } + } else { + return null; + } +} + +function setParameter(name, value, relative) { + // sets parameter value (relative values with +/- unless literal) + if (defined(dlParams[name])) { + if ((relative)&&(value.slice)) { + var sign = value.slice(0,1); + if (sign == '+') { + dlParams[name].value = parseFloat(dlParams[name].value) + parseFloat(value.slice(1)); + } else if (sign == '-') { + dlParams[name].value = parseFloat(dlParams[name].value) - parseFloat(value.slice(1)); + } else { + dlParams[name].value = value; + } + } else { + dlParams[name].value = value; + } + dlParams[name].hasValue = true; + return true; + } + return false; +} + +function hasParameter(name) { + // returns if the parameter's value has been set + if (defined(dlParams[name])) { + return dlParams[name].hasValue; + } + return false; +} + +function getAllParameters(detail) { + // returns a string of all parameters in query format + if (! detail) { + detail = 255; + } + var params = new Array(); + for (param in dlParams) { + if (((dlParams[param].detail & detail) > 0)&&(dlParams[param].hasValue)) { + var val = getParameter(param); + if (val != "") { + params.push(param + "=" + val); + } + } + } + return params.join("&"); +} + +function parseParameters(query) { + // gets parameter values from query format string + var params = query.split("&"); + for (var i = 0; i < params.length; i++) { + var keyval = params[i].split("="); + if (keyval.length == 2) { + setParameter(keyval[0], keyval[1]); + } + } +} + + +/* ********************************************** + * HTML/DOM routines + * ******************************************** */ + +function getElement(tagid, quiet) { + // returns the element object with the id tagid + var e; + if (document.getElementById) { + e = document.getElementById(tagid); + } else if (document.all) { + alert("document.all!"); + e = document.all[tagid]; + } else if (document.layers) { + e = document.layers[tagid]; + } + if (e) { + return e; + } else { + if (! quiet) { + alert("unable to find element: "+tagid); + } + return null; + } +} + +function getElementPosition(elem) { + // returns a Position with the position of the element + var x = 0; + var y = 0; + if (defined(elem.offsetParent)) { + // use .offsetLeft for most browsers + var e = elem; + while (e) { + if (browserType.isIE) { + if (browserType.isMac) { + // IE for Mac extraspecial + if (e.offsetParent.tagName == "BODY") { + x += e.clientLeft; + y += e.clientTop; + break; + } + } else { + // special for IE + if ((e.tagName != "TABLE") && (e.tagName != "BODY")) { + x += e.clientLeft; + y += e.clientTop; + } + } + } + x += e.offsetLeft; + y += e.offsetTop; + e = e.offsetParent; + } + } else if (defined(elem.x)) { + // use .x for other (which?) + x = elem.x; + y = elem.y; + } else if (defined(elem.pageX)) { + // use pageX for N4 + x = elem.pageX; + y = elem.pageY; + } else { + alert("unable to get position of "+elem+" (id:"+elem.id+")"); + } + return new Position(getInt(x), getInt(y)); +} + +function getElementSize(elem) { + // returns a Rectangle with the size of the element + var width = 0; + var height = 0; + if (defined(elem.offsetWidth)) { + width = elem.offsetWidth; + height = elem.offsetHeight; + } else if (defined(elem.width)) { + width = elem.width; + height = elem.height; + } else if (defined(elem.clip.width)) { + width = elem.clip.width; + height = elem.clip.height; + } else { + alert("unable to get size of "+elem+" (id:"+elem.id+")"); + } + return new Size(getInt(width), getInt(height)); +} + +function getElementRect(elem) { + // returns a Rectangle with the size and position of the element + var pos = getElementPosition(elem); + var size = getElementSize(elem); + return new Rectangle(pos.x, pos.y, size.width, size.height); +} + +function moveElement(elem, rect) { + // moves and sizes the element + if (elem.style) { + if (defined(rect.x)) { + elem.style.left = Math.round(rect.x) + "px"; + elem.style.top = Math.round(rect.y) + "px"; + } + if (defined(rect.width)) { + elem.style.width = Math.round(rect.width) + "px"; + elem.style.height = Math.round(rect.height) + "px"; + } + } else if (document.layers) { + if (defined(rect.x)) { + elem.pageX = getInt(rect.x); + elem.pageY = getInt(rect.y); + } + if (defined(rect.width)) { + elem.clip.width = getInt(rect.width); + elem.clip.height = getInt(rect.height); + } + } else { + alert("moveelement: no style nor layer property!"); + return false; + } + return true; +} + +function showElement(elem, show) { + // shows or hides the element + if (elem.style) { + if (show) { + elem.style.visibility = "visible"; + } else { + elem.style.visibility = "hidden"; + } + } else if (defined(elem.visibility)) { + if (show) { + elem.visibility = "show"; + } else { + elem.visibility = "hide"; + } + } else { + alert("showelement: no style nor layer property!"); + } + return true; +} + +function isElementVisible(elem) { + // returns of the is shown or hidden + if (elem.style) { + return (elem.style.visibility == "visible"); + } else if (defined(elem.visibility)) { + return (elem.visibility == "show"); + } else { + alert("iselementvisible: no style nor layer property!"); + } +} + +function evtPosition(evt) { + // returns the on-screen Position of the Event + var x; + var y; + evt = (evt) ? evt : window.event; + if (!evt) { + alert("no event found! "+evt); + return; + } + if (defined(evt.pageX)) { + x = parseInt(evt.pageX); + y = parseInt(evt.pageY); + } else if (defined(evt.clientX)) { + x = parseInt(document.body.scrollLeft+evt.clientX); + y = parseInt(document.body.scrollTop+evt.clientY); + } else { + alert("evtPosition: don't know how to deal with "+evt); + } + return new Position(x, y); +} + +function registerEvent(type, elem, handler) { + // register the given event handler on the indicated element + if (elem.addEventListener) { + elem.addEventListener(type, handler, false); + } else { + if (type == "mousedown") { + if (elem.captureEvents) { + elem.captureEvents(Event.MOUSEDOWN); + } + elem.onmousedown = handler; + } else if (type == "mouseup") { + if (elem.captureEvents) { + elem.captureEvents(Event.MOUSEUP); + } + elem.onmouseup = handler; + } else if (type == "mousemove") { + if (elem.captureEvents) { + elem.captureEvents(Event.MOUSEMOVE); + } + elem.onmousemove = handler; + } else if (type == "keypress") { + if (elem.captureEvents) { + elem.captureEvents(Event.KEYPRESS); + } + elem.onkeypress = handler; + } else { + alert("registerEvent: unknown event type "+type); + return false; + } + } + return true; +} + +function unregisterEvent(type, elem, handler) { + // unregister the given event handler from the indicated element + if (elem.removeEventListener) { + elem.removeEventListener(type, handler, false); + } else { + if (type == "mousedown") { + if (elem.releaseEvents) { + elem.releaseEvents(Event.MOUSEDOWN); + } + elem.onmousedown = null; + } else if (type == "mouseup") { + if (elem.releaseEvents) { + elem.releaseEvents(Event.MOUSEUP); + } + elem.onmouseup = null; + } else if (type == "mousemove") { + if (elem.releaseEvents) { + elem.releaseEvents(Event.MOUSEMOVE); + } + elem.onmousemove = null; + } else if (type == "keypress") { + if (elem.releaseEvents) { + elem.releaseEvents(Event.KEYPRESS); + } + elem.onkeypress = null; + } else { + alert("unregisterEvent: unknown event type "+type); + return false; + } + } + return true; +} + + +// old registerXXYY API for compatibility +function registerMouseDown(elem, handler) { + return registerEvent("mousedown", elem, handler); +} +function unregisterMouseDown(elem, handler) { + return unregisterEvent("mousedown", elem, handler); +} +function registerMouseMove(elem, handler) { + return registerEvent("mousemove", elem, handler); +} +function unregisterMouseMove(elem, handler) { + return unregisterEvent("mousemove", elem, handler); +} +function registerKeyDown(handler) { + return registerEvent("keypress", elem, handler); +} + + +function getWinSize() { + // returns a Size with the current window size (mostly from www.quirksmode.org) + var wsize = new Size(100, 100); + if (defined(self.innerHeight)) { + // all except Explorer + if ((self.innerWidth == 0)||(self.innerHeight == 0)) { + // Safari 1.2 (and other) bug + if (parent) { + wsize.height = parent.innerHeight; + wsize.width = parent.innerWidth; + } + } else { + wsize.width = self.innerWidth; + wsize.height = self.innerHeight; + } + } else if (document.documentElement && document.documentElement.clientHeight) { + // Explorer 6 Strict Mode + wsize.width = document.documentElement.clientWidth; + wsize.height = document.documentElement.clientHeight; + } else if (document.body) { + // other Explorers + wsize.width = document.body.clientWidth; + wsize.height = document.body.clientHeight; + } + return wsize; +} + +function openWin(url, name, params) { + // open browser window + var ow = window.open(url, name, params); + ow.focus(); +} diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/contexto/contexto.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/contexto/contexto.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,53 @@ +<%@ page language="java" %> +<%@ page import="java.io.*" %> +<%@ page import="java.net.*" %> + +<% + digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(); + dlRequest.setWithRequest(request); + +%> + +<% + // Possible parameters + String htmlPage = request.getParameter("htmlPage"); + // neu eingebaut - christian + // @beat: kannst du das zeugs bitte checken und mir sagen, ob du + // dagegen bist oder nicht. es ist ein uebler hack, der keine + // kontrollmechanismen hat, aber im moment halt meinen anspruechen + // genuegt. (den import von java.net.* ist auch von mir) + String htmlURL = request.getParameter("htmlURL"); + String xmlURL = request.getParameter("xmlURL"); + String xslURL = request.getParameter("xslURL"); + String fileName = request.getParameter("fn"); + String pageNumber = request.getParameter("pn"); + + // funcktioniert leider nicht - christian + //System.setProperty("http.proxyHost", "proxy.unibe.ch"); + //System.setProperty("http.proxyPort", "8080"); + + if(htmlPage != null) { + response.getWriter().println(htmlPage); + // neue parameterart eingebaut - christian + } else if(htmlURL != null) { + try { + URL u = new URL(htmlURL); + String content_type = u.openConnection().getContentType(); + InputStream is = u.openStream(); + InputStreamReader isr = new InputStreamReader(is); + BufferedReader br = new BufferedReader(isr); + //response.setContentType(content_type); + String aLine; + while ((aLine = br.readLine()) != null) { + response.getWriter().println(aLine); + } + } catch (Exception e) { + response.getWriter().println(e); + } + } else if((xmlURL != null) && (xslURL != null)) { + out.println("xsl"); + response.sendRedirect("http://sophia.unibe.ch:8080/xslt/ApplyXSLT?URL="+ xmlURL + "&xslURL=" + xslURL); + } else if(fileName != null && pageNumber != null) { + response.sendRedirect("http://hera.unibe.ch:8080/alcatraz/servlet/Texter?fn=" + fileName + "&pn=" + pageNumber); + } +%> diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/digicat.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/digicat.html Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,31 @@ + + + +Digital Library Redirect + + + + + +

Digital Library Redirect

+ +

You should automatically be redirected to the Digital Library page. + (digicat.jsp)

+ +

If this doesn't happen make shure JavaScript is enabled in your browser. + The Digital Library pages need JavaScript to work. If your problem still + remains, please contact the administrator.

+ +
+
robert.casties@philo.unibe.ch
+ diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/digicat.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/digicat.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,39 @@ +<%@ 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)); +String baseUrl = dcRequest.getAsString("base.url"); +%> + + +Digital Document Library - Digicat + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/digilib-fail.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/digilib-fail.html Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,14 @@ + + +Login to digilib + + + +

Login to digilib failed

+ +

The name and password are incorrect!

+ +

You can use the browser's "Back" button and try again.

+ + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/digilib-login.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/digilib-login.html Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,30 @@ + + +Login to digilib + + + + +

This document requires authentication

+ +

Please enter the name and the password to access this document.

+ +

+ + + + + + + + + + + + + +
Name:
Password:
+
+ + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/digilib-new.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/digilib-new.html Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,366 @@ + + + + + + The new digilib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/digilib.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/digilib.html Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,29 @@ + + + +Digital Library Redirect + + + + + +

Digital Library Redirect

+ +

You should automatically be redirected to the Digital Library page. + (digilib.jsp)

+ +

If this doesn't happen make shure JavaScript is enabled in your browser. + The Digital Library pages need JavaScript to work. If your problem still + remains, please contact the administrator.

+ +
+
robert.casties@philo.unibe.ch
+ diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/digilib.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/digilib.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,40 @@ +<%@ 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 dlRequest = new digilib.servlet.DigilibRequest(request); +// check if authentication is needed and redirect if necessary +docBean.doAuthentication(dlRequest, response); + +String digiURL = "digimage.jsp?" + dlRequest.getAsString(); + +%> + +Digital Document Library + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/digimage.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/digimage.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,86 @@ +<%@ page language="java" %><%! +// -- JSP init ------------- + +// 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); + } +} +// -- end of JSP init ------------- +%><% +// -- JSP request ------------- + +// parsing the query +// ----------------- +digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); +docBean.setRequest(dlRequest); +// check if authentication is needed and redirect if necessary +docBean.doAuthentication(response); +// add number of pages +dlRequest.setValue("pt", docBean.getNumPages()); +// store objects for jsp:include +pageContext.setAttribute("docBean", docBean, pageContext.REQUEST_SCOPE); +%> + + Digital Document Library (L1) + + + + + +<% if (dlRequest.hasOption("clop", "noarrows")) { +%><% +} else { +%><% +} +%> + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/digimage_img_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/digimage_img_inc.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,25 @@ +<%@ page language="java" %><% +// retrieve objects from context +digilib.servlet.DocumentBean docBean = (digilib.servlet.DocumentBean) pageContext.getAttribute("docBean", pageContext.REQUEST_SCOPE); +digilib.servlet.DigilibRequest dlRequest = docBean.getRequest(); +String ua = request.getHeader("User-Agent"); +boolean isN4 = ((ua.indexOf("Mozilla/4.") > -1)&&(ua.indexOf("MSIE") == -1)); +%> +<% + if (isN4) { +%><% + } else { +%>
<% + } +%> + +<% + if (isN4) { +%><% + } else { +%>
<% + } +%> diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/digimage_tbl_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/digimage_tbl_inc.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,61 @@ +<%@ page language="java" %><% +// retrieve objects from context +digilib.servlet.DocumentBean docBean = (digilib.servlet.DocumentBean) pageContext.getAttribute("docBean", pageContext.REQUEST_SCOPE); +digilib.servlet.DigilibRequest dlRequest = docBean.getRequest(); +String ua = request.getHeader("User-Agent"); +boolean isN4 = ((ua.indexOf("Mozilla/4.") > -1)&&(ua.indexOf("MSIE") == -1)); +%> + + + + + + + + + + + + + + + + +
<% + if (docBean.canMoveUp()) { + %><% + } + %>
<% + if (docBean.canMoveLeft()) { + %><% + } + %> +<% + if(isN4) { + %><% + } else { + %>
<% + } +%> + +<% + if(isN4) { + %><% + } else { + %>
<% + } +%> +
<% + if (docBean.canMoveRight()) { + %><% + } + %>
<% + if (docBean.canMoveDown()) { + %><% + } + %>
diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/dirInfo-xml.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/dirInfo-xml.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,46 @@ +<%@ page language="java" %><%! +// 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); + } +} +%> +<% +// process request +// get digilib config +digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig(); +// parsing the query +digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); +// dir cache +digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache"); +// get directory +digilib.io.DocuDirectory dir = dirCache.getDirectory(dlRequest.getFilePath()); + +%> +<% if (dir != null) { %> + <%= dir.size() %> + <%= dir.getDirName() %> + <%= dir.getDir().getPath() %> +<% + if (!dlRequest.hasOption("mo", "dir")) { + int l = dir.size(); + for (int i = 0; i < l; i++) { + digilib.io.DocuDirent f = dir.get(i); + String fn = (f != null) ? f.getName() : "null"; +%> + <%= i+1 %> + <%= digilib.io.FileOps.basename(fn) %> + <%= fn %> + +<% + } // for + } // if not dironly + } // if dir +%> diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/dlContext-xml.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/dlContext-xml.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,43 @@ +<%@ page language="java" %><%! +// 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); + } +} +%> +<% +// process request +// get digilib config +digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig(); +// parsing the query +digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); +// dir cache +digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache"); + +%> + +<% +int pn = dlRequest.getAsInt("pn"); +String fn = dlRequest.getFilePath(); +String ctx = ""; +digilib.io.DocuDirent f = dirCache.getFile(fn, pn, digilib.io.FileOps.CLASS_IMAGE); +if (f != null) { + //ctx = "hasfile:"+f.getName(); + f.checkMeta(); + java.util.HashMap meta = f.getFileMeta(); + if (meta != null) { + //ctx = "JSP:hasmeta!"; + if (meta.containsKey("context")) { + ctx = (String) meta.get("context"); + } + } +} +%><%= ctx %> + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/dlInfo-js.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/dlInfo-js.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,34 @@ +<%@ page language="java" %> +<%! +// 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 dlRequest = new digilib.servlet.DigilibRequest(request); +docBean.setRequest(dlRequest); +%> +// Automatically generated JavaScript snippet with parameters +<% + Object[] keys = dlRequest.keySet().toArray(); + java.util.Arrays.sort(keys); + int l = keys.length; + for (int i = 0; i < l; i++) { + String key = (String) keys[i]; + String val = dlRequest.getAsString(key); + if (val.length() == 0) { + val = ""; + } + %>var dl_<%= key %> = "<%= val %>"; +<% + } +%> diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/dlInfo-xml.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/dlInfo-xml.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,38 @@ +<%@ page language="java" %><%! +// 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); + } +} +%> +<% +// process request +// get digilib config +digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig(); +// parsing the query +digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); +docBean.setRequest(dlRequest); + +%> + +<% + Object[] keys = dlRequest.keySet().toArray(); + java.util.Arrays.sort(keys); + int l = keys.length; + for (int i = 0; i < l; i++) { + String key = (String) keys[i]; + String val = dlRequest.getAsString(key); + if (val.length() == 0) { + val = ""; + } +%> +<% + } +%> diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/dllib.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/dllib.js Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,616 @@ +/* Copyright (C) 2003,2004 IT-Group MPIWG, WTWG Uni Bern and others + +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 + +Authors: + Christian Luginbuehl, 01.05.2003 (first version) + DW 24.03.2004 (Changed for digiLib in Zope) + Robert Casties, 8.11.2005 + + ! Requires baselib.js ! + +*/ + + +function identify() { + // used for identifying a digilib instance + // Relato uses that function - lugi + return "Digilib 0.6"; +} + + +/* + * more parameter handling + */ + +function parseArea() { + // returns area Rectangle from current parameters + return new Rectangle(getParameter("wx"), getParameter("wy"), getParameter("ww"), getParameter("wh")); +} + +function setParamFromArea(rect) { + // sets digilib wx etc. from rect + setParameter("wx", cropFloat(rect.x)); + setParameter("wy", cropFloat(rect.y)); + setParameter("ww", cropFloat(rect.width)); + setParameter("wh", cropFloat(rect.height)); + return true; +} + +function parseTrafo(elem) { + // returns Transform from current dlArea and picsize + var picsize = getElementRect(elem); + var trafo = new Transform(); + // subtract area offset and size + trafo.concat(getTranslation(new Position(-dlArea.x, -dlArea.y))); + trafo.concat(getScale(new Size(1/dlArea.width, 1/dlArea.height))); + // scale to screen size + trafo.concat(getScale(picsize)); + trafo.concat(getTranslation(picsize)); + // rotate + //trafo.concat(getRotation(- getParameter("rot"), new Position(0.5*picsize.width, 0.5*picsize.height))); + // mirror + //if (hasFlag("hmir")) { + //trafo.m00 = - trafo.m00; + //} + //if (hasFlag("vmir")) { + //trafo.m11 = - trafo.m11; + //} + return trafo; +} + + +function parseMarks() { + // returns marks array from current parameters + var marks = new Array(); + var ma; + var mk = getParameter("mk"); + if (mk.indexOf(";") >= 0) { + // old format with ";" + ma = mk.split(";"); + } else { + ma = mk.split(","); + } + for (var i = 0; i < ma.length ; i++) { + var pos = ma[i].split("/"); + if (pos.length > 1) { + marks.push(new Position(pos[0], pos[1])); + } + } + return marks; +} + +function getAllMarks() { + // returns a string with all marks in query format + var marks = new Array(); + for (var i = 0; i < dlMarks.length; i++) { + marks.push(cropFloat(dlMarks[i].x) + "/" + cropFloat(dlMarks[i].y)); + } + return marks.join(","); +} + +function addMark(pos) { + // add a mark + dlMarks.push(pos); + setParameter("mk", getAllMarks()); + return true; +} + +function deleteMark() { + // delete the last mark + dlMarks.pop(); + setParameter("mk", getAllMarks()); + return true; +} + +function hasFlag(mode) { + // returns if mode flag is set + return (dlFlags[mode]); +} + +function addFlag(mode) { + // add a mode flag + dlFlags[mode] = mode; + setParameter("mo", getAllFlags()); + return true; +} + +function removeFlag(mode) { + // remove a mode flag + if (dlFlags[mode]) { + delete dlFlags[mode]; + } + setParameter("mo", getAllFlags()); + return true; +} + +function toggleFlag(mode) { + // change a mode flag + if (dlFlags[mode]) { + delete dlFlags[mode]; + } else { + dlFlags[mode] = mode; + } + setParameter("mo", getAllFlags()); + return true; +} + +function getAllFlags() { + // returns a string with all flags in query format + var fa = new Array(); + for (var f in dlFlags) { + if ((f != "")&&(dlFlags[f] != null)) { + fa.push(f); + } + } + return fa.join(","); +} + +function parseFlags() { + // sets dlFlags from the current parameters + var flags = new Object(); + var fa = getParameter("mo").split(","); + for (var i = 0; i < fa.length ; i++) { + var f = fa[i]; + if (f != "") { + flags[f] = f; + } + } + return flags; +} + + +function bestPicSize(elem, inset) { + // returns a Size with the best image size for the given element + if (! defined(inset)) { + inset = 25; + } + var ws = getWinSize(); + var es = getElementPosition(elem); + if (es) { + ws.width = ws.width - es.x - inset; + ws.height = ws.height - es.y - inset; + } + return ws; +} + +function setDLParam(e, s, relative) { + // sets parameter based on HTML event + var nam; + var val; + if (s.type && (s.type == "select-one")) { + nam = s.name; + val = s.options[s.selectedIndex].value; + } else if (s.name && s.value) { + nam = s.name; + val = s.value; + } + if (nam && val) { + setParameter(nam, val, relative); + display(); + } else { + alert("ERROR: unable to process event!"); + } + return true; +} + + +/* ********************************************** + * digilib specific routines + * ******************************************** */ + + +function dl_param_init() { + // parameter initialisation before onload + if (!baseScriptVersion) { + base_init(); + } + dlScriptVersion = "1.2b"; + dlArea = new Rectangle(0.0, 0.0, 1.0, 1.0); + dlMaxArea = new Rectangle(0.0, 0.0, 1.0, 1.0); + dlTrafo = new Transform(); + dlMarks = new Array(); + dlFlags = new Object(); + elemScaler = null; + picElem = null; + ZOOMFACTOR = Math.sqrt(2); + + // put the query parameters (sans "?") in the parameters array + parseParameters(location.search.slice(1)); + // treat special parameters + dlMarks = parseMarks(); + dlArea = parseArea(); + dlFlags = parseFlags(); +} + + +function dl_init() { + // initalisation on load + if (!dlScriptVersion) { + dl_param_init(); + } + elemScaler = getElement("scaler", true); + picElem = getElement("pic", true); + if (picElem == null && elemScaler) { + // in N4 pic is in the scaler layer + picElem = elemScaler.document.images[0]; + } + if ((!elemScaler)||(!picElem)) { + alert("Sorry, digilib doesn't work here!"); + return false; + } + // give a name to the window containing digilib + if (defined(dlTarget)&&(dlTarget)) { + window.name = dlTarget; + } else { + window.name = "digilib"; + } + // put the query parameters (sans "?") in the parameters array + parseParameters(location.search.slice(1)); + // treat special parameters + dlMarks = parseMarks(); + dlArea = parseArea(); + dlFlags = parseFlags(); + // wait for image to load and display marks + renderMarks(); + // done + focus(); + return; +} + + +function display(detail) { + // redisplay the page + if (! detail) { + detail = 255; + } + var queryString = getAllParameters(detail); + location.href = location.protocol + "//" + location.host + location.pathname + "?" + queryString; +} + + +/* ********************************************** + * interactive digilib functions + * ******************************************** */ + + +function renderMarks() { + // put the visible marks on the image + var mark_count = dlMarks.length; + // make shure the image is loaded so we know its size + if (defined(picElem.complete) && picElem.complete == false && ! browserType.isN4 ) { + setTimeout("renderMarks()", 100); + } else { + dlTrafo = parseTrafo(picElem); + for (var i = 0; i < 8; i++) { + var me = getElement("dot"+i); + if (i < mark_count) { + if (dlArea.containsPosition(dlMarks[i])) { + var mpos = dlTrafo.transform(dlMarks[i]); + // suboptimal to place -5 pixels and not half size of mark-image + mpos.x = mpos.x -5; + mpos.y = mpos.y -5; + moveElement(me, mpos); + showElement(me, true); + } + } else { + // hide the other marks + showElement(me, false); + } + } + } +} + + +function setMark(reload) { + // add a mark where clicked + if ( dlMarks.length > 7 ) { + alert("Only 8 marks are possible at the moment!"); + return; + } + window.focus(); + + function markEvent(evt) { + // event handler adding a new mark + unregisterEvent("mousedown", elemScaler, markEvent); + var p = dlTrafo.invtransform(evtPosition(evt)); + addMark(p); + if (defined(reload)&&(!reload)) { + // don't redisplay + renderMarks(); + return; + } + display(); + } + + // starting event capture + registerEvent("mousedown", elemScaler, markEvent); +} + + +function removeMark(reload) { + // remove the last mark + deleteMark(); + if (defined(reload)&&(!reload)) { + // don't redisplay + renderMarks(); + return; + } + display(); +} + + +function zoomArea() { + var click = 1; + var pt1, pt2; + var eck1pos, eck2pos, eck3pos, eck4pos; + window.focus(); + var eck1 = getElement("eck1"); + var eck2 = getElement("eck2"); + var eck3 = getElement("eck3"); + var eck4 = getElement("eck4"); + + function zoomClick(evt) { + // mouse click handler + if (click == 1) { + // first click -- start moving + click = 2; + pt1 = evtPosition(evt); + pt2 = pt1; + eck1pos = pt1; + eck2pos = new Position(pt1.x - 12, pt1.y); + eck3pos = new Position(pt1.x, pt1.y - 12); + eck4pos = new Position(pt1.y - 12, pt1.y - 12); + moveElement(eck1, eck1pos); + moveElement(eck2, eck2pos); + moveElement(eck3, eck3pos); + moveElement(eck4, eck4pos); + showElement(eck1, true); + showElement(eck2, true); + showElement(eck3, true); + showElement(eck4, true); + // show moving + registerEvent("mousemove", elemScaler, zoomMove); + registerEvent("mousemove", eck4, zoomMove); + // enable drag-to-zoom + registerEvent("mouseup", elemScaler, zoomClick); + registerEvent("mouseup", eck4, zoomClick); + } else { + // second click -- end moving + pt2 = evtPosition(evt); + showElement(eck1, false); + showElement(eck2, false); + showElement(eck3, false); + showElement(eck4, false); + unregisterEvent("mousemove", elemScaler, zoomMove); + unregisterEvent("mousemove", eck4, zoomMove); + unregisterEvent("mousedown", elemScaler, zoomClick); + unregisterEvent("mousedown", eck4, zoomClick); + var p1 = dlTrafo.invtransform(pt1); + var p2 = dlTrafo.invtransform(pt2); + var ww = p2.x-p1.x; + var wh = p2.y-p1.y; + if ((ww > 0)&&(wh > 0)) { + setParameter("wx", cropFloat(p1.x)); + setParameter("wy", cropFloat(p1.y)); + setParameter("ww", cropFloat(ww)); + setParameter("wh", cropFloat(wh)); + parseArea(); + // zoomed is always fit + setParameter("ws", 1); + display(); + } + } + } + + function zoomMove(evt) { + // mouse move handler + pt2 = evtPosition(evt); + // restrict marks to move right and down + eck1pos = pt1; + eck2pos = new Position(Math.max(pt1.x, pt2.x)-12, pt1.y); + eck3pos = new Position(pt1.x, Math.max(pt1.y, pt2.y)-12); + eck4pos = new Position(Math.max(pt1.x, pt2.x)-12, Math.max(pt1.y, pt2.y)-12); + moveElement(eck1, eck1pos); + moveElement(eck2, eck2pos); + moveElement(eck3, eck3pos); + moveElement(eck4, eck4pos); + } + + // starting event capture + registerEvent("mousedown", elemScaler, zoomClick); + registerEvent("mousedown", eck4, zoomClick); +} + +function zoomBy(factor) { + // zooms by the given factor + var newarea = dlArea.copy(); + newarea.width /= factor; + newarea.height /= factor; + newarea.x -= 0.5 * (newarea.width - dlArea.width); + newarea.y -= 0.5 * (newarea.height - dlArea.height); + newarea = dlMaxArea.fit(newarea); + setParamFromArea(newarea); + display(); +} + + +function zoomFullpage() { + // zooms out to show the whole image + setParameter("wx", 0.0); + setParameter("wy", 0.0); + setParameter("ww", 1.0); + setParameter("wh", 1.0); + display(); +} + + +function moveCenter() { + // move visible area so that it's centered around the clicked point + if ( (dlArea.width == 1.0) && (dlArea.height == 1.0) ) { + // nothing to do + return; + } + window.focus(); + + function moveCenterEvent(evt) { + // move to handler + unregisterEvent("mousedown", elemScaler, moveCenterEvent); + var pt = dlTrafo.invtransform(evtPosition(evt)); + var newarea = new Rectangle(pt.x-0.5*dlArea.width, pt.y-0.5*dlArea.height, dlArea.width, dlArea.height); + newarea = dlMaxArea.fit(newarea); + // set parameters + setParamFromArea(newarea); + parseArea(); + display(); + } + + // starting event capture + registerEvent("mousedown", elemScaler, moveCenterEvent); +} + +function moveBy(movx, movy) { + // move visible area by movx and movy (in units of ww, wh) + if ((dlArea.width == 1.0)&&(dlArea.height == 1.0)) { + // nothing to do + return; + } + var newarea = dlArea.copy(); + newarea.x += parseFloat(movx)*dlArea.width; + newarea.y += parseFloat(movy)*dlArea.height; + newarea = dlMaxArea.fit(newarea); + // set parameters + setParamFromArea(newarea); + parseArea(); + display(); +} + +function getRef() { + // returns a reference to the current digilib set + if (! baseUrl) { + var baseUrl = location.protocol + "//" + location.host + location.pathname; + } + var hyperlinkRef = baseUrl; + var par = getAllParameters(7+16); // all without ddpi, pt + if (par.length > 0) { + hyperlinkRef += "?" + par; + } + return hyperlinkRef; +} + +function getRefWin(type, msg) { + // shows an alert with a reference to the current digilib set + if (! msg) { + msg = "Link for HTML documents"; + } + prompt(msg, getRef()); +} + +function getQuality() { + // returns the current q setting + for (var i = 0; i < 3; i++) { + if (hasFlag("q"+i)) { + return i; + } + } + return 1 +} + +function setQuality(qual) { + // set the image quality + for (var i = 0; i < 3; i++) { + removeFlag("q"+i); + if (i == qual) { + addFlag("q"+i); + } + } + setParameter("mo", getAllFlags()); + display(); +} + +function setQualityWin(msg) { + // dialog for setting quality + if (! msg) { + msg = "Quality (0..2)"; + } + var q = getQuality(); + var newq = window.prompt(msg, q); + if (newq) { + setQuality(newq); + } +} + +function mirror(dir) { + // mirror the image horizontally or vertically + if (dir == "h") { + toggleFlag("hmir"); + } else { + toggleFlag("vmir"); + } + setParameter("mo", getAllFlags()); + display(); +} + +function gotoPage(gopage, keep) { + // goto given page nr (+/-: relative) + var oldpn = parseInt(getParameter("pn")); + // try setParameter with relative value + setParameter("pn", gopage, true); + // check the result + var pn = parseInt(getParameter("pn")); + if (pn < 1) { + alert("No such page! (Page number too low)"); + setParameter("pn", oldpn); + return; + } + if (hasParameter("pt")) { + pt = parseInt(getParameter("pt")) + if (pn > pt) { + alert("No such page! (Page number too high)"); + setParameter("pn", oldpn); + return; + } + } + if (keep) { + display(15+32); // all, no mark + } else { + display(3+32); // fn, pn, ws, mo + pt + } +} + +function gotoPageWin() { + // dialog to ask for new page nr + var pn = getParameter("pn"); + var gopage = window.prompt("Go to page", pn); + if (gopage) { + gotoPage(gopage); + } +} + +function setParamWin(param, text, relative) { + // dialog to ask for new parameter value + var val = getParameter(param); + var newval = window.prompt(text, val); + if (newval) { + setParameter(param, newval, relative); + display(); + } +} + +function showOptions(show) { + // show or hide option div + var elem = getElement("dloptions"); + showElement(elem, show); +} \ No newline at end of file diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/empty.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/empty.html Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/back.png Binary file client/digitallibrary/greyskin/back.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/back.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/back.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/baselib.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/baselib.js Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,981 @@ +/* Copyright (C) 2003-2006 IT-Group MPIWG, WTWG Uni Bern and others + +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 + +Authors: + Christian Luginbuehl, 01.05.2003 (first version) + DW 24.03.2004 (Changed for digiLib in Zope) + Robert Casties, 2.11.2004 (almost complete rewrite) + Martin Raspe, 12.12.2005 (changes for Digilib NG) + Robert Casties, 3.9.2009 +*/ + +// was: function base_init() { +baseLibVersion = "2.011"; +browserType = getBrowserType(); + +sliders = {}; +activeSlider = null; + +function getInt(n) { + // returns always an integer + n = parseInt(n); + return (isNaN(n)) ? 0 : n; +} + +function defined(x) { + // returns if x is defined + return (typeof arguments[0] != "undefined"); +} + +function cropFloat(x) { + // auxiliary function to crop senseless precision + return parseInt(10000 * x) / 10000; +} + +function getBrowserType() { + // browser sniffer + var bt = Object(); + bt.doDHTML = false; + bt.versIE = 0; + + if ((! document.cssonly && document.layers) || document.all || document.getElementById) { + var vers = navigator.appVersion.split('MSIE '); + vers = vers[vers.length - 1]; + bt.versIE = getInt(vers); + bt.isIE = navigator.userAgent.indexOf('MSIE') >= 0; + bt.isMac = navigator.platform.indexOf('Mac') >= 0; + bt.isWin = navigator.platform.indexOf('Win') >= 0; + bt.isN4 = (navigator.userAgent.indexOf('Mozilla/4.') >= 0) && ! bt.isIE; + bt.isIEWin = bt.versIE > 0 && bt.isWin; + if (navigator.appVersion.indexOf('MSIE') < 0 || ! bt.isMac || bt.versIE >= 5) { + bt.doDHTML = true; + bt.isOpera = navigator.userAgent.indexOf(' Opera ') >= 0; + bt.isKonq = navigator.userAgent.indexOf(' Konqueror') >= 0; + } + } + return bt; +} + +// fixes for javascript < 1.2 +if (! Array.prototype.push) { + Array.prototype.push = function(val) { + this[this.length] = val; + return this.length; + } + Array.prototype.pop = function() { + var val = this[this.length-1]; + this.length -= 1; + return val; + } +} + + +/* ********************************************** + * geometry classes + * ******************************************** */ + +/* + * Size class + */ +function Size(w, h) { + this.width = parseFloat(w); + this.height = parseFloat(h); + return this; +} +Size.prototype.toString = function() { + return this.width + "x" + this.height; +} +Size.prototype.equals = function(other) { + return (this.width == other.width + && this.height == other.height) + } + +/* + * Position class + */ +function Position(x, y) { + this.x = parseFloat(x); + this.y = parseFloat(y); + return this; +} +Position.prototype.toString = function() { + return this.x + "," + this.y; +} +Position.prototype.equals = function(other) { + return (this.x == other.x + && this.y == other.y) +} +/* + * Rectangle class + */ +function Rectangle(x, y, w, h) { + if (typeof x == "object") { + // assume x and y are Position + this.x = x.x; + this.y = x.y; + this.width = y.x - x.x; + this.height = y.y - x.y; + return this; + } + this.x = parseFloat(x); + this.y = parseFloat(y); + this.width = parseFloat(w); + this.height = parseFloat(h); + return this; +} +Rectangle.prototype.toString = function() { + return this.width+"x"+this.height+"@"+this.x+","+this.y; +} +Rectangle.prototype.copy = function() { + // returns a copy of this Rectangle + return new Rectangle(this.x, this.y, this.width, this.height); +} +Rectangle.prototype.getPosition = function() { + // returns the position of this Rectangle + return new Position(this.x, this.y); +} +Rectangle.prototype.getPt1 = Rectangle.prototype.getPosition; +// returns the upper left corner position + +Rectangle.prototype.getPt2 = function() { + // returns the lower right corner position of this Rectangle + return new Position(this.x + this.width, this.y + this.height); +} +Rectangle.prototype.setPt1 = function(pos) { + // sets the upper left corner to position pos + this.x = pos.x; + this.y = pos.y; + return this; +} +Rectangle.prototype.setPt2 = function(pos) { + // sets the lower right corner to position pos + this.width = pos.x - this.x; + this.height = pos.y - this.y; + return this; +} +Rectangle.prototype.getCenter = function() { + // returns the center position of this Rectangle + return new Position(this.x + this.width / 2, this.y + this.height / 2); +} +Rectangle.prototype.setCenter = function(pos) { + // moves this Rectangle's center to position pos + this.x = pos.x - this.width / 2; + this.y = pos.y - this.height / 2; + return this; +} +Rectangle.prototype.getSize = function() { + // returns the size of this Rectangle + return new Size(this.width, this.height); +} +Rectangle.prototype.equals = function(other) { + // equal props + return (this.getPosition().equals(other.getPosition()) + && this.getSize().equals(other.getSize()) + ); +} +Rectangle.prototype.getArea = function() { + // returns the area of this Rectangle + return (this.width * this.height); +} +Rectangle.prototype.normalize = function() { + // eliminates negative width and height + var p = this.getPt2(); + this.x = Math.min(this.x, p.x); + this.y = Math.min(this.y, p.y); + this.width = Math.abs(this.width); + this.height = Math.abs(this.height); + return this; +} +Rectangle.prototype.containsPosition = function(pos) { + // returns if Position "pos" lies inside of this rectangle + return ((pos.x >= this.x) + && (pos.y >= this.y) + && (pos.x <= this.x + this.width) + && (pos.y <= this.y + this.width) + ); +} +Rectangle.prototype.containsRect = function(rect) { + // returns if rectangle "rect" is contained in this rectangle + return (this.containsPosition(rect.getPt1()) + && this.containsPosition(rect.getPt2())); +} +Rectangle.prototype.stayInside = function(rect) { + // changes this rectangle's x/y values so it stays inside of rectangle rect + // keeping the proportions + if (this.x < rect.x) this.x = rect.x; + if (this.y < rect.y) this.y = rect.y; + if (this.x + this.width > rect.x + rect.width) + this.x = rect.x + rect.width - this.width; + if (this.y + this.height > rect.y + rect.height) + this.y = rect.y + rect.height - this.height; + return this; +} +Rectangle.prototype.clipTo = function(rect) { + // clips this rectangle so it stays inside of rectangle rect + var p1 = rect.getPt1(); + var p2 = rect.getPt2(); + var this2 = this.getPt2(); + this.setPt1(new Position(Math.max(this.x, p1.x), Math.max(this.y, p1.y))); + this.setPt2(new Position(Math.min(this2.x, p2.x), Math.min(this2.y, p2.y))); + return this; +} +Rectangle.prototype.intersect = function(rect) { + // returns the intersection of the given Rectangle and this one + // FIX ME: not really, it should return null if there is no overlap + var sec = rect.copy(); + if (sec.x < this.x) { + sec.width = sec.width - (this.x - sec.x); + sec.x = this.x; + } + if (sec.y < this.y) { + sec.height = sec.height - (this.y - sec.y); + sec.y = this.y; + } + if (sec.x + sec.width > this.x + this.width) { + sec.width = (this.x + this.width) - sec.x; + } + if (sec.y + sec.height > this.y + this.height) { + sec.height = (this.y + this.height) - sec.y; + } + return sec; +} +Rectangle.prototype.fit = function(rect) { + // returns a Rectangle that fits into this one (by moving first) + var sec = rect.copy(); + sec.x = Math.max(sec.x, this.x); + sec.y = Math.max(sec.y, this.x); + if (sec.x + sec.width > this.x + this.width) { + sec.x = this.x + this.width - sec.width; + } + if (sec.y + sec.height > this.y + this.height) { + sec.y = this.y + this.height - sec.height; + } + return sec.intersect(this); +} + +/* + * Transform class + * + * defines a class of affine transformations + */ +function Transform() { + this.m00 = 1.0; + this.m01 = 0.0; + this.m02 = 0.0; + this.m10 = 0.0; + this.m11 = 1.0; + this.m12 = 0.0; + this.m20 = 0.0; + this.m21 = 0.0; + this.m22 = 1.0; + return this; +} +Transform.prototype.concat = function(traf) { + // add Transform traf to this Transform + for (var i = 0; i < 3; i++) { + for (var j = 0; j < 3; j++) { + var c = 0.0; + for (var k = 0; k < 3; k++) { + c += traf["m"+i+k] * this["m"+k+j]; + } + this["m"+i+j] = c; + } + } + return this; +} +Transform.prototype.transform = function(rect) { + // returns transformed Rectangle or Position with this Transform applied + var x = this.m00 * rect.x + this.m01 * rect.y + this.m02; + var y = this.m10 * rect.x + this.m11 * rect.y + this.m12; + if (rect.width) { + // transform the other corner points + var pt2 = rect.getPt2(); + var x2 = this.m00 * pt2.x + this.m01 * pt2.y + this.m02; + var y2 = this.m10 * pt2.x + this.m11 * pt2.y + this.m12; + var width = x2 - x; + var height = y2 - y; + return new Rectangle(x, y, width, height); + } + return new Position(x, y); +} +Transform.prototype.invtransform = function(rect) { + // returns transformed Rectangle or Position with the inverse of this Transform applied + var det = this.m00 * this.m11 - this.m01 * this.m10; + var x = (this.m11 * rect.x - this.m01 * rect.y - this.m11 * this.m02 + this.m01 * this.m12) / det; + var y = (- this.m10 * rect.x + this.m00 * rect.y + this.m10 * this.m02 - this.m00 * this.m12) / det; + if (rect.width) { + /* transforming width and height like points seems to be wrong + var width = (this.m11 * rect.width - this.m01 * rect.height - this.m11 * this.m02 + this.m01 * this.m12) / det; + var height = (- this.m10 * rect.width + this.m00 * rect.height + this.m10 * this.m02 - this.m00 * this.m12) / det; + */ + // transform the other corner points + var pt2 = rect.getPt2(); + var x2 = (this.m11 * pt2.x - this.m01 * pt2.y - this.m11 * this.m02 + this.m01 * this.m12) / det; + var y2 = (- this.m10 * pt2.x + this.m00 * pt2.y + this.m10 * this.m02 - this.m00 * this.m12) / det; + var width = x2 - x; + var height = y2 - y; + return new Rectangle(x, y, width, height); + } + return new Position(x, y); +} +function getRotation(angle, pos) { + // returns a Transform that is a rotation by angle degrees around [pos.x, pos.y] + var traf = new Transform(); + if (angle != 0) { + var t = 2.0 * Math.PI * parseFloat(angle) / 360.0; + traf.m00 = Math.cos(t); + traf.m01 = - Math.sin(t); + traf.m10 = Math.sin(t); + traf.m11 = Math.cos(t); + traf.m02 = pos.x - pos.x * Math.cos(t) + pos.y * Math.sin(t); + traf.m12 = pos.y - pos.x * Math.sin(t) - pos.y * Math.cos(t); + } + return traf; +} +Transform.prototype.getRotation = getRotation; +function getTranslation(pos) { + // returns a Transform that is a translation by [pos.x, pos,y] + var traf = new Transform(); + traf.m02 = pos.x; + traf.m12 = pos.y; + return traf; +} +Transform.prototype.getTranslation = getTranslation; +function getScale(size) { + // returns a Transform that is a scale by [size.width, size.height] + var traf = new Transform(); + traf.m00 = size.width; + traf.m11 = size.height; + return traf; +} +Transform.prototype.getScale = getScale; + + +/* + * parameters class + */ + +function Parameters() { + this.params = new Object(); + this.PARAM_ALL = 65535; + return this; +} +Parameters.prototype.define = function(name, defaultValue, detail) { + // create a new parameter with a name and a default value + if (!this.params[name]) this.params[name] = new Object(); + this.params[name].defaultValue = defaultValue; + this.params[name].hasValue = false; + this.params[name].value = defaultValue; + this.params[name].detail = detail; + return this.params[name]; +} +Parameters.prototype.reset = function(name) { + // resets the given parameter to its default value + if (!this.params[name]) { + alert("Could not reset non-existing parameter '" + name + "'"); + return false; + } + this.params[name].hasValue = false; + this.params[name].value = this.params[name].defaultValue; + return this.params[name]; +} +Parameters.prototype.resetAll = function() { + // resets all parameters to their default values + for (var p in this.params) { + this.reset(p); + } + return true; +} +Parameters.prototype.remove = function(name) { + if (!defined(this.params[name])) return false; + delete this.params[name]; + return true; +} +Parameters.prototype.get = function(name) { + // returns the named parameter value or its default value + if (!defined(this.params[name])) return null; + return this.params[name].hasValue ? this.params[name].value : this.params[name].defaultValue; +} +Parameters.prototype.set = function(name, value, relative) { + // sets parameter value (relative values with +/- if relative=true) + if (!defined(this.params[name])) return null; + var p = this.params[name]; + if (relative && value.slice) { + // value is a string -- check if it starts with +/- + var sign = value.slice(0, 1); + if (sign == '+') { + p.value = parseFloat(p.value) + parseFloat(value.slice(1)); + } else if (sign == '-') { + p.value = parseFloat(p.value) - parseFloat(value.slice(1)); + } else { + p.value = value; + } + } else { + p.value = value; + } + p.hasValue = true; + return p.value; +} +Parameters.prototype.isSet = function(name) { + // returns if the parameter's value has been set + if (!defined(this.params[name])) return null; + return this.params[name].hasValue; +} +Parameters.prototype.getAll = function(detail) { + // returns a string of all parameters in query format + if (!detail) detail = this.PARAM_ALL; + var pa = new Array(); + for (p in this.params) { + if (((this.params[p].detail & detail) > 0) + && (this.params[p].hasValue)) { + var val = this.params[p].value; + if (val != "") { + pa.push(p + "=" + val); + } + } + } + return pa.join("&"); +} +Parameters.prototype.parse = function(query) { + // gets parameter values from query format string + var pa = query.split("&"); + for (var i = 0; i < pa.length; i++) { + var keyval = pa[i].split("="); + if (keyval.length == 2) { + this.set(keyval[0], keyval[1]); + } + } +} + +/* + * Flags class + * + * Flags are (hash-) collections of unique strings. + */ +function Flags() { + this.flags = new Object(); + return this; +} +Flags.prototype.define = function(name, detail) { + // create a new flag with a name and detail level + this.flags[name] = new Object(); + this.flags[name].set = false; + this.flags[name].detail = detail; + return this.flags[name]; +} +Flags.prototype.get = function(name) { + return (this.flags[name]) ? this.flags[name].set : false; +} +Flags.prototype.set = function(name, value) { + if (!defined(value)) value = true; + if (!this.flags[name]) this.flags[name] = new Object; + this.flags[name].set = value; +} +Flags.prototype.reset = function(name) { + if (!this.flags[name]) this.flags[name] = new Object; + this.flags[name].set = false; +} +Flags.prototype.toggle = function(name) { + if (!this.flags[name]) this.flags[name] = new Object; + this.flags[name].set = !this.flags[name].set; +} +Flags.prototype.resetAll = function() { + for (var f in this.flags) { + this.flags[f].set = false; + } +} +Flags.prototype.parse = function(query, sep) { + // sets the flags from the string query + if (!sep) sep = ","; + var fa = query.split(sep); + for (var i = 0; i < fa.length ; i++) { + var f = fa[i]; + if (f != "") { + this.set(f); + } + } +} +Flags.prototype.getAll = function(detail, sep) { + // returns a string of all flags in query format + if (!detail) detail = 255; + if (!sep) sep = ","; + var fa = new Array(); + for (f in this.flags) { + if (this.flags[f].set) { + // if the flag has a detail level it must match + // otherwise we assume detail=128 + if (this.flags[f].detail) { + if ((this.flags[f].detail & detail) > 0) { + fa.push(f); + } + } else { + if ((detail & 128) > 0) { + fa.push(f); + } + } + } + } + return fa.join(sep); +} + + +/* ********************************************** + * HTML/DOM routines + * ******************************************** */ + +function getElement(tagid, quiet) { + // returns the element object with the id tagid + var e; + if (document.getElementById) { + e = document.getElementById(tagid); + } else if (document.all) { + alert("document.all!"); + e = document.all[tagid]; + } else if (document.layers) { + e = document.layers[tagid]; + } + if (e) { + return e; + } else { + if (! quiet) { + alert("unable to find element: "+tagid); + } + return null; + } +} + +function getElementPosition(elem) { + // returns a Position with the position of the element + var x = 0; + var y = 0; + if (defined(elem.offsetLeft)) { + var e = elem; + while (e) { + if (browserType.isIE) { + if (browserType.isMac) { + if (e.offsetParent.tagName == "BODY") { + // IE for Mac extraspecial + x += e.clientLeft; + y += e.clientTop; + break; + } + } else { + if ((e.tagName != "TABLE") && (e.tagName != "BODY")) { + x += e.clientLeft; + y += e.clientTop; + } + } + } + x += e.offsetLeft; + y += e.offsetTop; + e = e.offsetParent; + } + } else if (defined(elem.x)) { + // use .x for other (which?) + x = elem.x; + y = elem.y; + } else if (defined(elem.pageX)) { + // use pageX for N4 + x = elem.pageX; + y = elem.pageY; + } else { + alert("unable to get position of " + elem + " (id:" + elem.id + ")"); + } + return new Position(getInt(x), getInt(y)); +} + +function getElementSize(elem) { + // returns a Rectangle with the size of the element + var width = 0; + var height = 0; + if (defined(elem.offsetWidth)) { + width = elem.offsetWidth; + height = elem.offsetHeight; + } else if (defined(elem.width)) { + width = elem.width; + height = elem.height; + } else if (defined(elem.clip.width)) { + width = elem.clip.width; + height = elem.clip.height; + } else { + alert("unable to get size of " + elem + " (id:" + elem.id + ")"); + } + return new Size(getInt(width), getInt(height)); +} + +function getElementRect(elem) { + // returns a Rectangle with the size and position of the element + // FIX ME: what about borders? + var pos = getElementPosition(elem); + var size = getElementSize(elem); + return new Rectangle(pos.x, pos.y, size.width, size.height); +} + +function moveElement(elem, rect) { + // moves and sizes the element + if (elem.style) { + if (defined(rect.x)) { + elem.style.left = Math.round(rect.x) + "px"; + elem.style.top = Math.round(rect.y) + "px"; + } + if (defined(rect.width)) { + elem.style.width = Math.round(rect.width) + "px"; + elem.style.height = Math.round(rect.height) + "px"; + } + } else if (document.layers) { + if (defined(rect.x)) { + elem.pageX = getInt(rect.x); + elem.pageY = getInt(rect.y); + } + if (defined(rect.width)) { + elem.clip.width = getInt(rect.width); + elem.clip.height = getInt(rect.height); + } + } else { + alert("moveElement(): element has no style or layer property!"); + return false; + } + return true; +} + +function showElement(elem, show) { + // shows or hides the element + if (elem.style) + elem.style.visibility = show ? "visible" : "hidden"; + else if (defined(elem.visibility)) + elem.visibility = show ? "show" : "hide"; + else + alert("showElement(): element has no style or layer property!"); + return true; +} + +function evtPosition(evt) { + // returns the on-screen Position of the Event + var x; + var y; + evt = (evt) ? evt : window.event; + if (!evt) { + alert("no event found! " + evt); + return; + } + if (defined(evt.pageX)) { + x = parseInt(evt.pageX); + y = parseInt(evt.pageY); + } else if (defined(evt.clientX)) { + x = parseInt(document.body.scrollLeft + evt.clientX); + y = parseInt(document.body.scrollTop + evt.clientY); + } else { + alert("evtPosition(): don't know how to deal with " + evt); + } + return new Position(x, y); +} + +function registerEvent(type, elem, handler) { + // register the given event handler on the indicated element + if (elem.addEventListener) { + elem.addEventListener(type, handler, false); // bubble + } + else if (elem.attachEvent) { + elem.attachEvent("on" + type, handler); + } + else if (elem.captureEvents) { + if (Event) { + t = type.toUpperCase(); + elem.captureEvents(Event[t]); + elem[ "on" + type ] = handler; + } + } + else { + alert("Could not register event of type " + type); + return false; + } + return true; + } + +function unregisterEvent(type, elem, handler) { + // unregister the given event handler from the indicated element + if (elem.removeEventListener) { + elem.removeEventListener(type, handler, false); + } + else if (elem.detachEvent) { + elem.detachEvent("on" + type, handler); + } + else if (elem.releaseEvents) { + if (Event) { + t = type.toUpperCase(); + elem.releaseEvents(Event[t]); + elem[ "on" + type ] = null; + } + } + else { + alert("Could not register event of type " + type); + return false; + } + return true; +} + +function registerEventById(type, id, handler) { + registerEvent(type, getElement(id), handler); + } + +function unregisterEventById(type, id, handler) { + unregisterEvent(type, getElement(id), handler); + } + +function stopEvent(e) { + if (!e) var e = window.event; + e.cancelBubble = true; + if (e.stopPropagation) e.stopPropagation(); + return false; +} + +function getEventSrc(e) { + if (e.target) return e.target; + if (e.srcElement) return e.srcElement; +} + +// old registerXXYY API for compatibility +function registerMouseDown(elem, handler) { + return registerEvent("mousedown", elem, handler); +} +function unregisterMouseDown(elem, handler) { + return unregisterEvent("mousedown", elem, handler); +} +function registerMouseMove(elem, handler) { + return registerEvent("mousemove", elem, handler); +} +function unregisterMouseMove(elem, handler) { + return unregisterEvent("mousemove", elem, handler); +} +function registerKeyDown(handler) { + return registerEvent("keypress", elem, handler); +} + + +function getWinSize() { + // returns a Size with the current window size (mostly from www.quirksmode.org) + var wsize = new Size(100, 100); + if (defined(self.innerHeight)) { + // all except Explorer + if ((self.innerWidth == 0)||(self.innerHeight == 0)) { + // Safari 1.2 (and other) bug + if (parent) { + wsize.height = parent.innerHeight; + wsize.width = parent.innerWidth; + } + } else { + wsize.width = self.innerWidth; + wsize.height = self.innerHeight; + } + } else if (document.documentElement && document.documentElement.clientHeight) { + // Explorer 6 Strict Mode + wsize.width = document.documentElement.clientWidth; + wsize.height = document.documentElement.clientHeight; + } else if (document.body) { + // other Explorers + wsize.width = document.body.clientWidth; + wsize.height = document.body.clientHeight; + } + return wsize; +} + +function getWinRect() { + var size = getWinSize(); + return new Rectangle(0, 0, size.width, size.height); +} + +function openWin(url, name, params) { + // open browser window + var ow = window.open(url, name, params); + ow.focus(); +} + +/* ********************************************** + * cookie class + * ******************************************** */ + +function Cookie() { + return this.read(); +} + +Cookie.prototype.read = function() { + var s = document.cookie; + var lines = s.split("; "); // semicolon and space for all browsers? + for (var i in lines) { + var line = lines[i]; + var sep = line.indexOf("="); + if (sep != -1) this.add( + line.substr(0, sep), + line.substr(sep + 1) + ); + } + return this; +} + +Cookie.prototype.store = function() { + var lines = new Array(); + for (var i in this) { + var item = this[i]; + if (typeof(item) == typeof(lines)) // Array + lines.push(i + "=" + item.join(",")); + else if (typeof(item) != "function") // single item + lines.push(i + "=" + item); + } + // var s = lines.join(";") + for (line in lines) document.cookie = lines[line]; + return this; + } + +Cookie.prototype.add = function(key, value) { + value = value.toString(); + if (value.indexOf(",") == -1) + this[key] = value; // single value + else + this[key] = value.split(","); // list of values + return this[key]; + } + +Cookie.prototype.get = function(key) { + return this[key]; + } + +Cookie.prototype.addbool = function(key, value) { + this[key] = Boolean(value).toString(); + return this[key]; + } + +Cookie.prototype.getbool = function(key) { + var val = this[key]; + return (val > "") && (val != "0") && (val != "false"); + } + +Cookie.prototype.remove = function(key) { + delete this[key]; + } + +function Slider(id, valMin, valMax, valStart, stepSize, onChange) { + // a (horizontal) slider widget + this.id = id; + this.elem = getElement(id); + this.slider = getElement(id + "-slider"); // the slider handle + this.input = getElement(id + "-input", 1); // optional input field + this.bar = getElement(id + "-bar"); // the slider bar + this.barRect = getElementRect(this.bar); + this.sliderRect = getElementRect(this.slider); + this.xMin = this.barRect.x; + this.xMax = this.xMin + this.barRect.width; + this.xDiff = this.xMax - this.xMin; + this.Y = this.barRect.getCenter().y; // middle axis of bar + this.valMin = valMin; + this.valMax = valMax; + this.valDiff = Math.abs(valMax - valMin); + this.valStart = valStart; + this.value = valStart; + this.stepSize = stepSize; + this.valueLabel = getElement(id + "-value", 1); + this.valMinLabel = getElement(id + "-valmin", 1); + this.valMaxLabel = getElement(id + "-valmax", 1); + this.onChange = onChange ? onChange : function() {}; + this.update(); + this.activate(); + sliders[id + '-slider'] = this; // make a handle to the object + return this; + } + +Slider.prototype.show = function(show) { + showElement(this.elem, show); + this.activate(); + } + +Slider.prototype.activate = function() { + this.setupEvents(); + } + +Slider.prototype.deactivate = function() { + unregisterEvent("mousedown", this.slider, this.onDragStart); + } + +Slider.prototype.reset = function() { + this.setValue(this.startVal); + } + +Slider.prototype.setValue = function(newVal) { + // sets slider to new value and updates + this.value = newVal; + this.update(); + } + +Slider.prototype.calcValue = function() { + // calculates value from slider position + var xSlider = this.sliderRect.getCenter().x - this.xMin; + this.value = xSlider * this.valDiff / this.xDiff; + return this.value; + } + +Slider.prototype.update = function() { + // updates slider position to new value + var xSlider = this.value * this.xDiff / this.valDiff; + moveElement(this.slider, this.sliderRect.setCenter( + new Position(xSlider + this.xMin, this.Y))); + var strVal = this.value.toString(); + if (this.valueLabel) this.valueLabel.innerHTML = strVal; + if (this.input) this.input.value = strVal; + } + +Slider.prototype.setupEvents = function() { + // installs all event callbacks + registerEvent("mousedown", this.slider, this.onDragStart); + } + +Slider.prototype.onDragStart = function(evt) { + var slider = sliders[this.id]; + activeSlider = slider; + unregisterEvent("mousedown", slider.slider, slider.onDragStart); + registerEvent("mousemove", document, slider.onDrag); + registerEvent("mouseup", document, slider.onDragEnd); + slider.startPos = evtPosition(evt); + slider.startX = slider.sliderRect.getCenter().x; + return stopEvent(evt); + } + +Slider.prototype.onDrag = function(evt) { + var slider = activeSlider; + var pos = evtPosition(evt); + var currX = slider.slider + var newX = pos.x - slider.startPos + slider.startX; + if (newX < slider.xMin) newX = slider.xMin; + if (newX > slider.xMax) newX = slider.xMax; + moveElement(slider.slider, slider.sliderRect.setCenter( + new Position(newX, slider.Y))); + return stopEvent(evt); + } + +Slider.prototype.onDragEnd = function(evt) { + var slider = activeSlider; + unregisterEvent("mousemove", document, slider.onDrag); + unregisterEvent("mouseup", document, slider.onDragEnd); + slider.onChange(slider.calcValue()); + activeSlider = null; + return stopEvent(evt); + } + +Slider.prototype.onInputChange = function() { + var slider = activeSlider; + slider.onChange(s.value); + } + +// :tabSize=4:indentSize=4:noTabs=true: + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/bg.png Binary file client/digitallibrary/greyskin/bg.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/bg.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/bg.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,63 @@ + + + + + + + + + image/svg+xml + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/birds-eye.png Binary file client/digitallibrary/greyskin/birds-eye.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/birds-eye.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/birds-eye.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/blue.png Binary file client/digitallibrary/greyskin/blue.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/brightness-on.png Binary file client/digitallibrary/greyskin/brightness-on.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/brightness-on.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/brightness-on.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/brightness.png Binary file client/digitallibrary/greyskin/brightness.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/brightness.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/brightness.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/calibration-x.png Binary file client/digitallibrary/greyskin/calibration-x.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/calibration-x.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/calibration-x.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/calibration-y.png Binary file client/digitallibrary/greyskin/calibration-y.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/calibration-y.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/calibration-y.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/cat.png Binary file client/digitallibrary/greyskin/cat.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/cat.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/cat.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/contrast-on.png Binary file client/digitallibrary/greyskin/contrast-on.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/contrast-on.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/contrast-on.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/contrast.png Binary file client/digitallibrary/greyskin/contrast.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/contrast.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/contrast.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/corona.png Binary file client/digitallibrary/greyskin/corona.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/corona.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/corona.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,214 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/debug.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/debug.js Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,111 @@ +var Debug = null; +var _now = {}; + +function element(name, content) { + var E = document.createElement(name); + if (content) { + if (content.nodeType) // it's a node + E.appendChild(content) + else // it's text + E.appendChild(document.createTextNode(content)) + }; + return E; + } + +function appendElement(node, name, content) { + if (node == null || ! node.appendChild) + return node; + return node.appendChild(element(name,content)); + } + +function getDebug() { + if (Debug == null) { + Debug = document.getElementById('debug'); + if (Debug == null) { + Debug = appendElement(document.body, 'div'); + Debug.setAttribute('class', 'debug'); + Debug.setAttribute('id', 'debug'); + Debug.innerhtml = '

Debug

'; + }; + }; + return Debug; + } + +function debug() { + var D = getDebug(); + // return alertObject(D); + var msg = ""; + for (var i = 0; i -1; + var A = new Array(); + for (var prop in obj) A.push(prop); + A.sort(); + var D = getDebug(); + var T = appendElement(D, "table"); + for (var i = 0; i < A.length; i++) { + var key = A[i]; + var value = obj[key]; + var type = typeof(value); + // exclude specified types + if (exclude.indexOf(type) > -1) + continue; + // exclude uppercase-only properties (= constants) + if (noConst && key.search(/^[A-Z0-9_]+$/) > -1) + continue; + var TR = appendElement(T, "tr"); + appendElement(TR, "td", element("b", key)); + appendElement(TR, "td", type); + appendElement(TR, "td", value + ""); + if (type == "function") + appendElement(TR, "td", value.toSource()); + }; + } + +function strObject(obj) { + var res = ""; + var A = new Array(); + try { + for (var i in obj) A[i] = typeof(obj[i]); + } + catch(e) { typ = "unknown" }; + var count = 0; + for (var item in A) { + count++; + typ = A[item]; + res += item + " (" + typ + "): "; + if (typ != "function") res += obj[item]; + res += "\t"; + if (count % 4 == 0) + res += "\n"; + } + return res; + } + +function alertObject(obj) { + return alert(strObject(obj)); + } + +function alertHTML(obj) { + if (obj) + return alert(obj.tagName + ".innerHTML:\n" + obj.innerHTML); + } + +function serialize(xmlobject) { + return (new XMLSerializer()).serializeToString(xmlobject); + } + +function startTime(s) { + _now[s] = new Date(); + } + +function elapsedTime(s) { + var diff = new Date(new Date - _now[s]); + debug(s + ": " + diff.getSeconds() + "." + diff.getMilliseconds() + " sec."); + } + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/delmark.png Binary file client/digitallibrary/greyskin/delmark.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/delmark.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/delmark.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + 1 + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/digimage-neu.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/digimage-neu.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,443 @@ +<%@ page language="java" %><%! +// -- JSP init ------------- + +// 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); + } +} +// -- end of JSP init ------------- +%><% +// -- JSP request ------------- + +// parsing the query +// ----------------- +digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); +docBean.setRequest(dlRequest); +// check if authentication is needed and redirect if necessary +docBean.doAuthentication(response); +// add number of pages +dlRequest.setValue("pt", docBean.getNumPages()); +// store objects for jsp:include +pageContext.setAttribute("docBean", docBean, pageContext.REQUEST_SCOPE); +%> + + Digital Document Library NG + + + + + + + + + + + + + + +
+ <% if (dlRequest.hasOption("clop", "noarrows")) { + %><% + } else { + %><% + } + %> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/digimage.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/digimage.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,459 @@ +<%@ page language="java" %><%! + // -- JSP init ------------- + + // 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); + } + } + // -- end of JSP init ------------- +%> + +<% + // -- JSP request ------------- + + // parsing the query + // ----------------- + digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); + docBean.setRequest(dlRequest); + // check if authentication is needed and redirect if necessary + docBean.doAuthentication(response); + // add number of pages + dlRequest.setValue("pt", docBean.getNumPages()); + // store objects for jsp:include + pageContext.setAttribute("docBean", docBean, pageContext.REQUEST_SCOPE); +%> + + + + + Digital Document Library NG + + + + + + + + + + + + +
+
+ +
+
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/digimage_img_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/digimage_img_inc.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,25 @@ +<%@ page language="java" %><% +// retrieve objects from context +digilib.servlet.DocumentBean docBean = (digilib.servlet.DocumentBean) pageContext.getAttribute("docBean", pageContext.REQUEST_SCOPE); +digilib.servlet.DigilibRequest dlRequest = docBean.getRequest(); +String ua = request.getHeader("User-Agent"); +boolean isN4 = ((ua.indexOf("Mozilla/4.") > -1)&&(ua.indexOf("MSIE") == -1)); +%> +<% + if (isN4) { +%><% + } else { +%>
<% + } +%> + +<% + if (isN4) { +%><% + } else { +%>
<% + } +%> diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/digimage_tbl_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/digimage_tbl_inc.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,61 @@ +<%@ page language="java" %><% +// retrieve objects from context +digilib.servlet.DocumentBean docBean = (digilib.servlet.DocumentBean) pageContext.getAttribute("docBean", pageContext.REQUEST_SCOPE); +digilib.servlet.DigilibRequest dlRequest = docBean.getRequest(); +String ua = request.getHeader("User-Agent"); +boolean isN4 = ((ua.indexOf("Mozilla/4.") > -1)&&(ua.indexOf("MSIE") == -1)); +%> + + + + + + + + + + + + + + + + +
<% + if (docBean.canMoveUp()) { + %><% + } + %>
<% + if (docBean.canMoveLeft()) { + %><% + } + %> +<% + if(isN4) { + %><% + } else { + %>
<% + } +%> + +<% + if(isN4) { + %><% + } else { + %>
<% + } +%> +
<% + if (docBean.canMoveRight()) { + %><% + } + %>
<% + if (docBean.canMoveDown()) { + %><% + } + %>
diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/diginew.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/diginew.css Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,276 @@ +/* Styles for Digilib NG */ +/* (c) 2005 by Martin Raspe */ +/* Bibliotheca Hertziana (Max-Planck-Institute for Art History), Rome */ + +body { + background-color: #E0E0E0; + color: black; + font-size: 8pt; + margin-left: 8px; + margin-top: 8px; + padding: 0px; + } + +code { + font-family: monospace; + color: blue; + } + +pre { color: #006060; } + + +a.icon { + margin: 0px; + padding: 0px; + } + +a.arrow { + display: block; + position: absolute; + border: none; + z-index: 50; + background-repeat: no-repeat; + background-position: center; + } + +a#up:hover { + background-image: url('up.png'); + } + +a#down:hover { + background-image: url('down.png'); + } + +a#left:hover { + background-image: url('left.png'); + } + +a#right:hover { + background-image: url('right.png'); + } + +/* Images */ + +img.logo { + border: none; + } + +img.png { + border: none; + } + +img.png:hover { + background-image: url('corona.png'); + } + +img#bird-image { + border: none; + position: fixed; + bottom: 8px; + right: 48px; + visibility: hidden; + z-index: 1; + } + +/* DIVs */ + +div.button { + padding: 0px; + } + +div.separator { + margin-bottom: 4px; + border-top: 2px solid lightgrey; + } + +div.mark { + position: absolute; + color: white; + background: url('mark-bg-16.png'); + font-family: Verdana, Arial, Helvetica, sans-serif; + font-weight: bold; + font-size:11px; + height: 15px; + width: 16px; + padding-top: 1px; + text-align: center; + z-index: 10; + visibility: hidden; + /* filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='mark-bg-16.png') */ + } + +div#bg { + position: absolute; + background-color: grey; + background-repeat:no-repeat; + cursor: move; + visibility: hidden; +} + +div#scaler { + margin-right: 50px; + /* position: absolute; + left: 8px; + top: 8px; + bottom: 8px; + right: 44px; +*/ /* overflow: auto; */ + } + +div#scaler img { + cursor: default; +} + +div#overlay, div#bird-overlay { + position: fixed; + background-color: transparent; + border: none; + z-index: 100; + visibility: hidden; + /* box-sizing: border-box; + -moz-box-sizing: border-box; */ + } + +div#buttons { + position: fixed; + right: 5px; + top: 5px; + padding: 3px; +/* background-color: #E0E0E0; */ + background-color: lightgrey; + } + +div#dloptions { + position: fixed; + right: 5px; + top: 5px; + padding: 3px; +/* background-color: #E0E0E0; */ + background-color: lightgrey; + visibility: hidden; + } + +div#zoom { + position: absolute; + /* border: 2px solid #ffa060; */ + border: 2px solid #ff0000; + z-index: 200; + visibility: hidden; + /* box-sizing: border-box; + -moz-box-sizing: border-box; */ + } + +div#bird-area { + position: fixed; + /* border: 2px solid #ffa060; */ + border: 2px solid #ff0000; + background-color: transparent; + /* box-sizing: border-box; + -moz-box-sizing: border-box; */ + z-index: 10; + visibility: hidden; + } + +div#calibration { + background: url('blue.png'); + position: absolute; + top: 0px; + width: 400px; + padding: 0px; + visibility: hidden; + z-index: 1000; + } + +div#calibration div { + width: 100%; + height: 100%; + margin: 0px; + padding: 0px; + font-family: Verdana, Arial, Helvetica, sans-serif; + text-align: center; + color: lightcyan; + border: 1px solid lightcyan; + background: url('ruler-top.gif') 0px -1px repeat-x; + z-index: 1001; + } + +p.cm { + font-weight: bold; + } + +div.popup-menu { + position: absolute; + top: 0px; + padding: 0px 2px; + font-family: Verdana, Arial, Helvetica, sans-serif; + border: 2px solid lightcyan; + background-color: lightgrey; + text-align: center; + visibility: hidden; + z-index: 1005; + } + +div.popup-menu p { + margin: 2px 0px; + padding: 0px; + } + +div.popup-menu p:hover { + background-color: #ffa060; + } + +div.popup-menu a { + text-decoration: none; + color: black; + } + +div#about { + position: absolute; + width: 200px; + top: 100px; + left: 350px; + height: 200px; + padding: 0px 2px; + font-family: Verdana, Arial, Helvetica, sans-serif; + border: 2px solid lightcyan; + background-color: lightgrey; + text-align: center; + visibility: hidden; + z-index: 1000; + } + +div#about p { + margin: 6px; + } + + +/* DEBUG elements */ + +div#debug { + position: absolute; + width: 150px; + top: 50px; + right: 36px; + bottom: 50px; + overflow: auto; + padding: 0px 2px; + font-family: Verdana, Arial, Helvetica, sans-serif; + color: lightgreen; + border: 1px dotted black; + background-color: transparent; + visibility: hidden; + } + +div#debug p.debug, h1 { + font-weight: bold; + color: lightcyan; + } + +div#debug p, h1 { + margin: 0px; + padding: 2px 0px; + font-size: 9px; + background-color: black; + } + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/diginew.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/diginew.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,618 @@ + +<%@ page language="java" pageEncoding="UTF-8"%><%! + // -- JSP init ------------- + + // 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); + } + } + // -- end of JSP init ------------- +%><% + // -- JSP request ------------- + + // parsing the query + // ----------------- + digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); + docBean.setRequest(dlRequest); + // check if authentication is needed and redirect if necessary + docBean.doAuthentication(response); + // add number of pages + dlRequest.setValue("pt", docBean.getNumPages()); + // store objects for jsp:include + pageContext.setAttribute("docBean", docBean, pageContext.REQUEST_SCOPE); + +%> + + + Digital Document Library NG + + + + + + + + + + + + + + + +
+ +
+ +
+ + +
+
+ + +
+ + + + + +
+ + + + + + + + +
+

Digilib Graphic Viewer

+ + + +

+

+

+

+
+ + +
+
+

measure the length of this scale on your screen

+
+
+ + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+ +
+ +

Debug

+ + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/dlMenu.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/dlMenu.html Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,175 @@ + + + + + + + + + + +
+
+
+

+
+

+
+
+
+

+

+

+ + + + + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/dllib.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/dllib.js Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,1045 @@ +/* Copyright (C) 2003,2004 IT-Group MPIWG, WTWG Uni Bern and others + +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 + +Authors: + Christian Luginbuehl, 01.05.2003 (first version) + DW 24.03.2004 (Changed for digiLib in Zope) + Robert Casties, 8.11.2005 + Martin Raspe , 12.12.2005 + Robert Casties, 4.9.2009 + + ! Requires baselib.js ! +*/ +digilibVersion = "Digilib NG"; +dllibVersion = "2.042"; + +function identify() { + // used for identifying a digilib instance + // Relato uses that function - lugi + return digilibVersion; +} + +function createMarkDiv(index) { + var div = document.createElement("div"); + div.className = "mark"; + div.id = "mark" + index; + div.innerHTML = index + 1; + document.body.appendChild(div); + return div; +} + +function bestPicSize(elem, inset) { + // returns a Size with the best image size for the given element + if (! defined(inset)) { + inset = 0; + // original value was 25 + // digilib seems to use the available space better without inset + } + var ws = getWinSize(); + var es = getElementPosition(elem); + if (es) { + ws.width = ws.width - es.x - inset; + ws.height = ws.height - es.y - inset; + } + return ws; +} + + +/**************************************************** + * digilib specific classes (must be defined first) + ****************************************************/ + +/* + * Marks class + */ +function Marks() { + return this; +} +// Marks inherits from Array +Marks.prototype = new Array(); +Marks.prototype.parse = function(query) { + this.length = 0; + if (query.indexOf(";") >= 0) { + var pa = query.split(";"); // old format with ";" + } else { + var pa = query.split(","); // new format + } + for (var i = 0; i < pa.length ; i++) { + var pos = pa[i].split("/"); + if (pos.length > 1) this.push(new Position(pos[0], pos[1])); + } +} +Marks.prototype.getAll = function() { + var ma = new Array(); + for (var i = 0; i < this.length; i++) { + ma.push(cropFloat(this[i].x) + "/" + cropFloat(this[i].y)); + } + return ma.join(","); +} +Marks.prototype.addEvent = function(evt, digilib) { + // add a mark from a screen event + if (!digilib) digilib = dl; + var pos = digilib.trafo.invtransform(evtPosition(evt)); + this.push(pos); +} + +/* + * DLParameters -- digilib parameter class + */ +function DLParameters() { + // flags for parameter sets + this.PARAM_FILE = 1; + this.PARAM_MODE = 2; + this.PARAM_DIM = 4; + this.PARAM_IMAGE = 8; + this.PARAM_DPI = 16; + this.PARAM_SIZE = 32; + this.PARAM_MARK = 64; + this.PARAM_PAGES = 128; + this.PARAM_CLIENT = 256; + /* request parameters */ + with (this) { + // file + define('fn', '', PARAM_FILE); + define('pn', '1', PARAM_FILE); + // mode + define('mo', '', PARAM_MODE); + // relative dimensions of zoomed image + define('wx', '0.0', PARAM_DIM); + define('wy', '0.0', PARAM_DIM); + define('ww', '1.0', PARAM_DIM); + define('wh', '1.0', PARAM_DIM); + // image manipulation + define('brgt', '0.0', PARAM_IMAGE); + define('cont', '0.0', PARAM_IMAGE); + define('rot', '0.0', PARAM_IMAGE); + define('rgba', '', PARAM_IMAGE); + define('rgbm', '', PARAM_IMAGE); + // resolution + define('ddpi', '', PARAM_DPI); + define('ddpix', '', PARAM_DPI); + define('ddpiy', '', PARAM_DPI); + // marks + define('mk', '', PARAM_MARK); + // pages total + define('pt', '0', PARAM_PAGES); + // size + define('ws', '1.0', PARAM_SIZE); + // client side options + define('clop', '', PARAM_CLIENT); + } + return this; +} +DLParameters.prototype = new Parameters(); +// move the inherited getAll because we need it later +DLParameters.prototype._getAll = Parameters.prototype.getAll; +DLParameters.prototype.getAll = function(paDetail, moDetail, digilib) { + if (!digilib) digilib = dl; + // get Flags and Marks first + var mo = digilib.flags.getAll(moDetail); + this.set("mo", mo); + var clop = digilib.opts.getAll(); + this.set("clop", clop); + var mk = digilib.marks.getAll(); + this.set("mk", mk); + var ret = this._getAll(paDetail); + return ret; +} + +/* + * DLModes -- digilib flags class + */ +function DLFlags() { + // flags for mode sets + this.MODE_QUAL = 1; + this.MODE_SIZE = 2; + this.MODE_MIR = 4; + this.MODE_OTHER = 128; + this.MODE_ALL = 255; + /* mode flags */ + with (this) { + define('q0', MODE_QUAL); + define('q1', MODE_QUAL); + define('q2', MODE_QUAL); + define('fit', MODE_SIZE); + define('clip', MODE_SIZE); + define('osize', MODE_SIZE); + define('vmir', MODE_MIR); + define('hmir', MODE_MIR); + } + return this; +} +// inherits from Flags +DLFlags.prototype = new Flags(); + + +/* + * Digilib -- digilib base class + */ +function Digilib() { + if (!baseLibVersion) alert("ERROR: baselib.js not loaded!"); + /* constants */ + this.MAX_AREA = new Rectangle(0.0, 0.0, 1.0, 1.0); + // default inset (for scalerImg relativ to scalerDiv + this.INSET = 40; // because of scrollbars of main window and scaler [Firefox bug?] + // mouse drag area that counts as one click + this.MIN_AREA_SIZE = 3 * 3 + 1; + // standard zoom factor + this.ZOOMFACTOR = Math.sqrt(2); + // bird's eye view dimensions + this.BIRD_MAXX = 200; + this.BIRD_MAXY = 200; + // witdh of arrow bars + this.ARROW_WIDTH = 32; + // width of calibration bar + this.CALIBRATION_WIDTH = 64; + /* variables */ + this.fitOnlyWidth = false; + this.fitOnlyHeight = false; + this.trafo = null; + // page elements + this.scalerDiv = null; + this.scalerImg = null; + this.buttons1Div = null; + this.buttons2Div = null; + /* parse parameters */ + this.params = new DLParameters(); + // put the query parameters (sans "?") in the parameters array + this.params.parse(location.search.slice(1)); + // treat special parameters + this.area = this.parseArea(); + this.marks = new Marks(); + this.marks.parse(this.params.get("mk")); + this.flags = new DLFlags(); + this.flags.parse(this.params.get("mo")); + this.opts = new Flags(); + this.opts.parse(this.params.get("clop")); + return this; +} +Digilib.prototype.setDLParam = function(e, s, relative) { + // sets parameter based on HTML event + var nam; + var val; + if (s.type && (s.type == "select-one")) { + nam = s.name; + val = s.options[s.selectedIndex].value; + } else if (s.name && s.value) { + nam = s.name; + val = s.value; + } + if (nam && val) { + dl.params.set(nam, val, relative); + display(); + } else { + alert("ERROR: unable to process event!"); + } + return true; +} +Digilib.prototype.parseArea = function() { + // returns area Rectangle from current parameters + return new Rectangle( + this.params.get("wx"), + this.params.get("wy"), + this.params.get("ww"), + this.params.get("wh")); +} +Digilib.prototype.setParamFromArea = function(rect) { + // sets digilib wx etc. from rect + this.params.set("wx", cropFloat(rect.x)); + this.params.set("wy", cropFloat(rect.y)); + this.params.set("ww", cropFloat(rect.width)); + this.params.set("wh", cropFloat(rect.height)); + return true; +} + +Digilib.prototype.parseTrafo = function(elem) { + // returns Transform from current dlArea and picsize + var picsize = getElementRect(elem); + var trafo = new Transform(); + // subtract area offset and size + trafo.concat(trafo.getTranslation(new Position(-this.area.x, -this.area.y))); + trafo.concat(trafo.getScale(new Size(1/this.area.width, 1/this.area.height))); + // scale to screen size + trafo.concat(trafo.getScale(picsize)); + trafo.concat(trafo.getTranslation(picsize)); + // FIX ME: Robert, kannst Du mal nachsehen, ob das folgende tut, was es soll? + // oder gibt es dafuer neuen Code? -- ROC: Bisher funktioniert es nicht! + // rotate + //var rot = getRotation(- dl.params.get("rot"), new Position(0.5*picsize.width, 0.5*picsize.height)); + //trafo.concat(rot); + // mirror + //if (hasFlag("hmir")) trafo.m00 = - trafo.m00; // ?? + //if (hasFlag("vmir")) trafo.m11 = - trafo.m11; // ?? + return trafo; +} + +Digilib.prototype.onLoad = function() { + // initialize digilib; called by body.onload + this.scalerDiv = getElement("scaler", true); + this.scalerImg = getElement("pic", true); + this.buttons1Div = getElement("buttons", true); + this.buttons2Div = getElement("options", true); + /* + * if (this.scalerImg == null && this.scalerDiv) { // in N4 pic is in the + * scaler layer this.scalerImg = this.scalerDiv.document.images[0]; } + */ + if ((!this.scalerImg)||(!this.scalerDiv)) { + alert("Sorry, digilib doesn't work here!"); + return false; + } + // fix fixed menus + var ms1 = getElementSize(this.buttons1Div); + var ms2 = getElementSize(this.buttons2Div); + var maxh = (ms1.height > ms2.height) ? ms1.height : ms2.height; + var wins = getWinSize(); + if ((wins.height <= maxh) || (browserType.isIE && (browserType.versIE < 7))) { + // unlock fixed menus to absolute if window is too small or IE + this.buttons1Div.style.position = "absolute"; + this.buttons2Div.style.position = "absolute"; + } + this.setScalerImage(); // setzt auch onImgLoad + this.setBirdImage(); // laedt das Bird's Eye Bild +} + +Digilib.prototype.setScalerImage = function() { + // set the scaler image source (needs the browser size) + var picsize = bestPicSize(this.scalerDiv); + var menusize = getElementSize(this.buttons1Div); + // subtract menu width + picsize.width -= menusize.width; + picsize.height -= this.INSET; + // compose Scaler URL + var src = "../servlet/Scaler?" + + this.params.getAll(this.params.PARAM_ALL & ~(this.params.PARAM_MARK | this.params.PARAM_PAGES)); + if (this.opts.get('fitwidth')) { + src += "&dw=" + picsize.width; + } else if (this.opts.get('fitheight')) { + src += "&dh=" + picsize.height; + } else { + src += "&dw=" + picsize.width + "&dh=" + picsize.height; + } + // debug(src); + this.scalerImg.onload = onImgLoad; + this.scalerImg.src = src; + + var digilib = this; + // this is a local callback function that can use the current scope + + function onImgLoad() { + if (! digilib) + return; + // make sure the image is loaded so we know its size + /* this test seems to have problems sometimes :-( + if (defined(digilib.scalerImg.complete) && !digilib.scalerImg.complete) { + alert("ERROR: the image seems not to be complete in onImgLoad!?"); + } */ + digilib.trafo = digilib.parseTrafo(digilib.scalerImg); + // display marks + digilib.renderMarks(); + digilib.showBirdDiv(isBirdDivVisible); + digilib.showArrows(); // show arrow overlays for zoom navigation + //digilib.moveCenter(true); // click to move point to center + // new Slider("sizes", 1, 5, 2); + + //Drag Image (8.9.2009) + if (!digilib.isFullArea()) + registerEvent("mousedown", digilib.scalerDiv, dragImage); + + focus(); + } +} + +Digilib.prototype.renderMarks = function() { + // make sure the image is loaded so we know its size + if (!this.trafo) { + alert("ERROR: trafo missing, cannot render marks!"); + return; + } + // debugProps(dlArea, "dlArea"); + for (var i = 0; i < this.marks.length; i++) { + var div = getElement("mark" + i, true) || createMarkDiv(i); + var mark = this.marks[i]; + // debugProps(mark, "mark"); + if (this.area.containsPosition(mark)) { + var mpos = this.trafo.transform(mark); + // debugProps(mark, "mpos"); + // better not hide the marked spot (MR) + // suboptimal to place -5 pixels and not half size of mark-image + // mpos.x = mpos.x -5; + // mpos.y = mpos.y -5; + moveElement(div, mpos); + showElement(div, true); + } else { + // hide the other marks + showElement(div, false); + } + } +} + +Digilib.prototype.display = function(detail, moDetail) { + // redisplay the page + var queryString = this.params.getAll(detail, moDetail); + location.href + = location.protocol + "//" + + location.host + + location.pathname + + "?" + queryString; +} + +/* ********************************************** + * interactive digilib functions + * ******************************************** */ + +Digilib.prototype.setMark = function() { + // add a mark where clicked + window.focus(); + this.moveCenter(false); + + // start event capturing + registerEvent("mousedown", this.scalerDiv, markEvent); + + // our own reference to this for the local function + var digilib = this; + + function markEvent(evt) { + // event handler adding a new mark + unregisterEvent("mousedown", digilib.scalerDiv, markEvent); + digilib.marks.addEvent(evt); + digilib.display(); + return stopEvent(evt); + } + +} + +Digilib.prototype.removeMark = function() { + // remove the last mark + this.marks.pop(); + this.display(); +} + +Digilib.prototype.resetImage = function() { + // reset the image to its original state + this.display(this.params.PARAM_FILE); // keep only fn/pn +} + +Digilib.prototype.dragImage = function(evt) { + // drag the image and load a new detail on mouse up + // makes sense only when zoomed + if (this.isFullArea()) + return; + if(evt.preventDefault) evt.preventDefault(); // no Firefox drag and drop + var digilib = this; // our own reference to this for the local function + var startPos = evtPosition(evt); + var pic = this.scalerImg; + var picRect = getElementRect(pic); + // fit the grey div to the scaler image + var div = getElement("bg"); + var dx = 0; + var dy = 0; + moveElement(div, picRect); + // hide the scaler image, show it as background of div instead + showElement(pic, false); + showElement(div, true); + div.style.backgroundImage = "url(" + pic.src + ")"; + div.style.cursor = "move"; + // start event capturing + registerEvent("mousemove", document, moveDragEvent); + registerEvent("mouseup", document, moveEndEvent); + window.focus(); + + function moveDragEvent(evt) { + // mousemove handler: drag + var pos = evtPosition(evt); + // don't use Firefox Drag and Drop feature + if(evt.preventDefault) evt.preventDefault(); + dx = pos.x - startPos.x; + dy = pos.y - startPos.y; + // move the background image to the new position + div.style.backgroundPosition = dx + "px " + dy + "px"; + return stopEvent(evt); + } + + function moveEndEvent(evt) { + // mouseup handler: reload digilib + div.style.cursor = "default"; + unregisterEvent("mousemove", document, moveDragEvent); + unregisterEvent("mouseup", document, moveEndEvent); + // calculate relative offset + var x = -dx / pic.width; + var y = -dy / pic.height; + stopEvent(evt); + if (dx == 0 && dy == 0) + return // no movement + // reload with scaler image showing the new ausschnitt + return digilib.moveBy(x, y); + } +} + +Digilib.prototype.zoomArea = function() { + var pt1, pt2; + var zoomdiv = getElement("zoom"); + var overlay = getElement("overlay"); + // use overlay div to avoid mousemove problems + var picRect = getElementRect(this.scalerImg); + // FIX ME: is there a way to query the border width from CSS info? + // rect.x -= 2; // account for overlay borders + // rect.y -= 2; + moveElement(overlay, picRect); + showElement(overlay, true); + // start event capturing + registerEvent("mousedown", overlay, zoomStart); + registerEvent("mousedown", this.scalerImg, zoomStart); + window.focus(); + + // our own reference to "this" for the local functions + var digilib = this; + + // mousedown handler: start moving + function zoomStart(evt) { + pt1 = evtPosition(evt); + unregisterEvent("mousedown", overlay, zoomStart); + unregisterEvent("mousedown", digilib.scalerImg, zoomStart); + // setup and show zoom div + moveElement(zoomdiv, Rectangle(pt1.x, pt1.y, 0, 0)); + showElement(zoomdiv, true); + // register events + registerEvent("mousemove", document, zoomMove); + registerEvent("mouseup", document, zoomEnd); + return stopEvent(evt); + } + + // mouseup handler: end moving + function zoomEnd(evt) { + pt2 = evtPosition(evt); + // assume a click if the area is too small (up to 3 x 3 pixel) + var clickRect = new Rectangle(pt1, pt2); + clickRect.normalize(); + if (clickRect.getArea() <= digilib.MIN_AREA_SIZE) { + return stopEvent(evt); + } + // hide zoom div + showElement(zoomdiv, false); + showElement(overlay, false); + // unregister events + unregisterEvent("mousemove", document, zoomMove); + unregisterEvent("mouseup", document, zoomEnd); + // clip and transform + clickRect.clipTo(picRect); + var area = digilib.trafo.invtransform(clickRect); + digilib.setParamFromArea(area); + // zoomed is always fit + digilib.params.set("ws", 1); + digilib.display(); + return stopEvent(evt); + } + + // mouse move handler + function zoomMove(evt) { + pt2 = evtPosition(evt); + var rect = new Rectangle(pt1, pt2); + rect.normalize(); + rect.clipTo(picRect); + // update zoom div + moveElement(zoomdiv, rect); + return stopEvent(evt); + } +} + +Digilib.prototype.zoomBy = function(factor) { + // zooms by the given factor + var newarea = this.area.copy(); + newarea.width /= factor; + newarea.height /= factor; + newarea.x -= 0.5 * (newarea.width - this.area.width); + newarea.y -= 0.5 * (newarea.height - this.area.height); + newarea = this.MAX_AREA.fit(newarea); + this.setParamFromArea(newarea); + this.display(); +} + + +Digilib.prototype.zoomFullpage = function(fit) { + // zooms out to show the whole image + this.params.set("wx", 0.0); + this.params.set("wy", 0.0); + this.params.set("ww", 1.0); + this.params.set("wh", 1.0); + if (fit == "width") { + this.opts.set('fitwidth'); + } else if (fit == "height") { + this.opts.set('fitheight'); + } else { + this.opts.reset('fitwidth'); + this.opts.reset('fitheight'); + } + this.display(); +} + + +Digilib.prototype.moveCenter = function(on) { + // move visible area so that it's centered around the clicked point + if (this.isFullArea()) return; // nothing to do + // starting event capture + if (on) registerEvent("mousedown", this.scalerImg, moveCenterEvent); + else unregisterEvent("mousedown", this.scalerImg, moveCenterEvent); + window.focus(); + + // our own reference to this for the local function + var digilib = this; + + function moveCenterEvent(evt) { + // move to handler + var pt = digilib.trafo.invtransform(evtPosition(evt)); + var newarea = digilib.area.copy(); + newarea.setCenter(pt); + newarea.stayInside(this.MAX_AREA); + // newarea = dlMaxArea.fit(newarea); + // debugProps(newarea, "newarea"); + // debugProps(dlArea, "dlArea"); + if (newarea.equals(digilib.area)) return; // keep event handler + unregisterEvent("mousedown", digilib.scalerImg, moveCenterEvent); + // set parameters + digilib.setParamFromArea(newarea); + digilib.display(); + } +} + +Digilib.prototype.isFullArea = function(area) { + if (!area) area = this.area; + return (area.width == 1.0) && (area.height == 1.0); +} + +Digilib.prototype.canMove = function(movx, movy) { + if (this.isFullArea()) return false; + var x2 = this.area.x + this.area.width; + var y2 = this.area.y + this.area.height; + // debugProps(dlArea); + return ((movx < 0) && (this.area.x > 0)) + || ((movx > 0) && (x2 < 1.0)) + || ((movy < 0) && (this.area.y > 0)) + || ((movy > 0) && (y2 < 1.0)) +} + +Digilib.prototype.moveBy = function(movx, movy) { + // move visible area by movx and movy (in units of ww, wh) + if (!this.canMove(movx, movy)) return; // nothing to do + var newarea = this.area.copy(); + newarea.x += parseFloat(movx)*this.area.width; + newarea.y += parseFloat(movy)*this.area.height; + newarea = this.MAX_AREA.fit(newarea); + // set parameters + this.setParamFromArea(newarea); + this.display(); +} + +Digilib.prototype.getRef = function(baseUrl) { + // returns a reference to the current digilib set + if (!baseUrl) baseUrl + = location.protocol + + "//" + + location.host + + location.pathname; + var hyperlinkRef = baseUrl; + with (this.params) { + // all without ddpi, pt + var ps = getAll(PARAM_ALL & ~(PARAM_DPI | PARAM_PAGES | PARAM_CLIENT)); + } + if (ps.length > 0) hyperlinkRef += "?" + ps; + return hyperlinkRef; +} + +Digilib.prototype.getRefWin = function(type, msg) { + // shows an alert with a reference to the current digilib set + if (! msg) msg = "URL reference to the current view"; + prompt(msg, this.getRef()); +} + +Digilib.prototype.getQuality = function() { + // returns the current q setting + for (var i = 0; i < 3; i++) { + if (this.flags.get("q"+i)) return i; + } + return 1 +} + +Digilib.prototype.setQuality = function(qual) { + // set the image quality + if ((qual < 0)||(qual > 2)) return alert("Quality setting not supported"); + for (var i = 0; i < 3; i++) this.flags.reset("q" + i); + this.flags.set("q" + qual); + this.display(); +} + +Digilib.prototype.setQualityWin = function(msg) { + // dialog for setting quality + if (! msg) msg = "Quality (0..2)"; + var q = this.getQuality(); + var newq = window.prompt(msg, q); + if (newq) this.setQuality(newq); +} + +Digilib.prototype.mirror = function(dir) { + // mirror the image horizontally or vertically + if (dir == "h") { + this.flags.toggle("hmir"); + } else { + this.flags.toggle("vmir"); + } + this.display(); +} + +Digilib.prototype.gotoPage = function(gopage, keep) { + // goto given page nr (+/-: relative) + var oldpn = parseInt(this.params.get("pn")); + // set with relative=true uses the sign + this.params.set("pn", gopage, true); + // now check the outcome + var pn = parseInt(this.params.get("pn")); + if (pn < 1) { + alert("No such page! (Page number too low)"); + this.params.set("pn", oldpn); + return; + } + if (this.params.isSet("pt")) { + pt = parseInt(this.params.get("pt")) + if (pn > pt) { + alert("No such page! (Page number too high)"); + this.params.set("pn", oldpn); + return; + } + } + if (keep) { + this.display(this.params.PARAM_ALL & ~this.params.PARAM_MARK); // all, no mark + } else { + this.display(this.params.PARAM_FILE | this.params.PARAM_MODE | this.params.PARAM_PAGES, this.params.MODE_QUAL | this.params.MODE_OTHER); // fn, pn, ws, mo + pt + } +} + +Digilib.prototype.gotoPageWin = function() { + // dialog to ask for new page nr + var pn = this.params.get("pn"); + var gopage = window.prompt("Go to page", pn); + if (gopage) this.gotoPage(gopage); +} + +Digilib.prototype.setParamWin = function(param, text, relative) { + // dialog to ask for new parameter value + var val = this.params.get(param); + var newval = window.prompt(text, val); + if (newval) { + this.params.set(param, newval, relative); + this.display(); + } +} + +Digilib.prototype.showOptions = function(show) { + // show or hide option div + var elem = getElement("dloptions"); + showElement(elem, show); + // FIX ME: get rid of the dotted line around the buttons when focused + } + +Digilib.prototype.showAboutDiv = function(show) { + // show or hide "about" div + var elem = getElement("about"); + if (elem == null) { + if (show) alert("About Digilib - dialog missing in HTML code!" + + "\nDigilib Version: " + digilibVersion + + "\JSP Version: " + jspVersion + + "\ndlLib Version: " + dllibVersion + + "\nbaseLib Version: " + baseLibVersion); + return; + } + if (show) { + getElement("digilib-version").innerHTML = "Digilib Version: " + digilibVersion; + getElement("jsp-version").innerHTML = "JSP Version: " + jspVersion; + getElement("baselib-version").innerHTML = "baseLib Version: " + baseLibVersion; + getElement("dllib-version").innerHTML = "dlLib Version: " + dllibVersion; + var aboutRect = getElementRect(elem); + aboutRect.setCenter(getWinRect().getCenter()); + moveElement(elem, aboutRect); + } + showElement(elem, show); + } + +Digilib.prototype.setBirdImage = function() { + var img = getElement("bird-image"); + var src = "../servlet/Scaler?" + + this.params.getAll(this.params.PARAM_FILE) + + "&dw=" + this.BIRD_MAXX + + "&dh=" + this.BIRD_MAXY; + img.src = src; +} + +Digilib.prototype.showBirdDiv = function(show) { + // show or hide "bird's eye" div + var startPos; // anchor for dragging + var newRect; // position after drag + var birdImg = getElement("bird-image"); + var birdArea = getElement("bird-area"); + var overlay = getElement("bird-overlay"); + showElement(birdImg, show); + // dont show selector if area has full size + if (!show || this.isFullArea()) { + // hide area + showElement(birdArea, false); + showElement(overlay, false); + return; + }; + var birdImgRect = getElementRect(birdImg); + var area = this.area; + if (this.flags.get("osize") || this.flags.get("clip")) { + // in original-size and pixel-by-pixel mode the area size is not valid + var birdAreaRect = new Rectangle( + birdImgRect.x + birdImgRect.width * area.x, + birdImgRect.y + birdImgRect.height * area.y, + 5, + 5); + } else { + // scale area down to img size + var birdAreaRect = new Rectangle( + // what about borders ?? + birdImgRect.x + birdImgRect.width * area.x, + birdImgRect.y + birdImgRect.height * area.y, + birdImgRect.width * area.width, + birdImgRect.height * area.height); + } + moveElement(birdArea, birdAreaRect); + showElement(birdArea, true); + moveElement(overlay, birdImgRect); + showElement(overlay, true); + registerEvent("mousedown", overlay, birdAreaStartDrag); + registerEvent("mousedown", birdImg, birdAreaStartDrag); + + // our own reference to this for local functions + var digilib = this; + + function birdAreaStartDrag(evt) { + // mousedown handler: start drag + startPos = evtPosition(evt); + unregisterEvent("mousedown", overlay, birdAreaStartDrag); + unregisterEvent("mousedown", birdImg, birdAreaStartDrag); + registerEvent("mousemove", document, birdAreaMove); + registerEvent("mouseup", document, birdAreaEndDrag); + // debugProps(getElementRect(bird)) + return stopEvent(evt); + } + + function birdAreaMove(evt) { + // mousemove handler: drag + var pos = evtPosition(evt); + var dx = pos.x - startPos.x; + var dy = pos.y - startPos.y; + // move birdArea div, keeping size + newRect = new Rectangle( + birdAreaRect.x + dx, + birdAreaRect.y + dy, + birdAreaRect.width, + birdAreaRect.height); + // stay within image + newRect.stayInside(birdImgRect); + moveElement(birdArea, newRect); + showElement(birdArea, true); + return stopEvent(evt); + } + + function birdAreaEndDrag(evt) { + // mouseup handler: reload page + unregisterEvent("mousemove", document, birdAreaMove); + unregisterEvent("mouseup", document, birdAreaEndDrag); + showElement(overlay, false); + if (newRect == null) { // no movement happened + startPos = birdAreaRect.getCenter(); + birdAreaMove(evt); // set center to click position + } + digilib.params.set("wx", cropFloat((newRect.x - birdImgRect.x) / birdImgRect.width)); + digilib.params.set("wy", cropFloat((newRect.y - birdImgRect.y) / birdImgRect.height)); + // zoomed is always fit + digilib.params.set("ws", 1); + digilib.display(); + return stopEvent(evt); + } +} + +Digilib.prototype.showArrow = function(name, rect, show) { + var arrow = getElement(name); + moveElement(arrow, rect); + showElement(arrow, show); +} + +Digilib.prototype.showArrows = function() { + // show the 4 arrow bars on top of scaler img according to current dlArea + var r = getElementRect(this.scalerImg); + this.showArrow('up', + new Rectangle(r.x, r.y, r.width, this.ARROW_WIDTH), + this.canMove(0, -1) + ); + this.showArrow('down', + new Rectangle(r.x, r.y + r.height - this.ARROW_WIDTH, r.width, this.ARROW_WIDTH), + this.canMove(0, 1) + ); + this.showArrow('left', + new Rectangle(r.x, r.y, this.ARROW_WIDTH, r.height), + this.canMove(-1, 0) + ); + this.showArrow('right', + new Rectangle(r.x + r.width - this.ARROW_WIDTH, r.y, this.ARROW_WIDTH, r.height), + this.canMove(1, 0) + ); + } + +Digilib.prototype.calibrate = function() { + // calibrate screen resolution + var calDiv = getElement("calibration"); + var calRect = getElementRect(calDiv); + moveCenter(false); + var wins = getWinSize(); + calRect.setCenter(new Position(wins.width / 2, wins.height / 2)); + moveElement(calDiv, calRect); + showElement(calDiv, true); + var cm = window.prompt("The length of the scale on your screen in centimeter:"); + if (cm) { + var dpi = calRect.width / parseFloat(cm) * 2.54; + this.params.set("ddpi", cropFloat(dpi)); + } + showElement(calDiv, false); +} + + +Digilib.prototype.setScale = function(scale) { + // sets original-size, pixel-by-pixel or fit-to-screen scale type + if (scale == "pixel") { + // pixel by pixel + this.flags.set("clip"); + this.flags.reset("osize"); + this.flags.reset("fit"); + } else if (scale == "original") { + // original size -- needs calibrated screen + if (!this.params.isSet("ddpi")) { + var dpi = cookie.get("ddpi"); + if (dpi == null) { + alert("Your screen has not yet been calibrated - using default value of 72 dpi"); + dpi = 72; + } + this.params.set("ddpi", dpi); + } + this.flags.set("osize"); + this.flags.reset("clip"); + this.flags.reset("fit"); + } else { + // scale to screen size (default) + this.flags.reset("clip"); + this.flags.reset("osize"); + } + this.display(); +} + +Digilib.prototype.getScale = function() { + // returns scale type + if (this.flags.get("clip")) { + return "pixel"; + } else if (this.flags.get("osize")) { + return "original"; + } else { + return "fit"; + } +} + +Digilib.prototype.pageWidth = function() { + this.zoomFullpage('width'); +} + +Digilib.prototype.setSize = function(factor) { + this.params.set("ws", factor); + this.display(); +} + +Digilib.prototype.showMenu = function(menuId, buttonId, show) { + var menu = getElement(menuId); + if (show) { + // align right side of menu with button + var buttonPos = getElementPosition(getElement(buttonId)); + var menusize = getElementSize(menu); + moveElement(menu, new Position(buttonPos.x - menusize.width - 3, buttonPos.y)); + } + showElement(menu, show); +} + + +/******************************** + * global variables + ********************************/ + +var dl = new Digilib(); + +/* old parameter function compatibility stuff */ +function newParameter(a,b,c) {return dl.params.define(a,b,c)}; +function resetParameter(a) {return dl.params.reset(a)}; +function deleteParameter(a) {return dl.params.remove(a)}; +function getParameter(a) {return dl.params.get(a)}; +function setParameter(a,b,c) {return dl.params.set(a,b,c)}; +function hasParameter(a) {return dl.params.isSet(a)}; +function getAllParameters(a) {return dl.params.getAll(a)}; +getQueryString = getAllParameters; +function parseParameters(a) {return dl.params.parse(a)}; +function getAllMarks() {return dl.marks.getAll()}; +getMarksQueryString = getAllMarks; +function addMark(evt) {return dl.marks.addEvent(evt)}; +function deleteMark() {return dl.marks.pop()}; +function deleteAllMarks() {return dl.marks = new Marks()}; +function hasFlag(mode) {return dl.flags.get(mode)}; +function addFlag(mode) {return dl.flags.set(mode)}; +function removeFlag(mode) {return dl.flags.reset(mode)}; +function toggleFlag(mode) {return dl.flags.toggle(mode)}; +function getAllFlags() {return dl.flags.getAll()}; +/* old digilib function compatibility */ +function setDLParam(e, s, relative) {dl.setDLParam(e, s, relative)}; +function display(detail, moDetail) {dl.display(detail, moDetail)}; +function setMark(reload) {dl.setMark(reload)}; +function removeMark(reload) {dl.removeMark(reload)}; +function resetImage() {dl.resetImage()}; +function dragImage(evt) {dl.dragImage(evt)}; +function zoomArea() {dl.zoomArea()}; +function zoomBy(factor) {dl.zoomBy(factor)}; +function zoomFullpage(a) {dl.zoomFullpage(a)}; +function moveCenter(on) {dl.moveCenter(on)}; +function isFullArea(area) {dl.isFullArea(area)}; +function canMove(movx, movy) {dl.canMove(movx, movy)}; +function moveBy(movx, movy) {dl.moveBy(movx, movy)}; +function getRef(baseURL) {dl.getRef(baseURL)}; +function getRefWin(type, msg) {dl.getRefWin(type, msg)}; +function getQuality() {dl.getQuality()}; +function setQuality(qual) {dl.setQuality(qual)}; +function setQualityWin(msg) {dl.setQualityWin(msg)}; +function mirror(dir) {dl.mirror(dir)}; +function gotoPage(gopage, keep) {dl.gotoPage(gopage, keep)}; +function gotoPageWin() {dl.gotoPageWin()}; +function setParamWin(param, text, relative) {dl.setParamWin(param, text, relative)}; +function showOptions(show) {dl.showOptions(show)}; +function showBirdDiv(show) {dl.showBirdDiv(show)}; +function showAboutDiv(show) {dl.showAboutDiv(show)}; +function calibrate(direction) {dl.calibrate(direction)}; +function setScale(a) {dl.setScale(a)}; +function getScale(a) {dl.getScale(a)}; +function originalSize(on) {dl.originalSize(on)}; +function pixelByPixel(on) {dl.pixelByPixel(on)}; +function pageWidth() {dl.pageWidth()}; +function setSize(factor) {dl.setSize(factor)}; +function showMenu(a,b,c) {dl.showMenu(a,b,c)}; + + +// :tabSize=4:indentSize=4:noTabs=true: + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/down.png Binary file client/digitallibrary/greyskin/down.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/down.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/down.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/first.png Binary file client/digitallibrary/greyskin/first.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/first.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/first.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/firstlast.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/firstlast.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/fixed.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/fixed.js Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,354 @@ +// fixed.js: fix fixed positioning and fixed backgrounds in IE/Win +// version 1.8, 08-Aug-2003 +// written by Andrew Clover , use freely + +/*@cc_on +@if (@_win32 && @_jscript_version>4) + +var fixed_positions= new Array(); +var fixed_backgrounds= new Array(); +var fixed_viewport; + +// Initialisation. Called when the tag arrives. Set up viewport so the +// rest of the script knows we're going, and add a measurer div, used to detect +// font size changes and measure image sizes for backgrounds later + +function fixed_init() { + fixed_viewport= (document.compatMode=='CSS1Compat') ? + document.documentElement : document.body; + var el= document.createElement('div'); + el.setAttribute('id', 'fixed-measure'); + el.style.position= 'absolute'; + el.style.top= '0'; el.style.left= '0'; + el.style.overflow= 'hidden'; el.style.visibility= 'hidden'; + el.style.fontSize= 'xx-large'; el.style.height= '5em'; + el.style.setExpression('width', 'fixed_measureFont()'); + document.body.insertBefore(el, document.body.firstChild); +} + +// Binding. Called every time an element is added to the document, check it +// for fixed features, if found add to our lists and set initial props + +function fixed_bind(el) { + var needLayout= false; + var tag= el.tagName.toLowerCase(); + var st= el.style; + var cst= el.currentStyle; + var anc; + + // find fixed-position elements + if (cst.position=='fixed') { + needLayout= true; + fixed_positions[fixed_positions.length]= el; + // store original positioning as we'll overwrite it + st.position= 'absolute'; + st.fixedPLeft= cst.left; + st.fixedPTop= cst.top; + st.fixedPRight= cst.right; + st.fixedPBottom= cst.bottom; + st.fixedPWidth= fixed_parseLength(cst.width); + st.fixedPHeight= fixed_parseLength(cst.height); + // find element that will act as containing box, for convenience later + st.fixedCB= null; + for (anc= el; (anc= anc.parentElement).parentElement;) { + if (anc.currentStyle.position!='static') { + st.fixedCB= anc; + break; + } } + // detect nested fixed positioning (only ancestor need move) + st.fixedNest= false; + for (anc= el; anc= anc.parentElement;) { + if (anc.style.fixedNest!=null) + st.fixedNest= true; + break; + } + } + + // find fixed-background elements (not body/html which IE already gets right) + if (cst.backgroundAttachment=='fixed' && tag!='body' && tag!='html') { + needLayout= true; + fixed_backgrounds[fixed_backgrounds.length]= el; + // get background offset, converting from keyword if necessary + st.fixedBLeft= fixed_parseLength(cst.backgroundPositionX); + st.fixedBTop= fixed_parseLength(cst.backgroundPositionY); + // if it's a non-zero %age, need to know size of image for layout + if (st.fixedBLeft[1]=='%' || st.fixedBTop[1]=='%') { + st.fixedBWidth= 0; st.fixedBHeight= 0; + fixed_measureBack(el); + } + } + if (needLayout) fixed_layout(); +} + +// Layout. On every window or font size change, recalculate positioning + +// Request re-layout at next free moment +var fixed_delaying= false; +function fixed_delayout() { + if (fixed_delaying) return; + fixed_delaying= true; + window.setTimeout(fixed_layout, 0); +} + +var fixed_ARBITRARY= 200; + +function fixed_layout() { + fixed_delaying= false; + if (!fixed_viewport) return; + var i, el, st, j, pr, tmp, A= 'auto'; + var cb, cbLeft, cbTop, cbRight, cbBottom, oLeft, oTop, oRight, oBottom; + var vpWidth=fixed_viewport.clientWidth, vpHeight=fixed_viewport.clientHeight; + + // calculate initial position for fixed-position elements [black magic] + for (i= fixed_positions.length; i-->0;) { + el= fixed_positions[i]; st= el.style; + // find positioning of containing block + cb= st.fixedCB; if (!cb) cb= fixed_viewport; + cbLeft= fixed_pageLeft(cb); cbTop= fixed_pageTop(cb); + if (cb!=fixed_viewport) { cbLeft+= cb.clientLeft; cbTop+= cb.clientTop; } + cbRight= fixed_viewport.clientWidth-cbLeft-cb.clientWidth; + cbBottom= fixed_viewport.clientHeight-cbTop-cb.clientHeight; + // if size is in %, must recalculate relative to viewport + if (st.fixedPWidth[1]=='%') + st.width= Math.round(vpWidth*st.fixedPWidth[0]/100)+'px'; + if (st.fixedPHeight[1]=='%') + st.height= Math.round(vpHeight*st.fixedPHeight[0]/100)+'px'; + // find out offset values at max size, to account for margins + st.left= A; st.right= '0'; st.top= A; st.bottom= '0'; + oRight= el.offsetLeft+el.offsetWidth; oBottom= el.offsetTop+el.offsetHeight; + st.left= '0'; st.right= A; st.top= '0'; st.bottom= A; + oLeft= el.offsetLeft; oTop= el.offsetTop; + // use this to convert all edges to pixels + st.left= A; st.right= st.fixedPRight; + st.top= A; st.bottom= st.fixedPBottom; + oRight-= el.offsetLeft+el.offsetWidth; + oBottom-= el.offsetTop+el.offsetHeight; + st.left= st.fixedPLeft; st.top= st.fixedPTop; + oLeft= el.offsetLeft-oLeft; oTop= el.offsetTop-oTop; + // edge positioning fix + if (st.fixedPWidth[1]==A && st.fixedPLeft!=A && st.fixedPRight!=A) { + tmp= el.offsetLeft; st.left= A; st.width= fixed_ARBITRARY+'px'; + tmp= fixed_ARBITRARY+el.offsetLeft-tmp+cbLeft+cbRight; + st.left= st.fixedPLeft; st.width= ((tmp<1)?1:tmp)+'px'; + } + if (st.fixedPHeight[1]==A && st.fixedPTop!=A && st.fixedPBottom!=A) { + tmp= el.offsetTop; st.top= A; st.height= fixed_ARBITRARY+'px'; + tmp= fixed_ARBITRARY+el.offsetTop-tmp+cbTop+cbBottom; + st.top= st.fixedPTop; st.height= ((tmp<1)?1:tmp)+'px'; + } + // move all non-auto edges relative to the viewport + st.fixedCLeft= (st.fixedPLeft=='auto') ? oLeft : oLeft-cbLeft; + st.fixedCTop= (st.fixedPTop=='auto') ? oTop : oTop-cbTop; + st.fixedCRight= (st.fixedPRight=='auto') ? oRight : oRight-cbRight; + st.fixedCBottom= (st.fixedPBottom=='auto') ? oBottom : oBottom-cbBottom; + // remove left-positioning of right-positioned elements + if (st.fixedPLeft=='auto' && st.fixedPRight!='auto') st.fixedCLeft= 'auto'; + if (st.fixedPTop=='auto' && st.fixedPBottom!='auto') st.fixedCTop= 'auto'; + } + + + // calculate initial positioning of fixed backgrounds + for (i= fixed_backgrounds.length; i-->0;) { + el= fixed_backgrounds[i]; st= el.style; + tmp= st.fixedBImage; + if (tmp) { + if (tmp.readyState!='uninitialized') { + st.fixedBWidth= tmp.offsetWidth; + st.fixedBHeight= tmp.offsetHeight; + st.fixedBImage= window.undefined; + } + } + st.fixedBX= fixed_length(el, st.fixedBLeft, vpWidth-st.fixedBWidth); + st.fixedBY= fixed_length(el, st.fixedBTop, vpHeight-st.fixedBHeight); + } + + // now call scroll() to set the positions from the values just calculated + fixed_scroll(); +} + +// Scrolling. Offset fixed elements relative to viewport scrollness + +var fixed_lastX, fixed_lastY; +var fixed_PATCHDELAY= 300; +var fixed_patching= false; + +// callback function after a scroll, because incorrect scroll position is +// often reported first go! +function fixed_patch() { + fixed_patching= false; + var scrollX= fixed_viewport.scrollLeft, scrollY= fixed_viewport.scrollTop; + if (scrollX!=fixed_lastX && scrollY!=fixed_lastY) fixed_scroll(); +} + +function fixed_scroll() { + if (!fixed_viewport) return; + var i, el, st, viewportX, viewportY; + var scrollX= fixed_viewport.scrollLeft, scrollY= fixed_viewport.scrollTop; + fixed_lastX= scrollX; fixed_lastY= scrollY; + + // move non-nested fixed-position elements + for (i= fixed_positions.length; i-->0;) { + st= fixed_positions[i].style; + viewportX= (st.fixedNest) ? 0 : scrollX; + viewportY= (st.fixedNest) ? 0 : scrollY; + if (st.fixedCLeft!='auto') st.left= (st.fixedCLeft+viewportX)+'px'; + if (st.fixedCTop!='auto') st.top= (st.fixedCTop+viewportY)+'px'; + viewportX= (st.fixedCB==null || st.fixedCB==fixed_viewport) ? 0 : viewportX; + viewportY= (st.fixedCB==null || st.fixedCB==fixed_viewport) ? 0 : viewportY; + st.right= (st.fixedCRight-viewportX+1)+'px'; st.right= (st.fixedCRight-viewportX)+'px'; + st.bottom= (st.fixedCBottom-viewportY+1)+'px'; st.bottom= (st.fixedCBottom-viewportY)+'px'; + } + + // align fixed backgrounds to viewport + for (i= fixed_backgrounds.length; i-->0;) { + el= fixed_backgrounds[i]; st= el.style; + viewportX= scrollX; + viewportY= scrollY; + while (el.offsetParent) { + viewportX-= el.offsetLeft+el.clientLeft; + viewportY-= el.offsetTop +el.clientTop; + el= el.offsetParent; + } + st.backgroundPositionX= (st.fixedBX+viewportX)+'px'; + st.backgroundPositionY= (st.fixedBY+viewportY)+'px'; + } + + // call back again in a tic + if (!fixed_patching) { + fixed_patching= true; + window.setTimeout(fixed_patch, fixed_PATCHDELAY); + } +} + +// Measurement. Load bg-image into an invisible element on the page, when +// loaded write the width/height to an element's style for layout use; detect +// when font size changes + +function fixed_measureBack(el) { + var measure= document.getElementById('fixed-measure'); + var img= document.createElement('img'); + img.setAttribute('src', fixed_parseURL(el.currentStyle.backgroundImage)); + measure.appendChild(img); + el.style.fixedBImage= img; + if (img.readyState=='uninitialized') + img.attachEvent('onreadystatechange', fixed_measureBackImage_ready); +} + +function fixed_measureBackImage_ready() { + var img= event.srcElement; + if (img && img.readyState!='uninitialized') { + img.detachEvent('onreadystatechange', fixed_measureBackImage_ready); + fixed_layout(); + } +} + +var fixed_fontsize= 0; +function fixed_measureFont() { + var fs= document.getElementById('fixed-measure').offsetHeight; + if (fixed_fontsize!=fs && fixed_fontsize!=0) + fixed_delayout(); + fixed_fontsize= fs; + return '5em'; +} + +// Utility. General-purpose functions + +// parse url() to get value inside + +function fixed_parseURL(v) { + v= v.substring(4, v.length-1); + if (v.charAt(0)=='"' && v.charAt(v.length-1)=='"' || + v.charAt(0)=="'" && v.charAt(v.length-1)=="'") + return v.substring(1, v.length-1); + else return v; +} + +// parse length or auto or background-position keyword into number and unit + +var fixed_numberChars= '+-0123456789.'; +var fixed_ZERO= new Array(0, 'px'); +var fixed_50PC= new Array(50, '%'); +var fixed_100PC= new Array(100, '%'); +var fixed_AUTO= new Array(0, 'auto'); + +function fixed_parseLength(v) { + var num, i; + if (v=='left' || v=='top') return fixed_ZERO; + if (v=='right' || v=='bottom') return fixed_100PC; + if (v=='center') return fixed_50PC; + if (v=='auto') return fixed_AUTO; + i= 0; + while (i arrives, then call main init. Pass any new elements +// found on each scan to be bound + +var fixed_SCANDELAY= 500; + +function fixed_scan() { + if (!document.body) return; + if (!fixed_viewport) fixed_init(); + var el; + for (var i= 0; i + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/help.png Binary file client/digitallibrary/greyskin/help.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/help.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/help.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + ? + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/last.png Binary file client/digitallibrary/greyskin/last.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/last.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/last.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/left.png Binary file client/digitallibrary/greyskin/left.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/left.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/left.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mark-bg-16.png Binary file client/digitallibrary/greyskin/mark-bg-16.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mark-bg.png Binary file client/digitallibrary/greyskin/mark-bg.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mark-bg.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/mark-bg.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mark-bg_old.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/mark-bg_old.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mark.png Binary file client/digitallibrary/greyskin/mark.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mark.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/mark.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + 1 + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mirror-horizontal-on.png Binary file client/digitallibrary/greyskin/mirror-horizontal-on.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mirror-horizontal-on.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/mirror-horizontal-on.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mirror-horizontal.png Binary file client/digitallibrary/greyskin/mirror-horizontal.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mirror-horizontal.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/mirror-horizontal.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mirror-vertical-on.png Binary file client/digitallibrary/greyskin/mirror-vertical-on.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mirror-vertical-on.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/mirror-vertical-on.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mirror-vertical.png Binary file client/digitallibrary/greyskin/mirror-vertical.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mirror-vertical.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/mirror-vertical.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/mirror.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/mirror.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/options.png Binary file client/digitallibrary/greyskin/options.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/options.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/options.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/original-size.png Binary file client/digitallibrary/greyskin/original-size.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/original-size.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/original-size.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + 1 + 1 + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/page.png Binary file client/digitallibrary/greyskin/page.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/page.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/page.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/pagewidth.png Binary file client/digitallibrary/greyskin/pagewidth.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/pagewidth.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/pagewidth.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/pixel-by-pixel.png Binary file client/digitallibrary/greyskin/pixel-by-pixel.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/pixel-by-pixel.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/pixel-by-pixel.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/quality.png Binary file client/digitallibrary/greyskin/quality.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/quality.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/quality.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + Q + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/reference.png Binary file client/digitallibrary/greyskin/reference.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/reference.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/reference.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + http: + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/reset.png Binary file client/digitallibrary/greyskin/reset.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/reset.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/reset.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/rgb-on.png Binary file client/digitallibrary/greyskin/rgb-on.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/rgb-on.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/rgb-on.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/rgb.png Binary file client/digitallibrary/greyskin/rgb.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/rgb.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/rgb.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/right.png Binary file client/digitallibrary/greyskin/right.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/right.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/right.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/rightleft.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/rightleft.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/rotate-on.png Binary file client/digitallibrary/greyskin/rotate-on.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/rotate-on.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/rotate-on.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/rotate.png Binary file client/digitallibrary/greyskin/rotate.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/rotate.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/rotate.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/ruler-top.gif Binary file client/digitallibrary/greyskin/ruler-top.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/size.png Binary file client/digitallibrary/greyskin/size.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/size.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/size.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/trans.gif Binary file client/digitallibrary/greyskin/trans.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/up.png Binary file client/digitallibrary/greyskin/up.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/up.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/up.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/zoom-area.png Binary file client/digitallibrary/greyskin/zoom-area.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/zoom-area.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/zoom-area.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/zoom-full.png Binary file client/digitallibrary/greyskin/zoom-full.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/zoom-full.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/zoom-full.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/zoom-in.png Binary file client/digitallibrary/greyskin/zoom-in.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/zoom-in.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/zoom-in.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/zoom-out.png Binary file client/digitallibrary/greyskin/zoom-out.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/greyskin/zoom-out.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/greyskin/zoom-out.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/digilib-denied.png Binary file client/digitallibrary/img/digilib-denied.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/digilib-denied.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/img/digilib-denied.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,239 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/digilib-error.png Binary file client/digitallibrary/img/digilib-error.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/digilib-error.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/img/digilib-error.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,234 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + ! + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/digilib-logo-small.png Binary file client/digitallibrary/img/digilib-logo-small.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/digilib-logo-sw.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/img/digilib-logo-sw.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,219 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/digilib-logo-text1.png Binary file client/digitallibrary/img/digilib-logo-text1.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/digilib-logo.png Binary file client/digitallibrary/img/digilib-logo.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/digilib-logo.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/img/digilib-logo.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,219 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/digilib-notfound.png Binary file client/digitallibrary/img/digilib-notfound.png has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/digilib-notfound.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/img/digilib-notfound.svg Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,230 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + ? + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/down.gif Binary file client/digitallibrary/img/down.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/left.gif Binary file client/digitallibrary/img/left.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/mark1.gif Binary file client/digitallibrary/img/mark1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/mark2.gif Binary file client/digitallibrary/img/mark2.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/mark3.gif Binary file client/digitallibrary/img/mark3.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/mark4.gif Binary file client/digitallibrary/img/mark4.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/mark5.gif Binary file client/digitallibrary/img/mark5.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/mark6.gif Binary file client/digitallibrary/img/mark6.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/mark7.gif Binary file client/digitallibrary/img/mark7.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/mark8.gif Binary file client/digitallibrary/img/mark8.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/olinks.gif Binary file client/digitallibrary/img/olinks.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/orechts.gif Binary file client/digitallibrary/img/orechts.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/right.gif Binary file client/digitallibrary/img/right.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/ulinks.gif Binary file client/digitallibrary/img/ulinks.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/up.gif Binary file client/digitallibrary/img/up.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/img/urechts.gif Binary file client/digitallibrary/img/urechts.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/modules/cm_separator.gif Binary file client/digitallibrary/modules/cm_separator.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/modules/imago.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/modules/imago.js Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,441 @@ +/* + +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 + +*/ + +/************************************************************************* + * imago.js : digilib-module * + * * + * desc: adds different image manipulation functions. * + * * + *************************************************************************/ + + +/** + * brightness (value of brightness between -255 - +255) + */ +function brightness(value) { + + if ( (value >= -255) && (value <= 255) ) { + + dlParams.brgt.value = value; + display(3); + + } + +} + + +/** + * contrast (value of contrast - range?) + */ +function contrast(value) { + + dlParams.cont.value = parseFloat(value); + display(3); + +} + + +/** + * brightness/contrast in one call + */ +function brightnessContrast(brightness, contrast) { + + dlParams.cont.value = parseFloat(contrast); + + if ( (brightness >= -255) && (brightness <= 255) ) { + + dlParams.brgt.value = parseFloat(brightness); + display(3); + + } + +} + + +/** + * mirror (horizontal or vertical) + */ +function mirror(direction) { + + if ( direction == 'v' ) { + if ( dlParams.mo.value.indexOf('vmir') > -1 ) { + removeMoFlag('vmir'); + } else { + addMoFlag('vmir'); + } + } + + if ( direction == 'h' ) { + if ( dlParams.mo.value.indexOf('hmir') > -1 ) { + removeMoFlag('hmir'); + } else { + addMoFlag('hmir'); + } + } + + display(3); + +} + + +/** + * rotation + */ +function rotation(value) { + + value = parseFloat(value) % 360; + + if ( value < 0 ) { + value += 360; + } + + dlParams.rot.value = value; + display(3); + +} + + +/** + * rgb add (r/g/b, each value from -255 to +255) + */ +function rgba(value) { + + values = value.split("/"); + + if ( values.length != 3 ) { + alert ("Illegal parameter format (r/g/b)"); + } else if ( (values[0] < -255) || (values[0] > 255) ) { + alert ("Illegal red additioner (-255 to 255)"); + } else if ( (values[1] < -255) || (values[1] > 255) ) { + alert ("Illegal green additioner (-255 to 255)"); + } else if ( (values[2] < -255) || (values[2] > 255) ) { + alert ("Illegal blue additioner (-255 to 255)"); + } else { + + dlParams.rgba.value = value; + display(3); + + } +} + + +/** + * rgb mutiply (r/g/b, range?) + */ +function rgbm(value) { + + values = value.split("/"); + + if ( values.length != 3 ) { + alert ("Illegal parameter format (r/g/b)"); + } else if ( !isFinite(values[0]) ) { + alert ("Illegal red exponent"); + } else if ( !isFinite(values[1]) ) { + alert ("Illegal green exponent"); + } else if ( !isFinite(values[2]) ) { + alert ("Illegal blue exponent"); + } else { + + dlParams.rgbm.value = value; + display(3); + + } +} + + +/** + * rgba/rgbm in one call + */ +function colors(rgba, rgbm) { + + add = rgba.split("/"); + mult = rgba.split("/"); + + if ( (add.length) == 3 && (mult.length == 3) && + (add[0] >= -255) && (add[0] <= 255) && + (add[1] >= -255) && (add[1] <= 255) && + (add[2] >= -255) && (add[2] <= 255) && + (isFinite(mult[0])) && + (isFinite(mult[1])) && + (isFinite(mult[2])) ) { + + dlParams.rgba.value = rgba; + dlParams.rgbm.value = rgbm; + + display(3); + + } +} + + +/** + * pixel by pixel view of images + */ +function pixelByPixel() { + + removeMoFlag('osize'); + + addMoFlag('clip'); + + // change scale to 1 + dlParams.ws.value = 1.0; + + display(3); + +} + + +/** + * original size view of images + */ +function originalSize(dpi_v, dpi_h) { + + removeMoFlag('clip'); + + addMoFlag('osize'); + + // change scale to 1 + dlParams.ws.value = 1.0; + + dlParams.ddpix.value = cropFloat(dpi_h); + dlParams.ddpiy.value = cropFloat(dpi_v); + + display(3); + +} + + +/** + * scale (overriding old one) + * as pixel by pixel is some kind of scale, it does turn scale factor to 1 + * if chosen. also if a scale factor is chosen, + * then pixel by pixel is turned off. + */ +function scale(factor) { + + dlParams.ws.value = factor; + + removeMoFlag('clip'); + removeMoFlag('osize'); + + display(3); + +} + + +/** + * placeMarks (overriding old one) + * take care of rotation and mirroring when placing marks + */ +function placeMarks() { + + if ( dlParams.mk.value != '' ) { + + var mark = dlParams.mk.value.split(";"); + var mark_count = mark.length; + + // maximum of marks is 8 + // we do not report this error because this is already done in function 'mark' + if ( mark_count > 8 ) mark_count = 8; + + var picWidth = (document.all) ? parseInt(document.all.lay1.offsetWidth) : (typeof(document.getElementById) == "function") ? parseInt(document.pic.offsetWidth) : parseInt(document.lay1.clip.width); + var picHeight = (document.all) ? parseInt(document.all.lay1.offsetHeight) : (typeof(document.getElementById) == "function") ? parseInt(document.pic.offsetHeight) : parseInt(document.lay1.clip.height); + + // catch the cases where the picture had not been loaded already and + // make a timeout so that the coordinates are calculated with the real dimensions + if ( (picWidth > 30) || (document.pic.complete) ) { + + var xOffset = (document.all) ? parseInt(document.all.lay1.style.left) : (typeof(document.getElementById) == "function") ? parseInt(document.getElementById('lay1').style.left) : document.lay1.left; + var yOffset = (document.all) ? parseInt(document.all.lay1.style.top) : (typeof(document.getElementById) == "function") ? parseInt(document.getElementById('lay1').style.top) : document.lay1.top; + + for (var i = 0; i < mark_count; i++) { + mark[i] = mark[i].split("/"); + + if ( (parseFloat(mark[i][0]) >= parseFloat(dlParams.wx.value)) && + (parseFloat(mark[i][1]) >= parseFloat(dlParams.wy.value)) && + (parseFloat(mark[i][0]) <= (parseFloat(dlParams.wx.value) + parseFloat(dlParams.ww.value))) && + (parseFloat(mark[i][1]) <= (parseFloat(dlParams.wy.value) + parseFloat(dlParams.wh.value))) ) { + + mark[i][0] = (mark[i][0] - dlParams.wx.value)/dlParams.ww.value; + mark[i][1] = (mark[i][1] - dlParams.wy.value)/dlParams.wh.value; + + // mirror + if ( dlParams.mo.value.indexOf('hmir') > -1 ) { + mark[i][0] = 1 - mark[i][0]; + } + if ( dlParams.mo.value.indexOf('vmir') > -1 ) { + mark[i][1] = 1 - mark[i][1]; + } + + // just the beginning - not working currently + var ang_rad = dlParams.rot.value*2*3.1415926/360; + + var ws = Math.sin(ang_rad)/(Math.cos(ang_rad)*dlParams.ww.value/dlParams.wh.value+Math.sin(ang_rad)) * picWidth; + var wc = (Math.cos(ang_rad)*dlParams.ww.value/dlParams.wh.value)/(Math.cos(ang_rad)*dlParams.ww.value/dlParams.wh.value+Math.sin(ang_rad)) * picWidth; + + var hs = (Math.sin(ang_rad)*dlParams.ww.value/dlParams.wh.value)/(Math.sin(ang_rad)*dlParams.ww.value/dlParams.wh.value+Math.cos(ang_rad)) * picHeight; + var hc = Math.cos(ang_rad)/(Math.sin(ang_rad)*dlParams.ww.value/dlParams.wh.value+Math.cos(ang_rad)) * picHeight; + + var origPicWidth = Math.sqrt(Math.pow(wc, 2) + Math.pow(hs, 2)); + var origPicHeight = Math.sqrt(Math.pow(ws, 2) + Math.pow(hc, 2)); + // end of the beginning ;-) + + mark[i][0] = parseInt(xOffset + picWidth * mark[i][0]); + mark[i][1] = parseInt(yOffset + picHeight * mark[i][1]); + + if ( (document.all) || (typeof(document.getElementById) == "function") ) { + // suboptimal to place -5 pixels and not half size of mark-image + // should be changed in the future + document.getElementById("dot" + i).style.left = mark[i][0]-5; + document.getElementById("dot" + i).style.top = mark[i][1]-5; + document.getElementById("dot" + i).style.visibility = "visible"; + } else { + document.layers[i+1].moveTo(mark[i][0]-5, mark[i][1]-5); + document.layers[i+1].visibility = "show"; + } + } + } + + } else { + setTimeout("placeMarks()", 100); + } + } +} + + +/**** + * helper functions + ****/ + +/** + * Point (overriding old one) + * constructor holding different values of a point + * depending also on mirror or rotation + */ +function Point(evt) { + + if ( document.all ) { + + this.pageX = parseInt(document.body.scrollLeft+event.clientX); + this.pageY = parseInt(document.body.scrollLeft+event.clientY); + + this.x = this.pageX-parseInt(document.all.lay1.style.left); + this.y = this.pageY-parseInt(document.all.lay1.style.top); + + // mirror + if ( dlParams.mo.value.indexOf('hmir') > -1 ) { + this.relX = cropFloat(parseFloat(parseFloat(dlParams.wx.value)+parseFloat(dlParams.ww.value))-(dlParams.ww.value*this.x/document.all.lay1.offsetWidth)); + } else { + this.relX = cropFloat(parseFloat(dlParams.wx.value)+(dlParams.ww.value*this.x/document.all.lay1.offsetWidth)); + } + if ( dlParams.mo.value.indexOf('vmir') > -1 ) { + this.relY = cropFloat(parseFloat(parseFloat(dlParams.wy.value)+parseFloat(dlParams.wh.value))-(dlParams.wh.value*this.y/document.all.lay1.offsetHeight)); + } else { + this.relY = cropFloat(parseFloat(dlParams.wy.value)+(dlParams.wh.value*this.y/document.all.lay1.offsetHeight)); + } + + } else { + + this.pageX = parseInt(evt.pageX); + this.pageY = parseInt(evt.pageY); + + if ( typeof(document.getElementById) == "function" ) { + + this.x = this.pageX-parseInt(document.getElementById("lay1").style.left); + this.y = this.pageY-parseInt(document.getElementById("lay1").style.top); + + // mirror + if ( dlParams.mo.value.indexOf('hmir') > -1 ) { + this.relX = cropFloat(parseFloat(parseFloat(dlParams.wx.value)+parseFloat(dlParams.ww.value))-(dlParams.ww.value*this.x/document.pic.offsetWidth)); + } else { + this.relX = cropFloat(parseFloat(dlParams.wx.value)+(dlParams.ww.value*this.x/document.pic.offsetWidth)); + } + if ( dlParams.mo.value.indexOf('vmir') > -1 ) { + this.relY = cropFloat(parseFloat(parseFloat(dlParams.wy.value)+parseFloat(dlParams.wh.value))-(dlParams.wh.value*this.y/document.pic.offsetHeight)); + } else { + this.relY = cropFloat(parseFloat(dlParams.wy.value)+(dlParams.wh.value*this.y/document.pic.offsetHeight)); + } + + } else { + + this.x = this.pageX-document.lay1.left; + this.y = this.pageY-document.lay1.top; + + // mirror + if ( dlParams.mo.value.indexOf('hmir') > -1 ) { + this.relX = cropFloat(parseFloat(parseFloat(dlParams.wx.value)+parseFloat(dlParams.ww.value))-(dlParams.ww.value*this.x/document.lay1.clip.width)); + } else { + this.relX = cropFloat(parseFloat(dlParams.wx.value)+(dlParams.ww.value*this.x/document.lay1.clip.width)); + } + if ( dlParams.mo.value.indexOf('vmir') > -1 ) { + this.relY = cropFloat(parseFloat(parseFloat(dlParams.wy.value)+parseFloat(dlParams.wh.value))-(dlParams.wh.value*this.y/document.lay1.clip.height)); + } else { + this.relY = cropFloat(parseFloat(dlParams.wy.value)+(dlParams.wh.value*this.y/document.lay1.clip.height)); + } + + } + + } + + return this; + +} + + +/** + * removeMoFlag from mo parameter + */ +function removeMoFlag(name) { + + if ( dlParams.mo.value != '' ) { + + var idx_comma_after = dlParams.mo.value.indexOf(name + ','); + var idx_comma_before = dlParams.mo.value.indexOf(',' + name); + var idx_nocomma = dlParams.mo.value.indexOf(name); + + if ( idx_comma_after > -1 ) { + dlParams.mo.value = dlParams.mo.value.slice(0, idx_comma_after) + dlParams.mo.value.slice(idx_comma_after+name.length+1); + }else if ( idx_comma_before > -1 ) { + dlParams.mo.value = dlParams.mo.value.slice(0, idx_comma_before) + dlParams.mo.value.slice(idx_comma_before+name.length+1); + } else if ( idx_nocomma > -1 ) { + dlParams.mo.value = dlParams.mo.value.slice(0, idx_nocomma) + dlParams.mo.value.slice(idx_nocomma+name.length); + } + } + +} + + +/** + * addMoFlag from mo parameter + */ +function addMoFlag(name) { + + if ( dlParams.mo.value.indexOf(name) == -1 ) { + + if ( dlParams.mo.value.length > 0 ) { + dlParams.mo.value += ',' + name; + } else { + dlParams.mo.value = name; + } + } + +} diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/modules/newReferences.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/modules/newReferences.js Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,82 @@ +/* + +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 + +*/ + +/************************************************************************* + * newReferences.js : digilib-module * + * * + * desc: creates references in the new parameter format (key-value) * + * * + *************************************************************************/ + + +/** + * ref, overriding original one + */ +function ref(select) { + + var hyperlinkRef = baseUrl + "/digilib.jsp?"; + + if ( select >= 2 ) { + + // no original size is referenced at the moment, + // because the dpi values are not constant from user to user + removeMoFlag('osize'); + + var parameterString = ''; + + for ( param in dlParams ) { + if ( (dlParams[param].detail < 9) && (dlParams[param].defaultValue != dlParams[param].value) ) { + parameterString += "&" + param + "=" + dlParams[param].value; + } + } + + if (select == 2) { + parameterString += "&lv=3"; // level three + parameterString = parameterString.slice(1); + prompt("Alcatraz-style HTML link", hyperlinkRef + parameterString); + } else { + parameterString += "&lv=1"; // i just really want the image + parameterString = parameterString.slice(1); + return hyperlinkRef + parameterString; + } + + } else { + + var parameterString = ''; + + parameterString += dlParams.fn.value + "+" + dlParams.pn.value + "+" + dlParams.ws.value + "+"; + parameterString += dlParams.mo.value + "+" + dlParams.mk.value; + + if ( (dlParams.wx.value != 0) || (dlParams.wy.value != 0) || (dlParams.ww.value != 1) || (dlParams.wh.value != 1) ) { + parameterString += "+" + dlParams.wx.value + "+" + dlParams.wy.value + "+" + dlParams.ww.value; + parameterString += "+" + dlParams.wh.value; + } + + if ( select == 1 ) { + prompt("Link for HTML-documents", hyperlinkRef + parameterString); + } + + if ( select == 0 ) { + prompt("Link for LaTeX-documents", "\\href{" + hyperlinkRef + parameterString + "}{TEXT}"); + } + } +} diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/back0.gif Binary file client/digitallibrary/oldskin/buttons/back0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/back1.gif Binary file client/digitallibrary/oldskin/buttons/back1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/background0.gif Binary file client/digitallibrary/oldskin/buttons/background0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/background1.gif Binary file client/digitallibrary/oldskin/buttons/background1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/description0.gif Binary file client/digitallibrary/oldskin/buttons/description0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/description1.gif Binary file client/digitallibrary/oldskin/buttons/description1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/digicat0.gif Binary file client/digitallibrary/oldskin/buttons/digicat0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/digicat1.gif Binary file client/digitallibrary/oldskin/buttons/digicat1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/download0.gif Binary file client/digitallibrary/oldskin/buttons/download0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/download1.gif Binary file client/digitallibrary/oldskin/buttons/download1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/fullpage0.gif Binary file client/digitallibrary/oldskin/buttons/fullpage0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/fullpage1.gif Binary file client/digitallibrary/oldskin/buttons/fullpage1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/glossar0.gif Binary file client/digitallibrary/oldskin/buttons/glossar0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/help0.gif Binary file client/digitallibrary/oldskin/buttons/help0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/home0.gif Binary file client/digitallibrary/oldskin/buttons/home0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/home1.gif Binary file client/digitallibrary/oldskin/buttons/home1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/makepdf0.gif Binary file client/digitallibrary/oldskin/buttons/makepdf0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/makepdf1.gif Binary file client/digitallibrary/oldskin/buttons/makepdf1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/mark.gif Binary file client/digitallibrary/oldskin/buttons/mark.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/mark0.gif Binary file client/digitallibrary/oldskin/buttons/mark0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/mark1.gif Binary file client/digitallibrary/oldskin/buttons/mark1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/matrix0.gif Binary file client/digitallibrary/oldskin/buttons/matrix0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/matrix1.gif Binary file client/digitallibrary/oldskin/buttons/matrix1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/menu.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/oldskin/buttons/menu.js Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,240 @@ +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; +} + +browser = new checkBrowser(); + +function changeBc(obj, color){ + var div; + + if (color == '' && browser.ns4) color = null; + + if (browser.ns4) div = document.layers[obj]; + else if (browser.dom) div = document.getElementById(obj).style; + else if (browser.ie) div = document.all[obj].style; + + if (browser.dom || browser.ie) div.backgroundColor = color; + if (browser.ns4) div.bgColor = color; +} + +function makeArray(n){ + this.length = n; + for (var i = 0; i < n; i++) { + this[i] = new Image(); + } + + return this; +} + +function preloadImages() { + over = new makeArray(document.images.length); + away = new makeArray(document.images.length); + + for (i = 0; i < document.images.length; i++) { + currName = document.images[i].src.slice(0, document.images[i].src.lastIndexOf('.')-1); + away[i].src = currName + "0.gif"; + over[i].src = currName + "1.gif"; + } +} + +function overButton(n) { + currButton = document.images[n]; + + currButton.src = over[n].src; + if (showHelp) contextHelp(n); +} + +function awayButton(n) { + currButton = document.images[n]; + + currButton.src = away[n].src; +} + +function overItem(obj) { + changeBc("menu" + obj, '#770000'); + clearTimeout(timeID); +} + +function awayItem(obj) { + changeBc("menu" + obj, '#666666'); + timeID = setTimeout("hideMenu()", 700); +} + +var timeID = null; + +function changeMark(obj) { + var object; + + if (browser.ns4) object = document.layers["menu" + obj].document.images[0]; + else if (browser.dom) object = document.getElementById("mark" + obj); + else if (browser.ie) object = document.all["mark" + obj]; + + var path = object.src.slice(0, object.src.lastIndexOf('/')+1); + + object.src = (object.src.indexOf("nomark") > -1) ? path + "mark.gif" : path + "nomark.gif"; +} + +function showMenu(obj) { + menu(obj, true); +} + +function menu(obj, show) { + var currObj = "menu" + obj; + var idx = 0; + while(true) { + if (browser.ns4 && document.layers[currObj]) document.layers[currObj].visibility = (show) ? "show" : "hide"; + else if (browser.dom && document.getElementById(currObj)) document.getElementById(currObj).style.visibility = (show) ? "visible" : "hidden"; + else if (browser.ie && document.all[currObj]) document.all[currObj].style.visibility = (show) ? "visible" : "hidden"; + else break; + + currObj = "menu" + obj + (++idx); + } + if (!show) activeMenu = ''; + else activeMenu = obj; + + timeID = setTimeout("hideMenu()", 2000); +} + +function hideMenu() { + if (activeMenu != '') menu(activeMenu, false); + clearTimeout(timeID); +} + +var activeMenu = ''; + + +// just to be sure, that no buffer overflow can arrive +var semaphor = true; + +function contextHelp(n) { + + if (helpWindow.closed) { + changeMark(31); + changeHelp(); + return; + } + + if ((navigator.appVersion.indexOf("Macintosh") < 0) && semaphor) { + semaphor = false; + var help = helpText[n].split("|"); + + helpWindow.focus(); + helpWindow.document.open(); + helpWindow.document.write('Context Help'); + helpWindow.document.write(''); + helpWindow.document.write('
'); + helpWindow.document.write(help[0] + '
'); + helpWindow.document.write(help[1] + '
'); + helpWindow.document.close(); + + // stupid workaround because of netscape 6, that doesen't know the opener property + // this workaround is still ok because netscape 6 has eventbuffer checks so no overflow + if (browser.ns6) { + semaphor = true; + } + + // next stupid workaround because of opera 6, that somehow don't start the 'onLoad'- + // attribute in the body tag (the helpwindow does not finish loading) + if (browser.opera) { + setTimeout("semaphor = true;", 50); + } + + } +} + +function openContextHelp() { + if (navigator.appVersion.indexOf("Macintosh") > -1) { + openContextHelpMac(); + return; + } + + semaphor = false; + + var winWidth = 270; + var winHeight = 130; + + var xScreen = 0.9*(screen.width-winWidth); + var yScreen = 0.8*(screen.height-winHeight); + + helpWindow = window.open("", "ContextHelp", "width=" + winWidth + ",height=" + winHeight + ",screenX=" + xScreen + ",screenY=" + yScreen + ",left=" + xScreen + ",top=" + yScreen); + + helpWindow.focus(); + helpWindow.document.open(); + helpWindow.document.write('Context Help'); + helpWindow.document.write(''); + helpWindow.document.write('
'); + helpWindow.document.write('Context Help
'); + helpWindow.document.write('Move over any button to get some more information about its function
'); + helpWindow.document.close(); + + // for some safety reason help-requests have to be blocked while opening the window + setTimeout("semaphor = true;", 200); +} + +// because macs have a strange window focus behaviour we have to go a special +// way for them - just opening a window that contains all button-descriptions +function openContextHelpMac() { + + var winWidth = 270; + var winHeight = 600; + + var xScreen = 0.9*(screen.width-winWidth); + var yScreen = 0.8*(screen.height-winHeight); + + helpWindow = window.open("", "ContextHelp", "width=" + winWidth + ",height=" + winHeight + ",screenX=" + xScreen + ",screenY=" + yScreen + ",left=" + xScreen + ",top=" + yScreen + ",scrollbars"); + + helpWindow.focus(); + helpWindow.document.open(); + helpWindow.document.write('Context Help Macintosh'); + helpWindow.document.write(''); + helpWindow.document.write(''); + + for (n = 0; n < helpText.length; n++) { + + help = helpText[n].split("|"); + helpWindow.document.write(''); + } + helpWindow.document.write('
'); + helpWindow.document.write(help[0] + '
'); + helpWindow.document.write('

' + help[1] + '
 

'); + helpWindow.document.close(); +} + + +function closeContextHelp() { + if (helpWindow != '' && !helpWindow.closed) { + helpWindow.close(); + } + helpWindow = ''; +} + +function changeHelp() { + showHelp = !showHelp; + showHelp ? openContextHelp() : closeContextHelp(); +} + + +// variable containing the contextwindow +var helpWindow = ''; \ No newline at end of file diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/moveto0.gif Binary file client/digitallibrary/oldskin/buttons/moveto0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/moveto1.gif Binary file client/digitallibrary/oldskin/buttons/moveto1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/newwindow0.gif Binary file client/digitallibrary/oldskin/buttons/newwindow0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/newwindow1.gif Binary file client/digitallibrary/oldskin/buttons/newwindow1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/next0.gif Binary file client/digitallibrary/oldskin/buttons/next0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/next1.gif Binary file client/digitallibrary/oldskin/buttons/next1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/nomark.gif Binary file client/digitallibrary/oldskin/buttons/nomark.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/page0.gif Binary file client/digitallibrary/oldskin/buttons/page0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/page1.gif Binary file client/digitallibrary/oldskin/buttons/page1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/questionmark0.gif Binary file client/digitallibrary/oldskin/buttons/questionmark0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/questionmark1.gif Binary file client/digitallibrary/oldskin/buttons/questionmark1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/reference0.gif Binary file client/digitallibrary/oldskin/buttons/reference0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/reference1.gif Binary file client/digitallibrary/oldskin/buttons/reference1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/refresh0.gif Binary file client/digitallibrary/oldskin/buttons/refresh0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/refresh1.gif Binary file client/digitallibrary/oldskin/buttons/refresh1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/relation0.gif Binary file client/digitallibrary/oldskin/buttons/relation0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/relation1.gif Binary file client/digitallibrary/oldskin/buttons/relation1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/scale0.gif Binary file client/digitallibrary/oldskin/buttons/scale0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/scale1.gif Binary file client/digitallibrary/oldskin/buttons/scale1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/spacer.gif Binary file client/digitallibrary/oldskin/buttons/spacer.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/type0.gif Binary file client/digitallibrary/oldskin/buttons/type0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/type1.gif Binary file client/digitallibrary/oldskin/buttons/type1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/work0.gif Binary file client/digitallibrary/oldskin/buttons/work0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/work1.gif Binary file client/digitallibrary/oldskin/buttons/work1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/zoomarea0.gif Binary file client/digitallibrary/oldskin/buttons/zoomarea0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/zoomarea1.gif Binary file client/digitallibrary/oldskin/buttons/zoomarea1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/zoomin0.gif Binary file client/digitallibrary/oldskin/buttons/zoomin0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/zoomin1.gif Binary file client/digitallibrary/oldskin/buttons/zoomin1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/zoomout0.gif Binary file client/digitallibrary/oldskin/buttons/zoomout0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/zoomout1.gif Binary file client/digitallibrary/oldskin/buttons/zoomout1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/zoompoint0.gif Binary file client/digitallibrary/oldskin/buttons/zoompoint0.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/buttons/zoompoint1.gif Binary file client/digitallibrary/oldskin/buttons/zoompoint1.gif has changed diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/dcMain.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/oldskin/dcMain.jsp Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,83 @@ +<%@ 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); +} +%> + + + + + + + + + + + +
+ +
+ + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/dcMenu.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/oldskin/dcMenu.html Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,49 @@ + + + + + + + + +
+

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/dclib.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/oldskin/dclib.js Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,124 @@ +/* +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) { + // creates the HTML for the image table + var wsize = getWinSize(); + var fWidth = wsize.width; + var fHeight = wsize.height; + + var mx = getParameter("mx"); + cells = mx.split('x'); + + var dw = getParameter("dw"); + var dh = getParameter("dh"); + var pt = getParameter("pt"); + var pn = parseInt(getParameter("pn")); + var fn = getParameter("fn"); + var par_mo = (hasParameter("mo")) ? "mo="+getParameter("mo") : ""; + + 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 = pn+i+j*cells[0]; + var img = baseUrl + "/servlet/Scaler?fn=" + fn + "&pn=" + idx; + img += "&dw=" + picWidth + "&dh=" + picHeight + par_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(); +} diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/dlMenu.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/oldskin/dlMenu.html Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,151 @@ + + + + + + + + + + +
+
+
+

+
+

+
+
+
+

+

+

+ + + + + + + + + + + + + + + + + + + + + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/oldskin/pageWin.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/oldskin/pageWin.html Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,24 @@ + + + + + +

+ +

+ + diff -r 87cb3dc2aa12 -r e758a49258e8 client/digitallibrary/relato/astro.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/relato/astro.xml Wed Aug 25 18:29:08 2010 +0200 @@ -0,0 +1,81 @@ + + + + + + + + + + In order to use <i>relato</i> you need to have a frame capable browser. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +