# HG changeset patch # User robcast # Date 1303810691 -7200 # Node ID 89ba3ffcf55288f35b4fa38045d2ee8c53491979 # Parent cad6d3d5aeb3cd011f5814c7e802154ea9dc7c24# Parent 1b627b5c9fad5c2ed7b50e1045456e7e762b1a26 merge jquery + mvn into default diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/META-INF/MANIFEST.MF --- a/client/digitallibrary/META-INF/MANIFEST.MF Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Class-Path: - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/WEB-INF/digilib-auth.xml --- a/client/digitallibrary/WEB-INF/digilib-auth.xml Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ - - - - - - - - - - - - -
-
-
- - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/WEB-INF/digilib-config.xml --- a/client/digitallibrary/WEB-INF/digilib-config.xml Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/WEB-INF/digilib-map.xml --- a/client/digitallibrary/WEB-INF/digilib-map.xml Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/WEB-INF/log4j-config.xml --- a/client/digitallibrary/WEB-INF/log4j-config.xml Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/WEB-INF/web.xml --- a/client/digitallibrary/WEB-INF/web.xml Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,184 +0,0 @@ - - - - - - digilib - - - This is the web frontend of the Digital Document Library. - - - - - Initialiser - - - The inialisation servlet (must run first). - - - digilib.servlet.Initialiser - - - - 1 - - - - - - Scaler - - - The servlet to scale the digilib images. - - - digilib.servlet.Scaler - - - - 5 - - - - - - Texter - - - The servlet for text. - - - digilib.servlet.Texter - - - - - - PDFCache - - - The servlet for PDF. - - - digilib.servlet.PDFCache - - - - - - doc-jsp - - - org.apache.jasper.servlet.JspServlet - - - - - logVerbosityLevel - - - WARNING - - - - 3 - - - - - - Scaler - - - /servlet/Scaler/* - - - - - Scaler - - - /authenticated/servlet/Scaler/* - - - - - - Texter - - - /servlet/Texter/* - - - - - Texter - - - /authenticated/servlet/Texter/* - - - - - - PDFCache - - - /servlet/PDFCache/* - - - - - PDFCache - - - /authenticated/servlet/PDFCache/* - - - - - - doc-jsp - - - *.jsp - - - - - - - Authenticated Digilib - - - /authenticated/* - - - - - - user - - - - - - - FORM - - - - /digilib-login.html - - - /digilib-fail.html - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/baselib.js --- a/client/digitallibrary/baselib.js Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,638 +0,0 @@ -/* 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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/digicat.html --- a/client/digitallibrary/digicat.html Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ - - - -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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/digicat.jsp --- a/client/digitallibrary/digicat.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -<%@ 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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/digilib-fail.html --- a/client/digitallibrary/digilib-fail.html Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - -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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/digilib-login.html --- a/client/digitallibrary/digilib-login.html Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ - - -Login to digilib - - - - -

This document requires authentication

- -

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

- -

- - - - - - - - - - - - - -
Name:
Password:
-
- - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/digilib.html --- a/client/digitallibrary/digilib.html Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ - - - -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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/digilib.jsp --- a/client/digitallibrary/digilib.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -<%@ 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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/digimage.jsp --- a/client/digitallibrary/digimage.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -<%@ 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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/digimage_img_inc.jsp --- a/client/digitallibrary/digimage_img_inc.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -<%@ 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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/digimage_tbl_inc.jsp --- a/client/digitallibrary/digimage_tbl_inc.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -<%@ 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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/dirInfo-xml.jsp --- a/client/digitallibrary/dirInfo-xml.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -<%@page import="digilib.io.FileOps"%><%@ 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()); -FileOps.FileClass fc = FileOps.FileClass.IMAGE; -int dirSize = dir.size(fc); - -%> -<% if (dir != null) { %> - <%= dirSize %> - <%= dir.getDirName() %> - <%= dir.getDir().getPath() %> -<% - if (!dlRequest.hasOption("mo", "dir")) { - for (int i = 0; i < dirSize; i++) { - digilib.io.DocuDirent f = dir.get(i, fc); - String fn = (f != null) ? f.getName() : "null"; -%> - <%= i+1 %> - <%= digilib.io.FileOps.basename(fn) %> - <%= fn %> - -<% - } // for - } // if not dironly - } // if dir -%> diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/dlContext-xml.jsp --- a/client/digitallibrary/dlContext-xml.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -<%@ 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.FileClass.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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/dlInfo-js.jsp --- a/client/digitallibrary/dlInfo-js.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -<%@ 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.getParams().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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/dlInfo-xml.jsp --- a/client/digitallibrary/dlInfo-xml.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -<%@ 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.getParams().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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/dllib.js --- a/client/digitallibrary/dllib.js Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,616 +0,0 @@ -/* 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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/empty.html --- a/client/digitallibrary/empty.html Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/back.png Binary file client/digitallibrary/greyskin/back.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/back.svg --- a/client/digitallibrary/greyskin/back.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/baselib.js --- a/client/digitallibrary/greyskin/baselib.js Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,981 +0,0 @@ -/* 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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/bg.png Binary file client/digitallibrary/greyskin/bg.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/bg.svg --- a/client/digitallibrary/greyskin/bg.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/birds-eye.png Binary file client/digitallibrary/greyskin/birds-eye.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/birds-eye.svg --- a/client/digitallibrary/greyskin/birds-eye.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/blue.png Binary file client/digitallibrary/greyskin/blue.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/brightness-on.png Binary file client/digitallibrary/greyskin/brightness-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/brightness-on.svg --- a/client/digitallibrary/greyskin/brightness-on.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/brightness.png Binary file client/digitallibrary/greyskin/brightness.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/brightness.svg --- a/client/digitallibrary/greyskin/brightness.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/calibration-x.png Binary file client/digitallibrary/greyskin/calibration-x.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/calibration-x.svg --- a/client/digitallibrary/greyskin/calibration-x.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/calibration-y.png Binary file client/digitallibrary/greyskin/calibration-y.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/calibration-y.svg --- a/client/digitallibrary/greyskin/calibration-y.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/cat.png Binary file client/digitallibrary/greyskin/cat.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/cat.svg --- a/client/digitallibrary/greyskin/cat.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/contrast-on.png Binary file client/digitallibrary/greyskin/contrast-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/contrast-on.svg --- a/client/digitallibrary/greyskin/contrast-on.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/contrast.png Binary file client/digitallibrary/greyskin/contrast.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/contrast.svg --- a/client/digitallibrary/greyskin/contrast.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/corona.png Binary file client/digitallibrary/greyskin/corona.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/corona.svg --- a/client/digitallibrary/greyskin/corona.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,214 +0,0 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/debug.js --- a/client/digitallibrary/greyskin/debug.js Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/delmark.png Binary file client/digitallibrary/greyskin/delmark.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/delmark.svg --- a/client/digitallibrary/greyskin/delmark.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - 1 - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/diginew.css --- a/client/digitallibrary/greyskin/diginew.css Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,276 +0,0 @@ -/* 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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/diginew.jsp --- a/client/digitallibrary/greyskin/diginew.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,618 +0,0 @@ - -<%@ 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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/dlMenu.html --- a/client/digitallibrary/greyskin/dlMenu.html Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +0,0 @@ - - - - - - - - - - -
-
-
-

-
-

-
-
-
-

-

-

- - - - - - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/dllib.js --- a/client/digitallibrary/greyskin/dllib.js Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1045 +0,0 @@ -/* 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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/down.png Binary file client/digitallibrary/greyskin/down.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/down.svg --- a/client/digitallibrary/greyskin/down.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/first.png Binary file client/digitallibrary/greyskin/first.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/first.svg --- a/client/digitallibrary/greyskin/first.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/firstlast.svg --- a/client/digitallibrary/greyskin/firstlast.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/fixed.js --- a/client/digitallibrary/greyskin/fixed.js Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,354 +0,0 @@ -// 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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/help.png Binary file client/digitallibrary/greyskin/help.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/help.svg --- a/client/digitallibrary/greyskin/help.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - ? - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/last.png Binary file client/digitallibrary/greyskin/last.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/last.svg --- a/client/digitallibrary/greyskin/last.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/left.png Binary file client/digitallibrary/greyskin/left.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/left.svg --- a/client/digitallibrary/greyskin/left.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mark-bg-16.png Binary file client/digitallibrary/greyskin/mark-bg-16.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mark-bg.png Binary file client/digitallibrary/greyskin/mark-bg.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mark-bg.svg --- a/client/digitallibrary/greyskin/mark-bg.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mark-bg_old.svg --- a/client/digitallibrary/greyskin/mark-bg_old.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mark.png Binary file client/digitallibrary/greyskin/mark.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mark.svg --- a/client/digitallibrary/greyskin/mark.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - 1 - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mirror-horizontal-on.png Binary file client/digitallibrary/greyskin/mirror-horizontal-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mirror-horizontal-on.svg --- a/client/digitallibrary/greyskin/mirror-horizontal-on.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mirror-horizontal.png Binary file client/digitallibrary/greyskin/mirror-horizontal.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mirror-horizontal.svg --- a/client/digitallibrary/greyskin/mirror-horizontal.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mirror-vertical-on.png Binary file client/digitallibrary/greyskin/mirror-vertical-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mirror-vertical-on.svg --- a/client/digitallibrary/greyskin/mirror-vertical-on.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mirror-vertical.png Binary file client/digitallibrary/greyskin/mirror-vertical.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mirror-vertical.svg --- a/client/digitallibrary/greyskin/mirror-vertical.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/mirror.svg --- a/client/digitallibrary/greyskin/mirror.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/options.png Binary file client/digitallibrary/greyskin/options.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/options.svg --- a/client/digitallibrary/greyskin/options.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/original-size.png Binary file client/digitallibrary/greyskin/original-size.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/original-size.svg --- a/client/digitallibrary/greyskin/original-size.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - 1 - 1 - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/page.png Binary file client/digitallibrary/greyskin/page.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/page.svg --- a/client/digitallibrary/greyskin/page.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/pagewidth.png Binary file client/digitallibrary/greyskin/pagewidth.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/pagewidth.svg --- a/client/digitallibrary/greyskin/pagewidth.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/pixel-by-pixel.png Binary file client/digitallibrary/greyskin/pixel-by-pixel.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/pixel-by-pixel.svg --- a/client/digitallibrary/greyskin/pixel-by-pixel.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/quality.png Binary file client/digitallibrary/greyskin/quality.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/quality.svg --- a/client/digitallibrary/greyskin/quality.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - Q - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/reference.png Binary file client/digitallibrary/greyskin/reference.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/reference.svg --- a/client/digitallibrary/greyskin/reference.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - http: - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/reset.png Binary file client/digitallibrary/greyskin/reset.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/reset.svg --- a/client/digitallibrary/greyskin/reset.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/rgb-on.png Binary file client/digitallibrary/greyskin/rgb-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/rgb-on.svg --- a/client/digitallibrary/greyskin/rgb-on.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/rgb.png Binary file client/digitallibrary/greyskin/rgb.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/rgb.svg --- a/client/digitallibrary/greyskin/rgb.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/right.png Binary file client/digitallibrary/greyskin/right.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/right.svg --- a/client/digitallibrary/greyskin/right.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/rightleft.svg --- a/client/digitallibrary/greyskin/rightleft.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/rotate-on.png Binary file client/digitallibrary/greyskin/rotate-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/rotate-on.svg --- a/client/digitallibrary/greyskin/rotate-on.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/rotate.png Binary file client/digitallibrary/greyskin/rotate.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/rotate.svg --- a/client/digitallibrary/greyskin/rotate.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/ruler-top.gif Binary file client/digitallibrary/greyskin/ruler-top.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/size.png Binary file client/digitallibrary/greyskin/size.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/size.svg --- a/client/digitallibrary/greyskin/size.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/trans.gif Binary file client/digitallibrary/greyskin/trans.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/up.png Binary file client/digitallibrary/greyskin/up.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/up.svg --- a/client/digitallibrary/greyskin/up.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/zoom-area.png Binary file client/digitallibrary/greyskin/zoom-area.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/zoom-area.svg --- a/client/digitallibrary/greyskin/zoom-area.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/zoom-full.png Binary file client/digitallibrary/greyskin/zoom-full.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/zoom-full.svg --- a/client/digitallibrary/greyskin/zoom-full.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/zoom-in.png Binary file client/digitallibrary/greyskin/zoom-in.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/zoom-in.svg --- a/client/digitallibrary/greyskin/zoom-in.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/zoom-out.png Binary file client/digitallibrary/greyskin/zoom-out.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/greyskin/zoom-out.svg --- a/client/digitallibrary/greyskin/zoom-out.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/digilib-denied.png Binary file client/digitallibrary/img/digilib-denied.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/digilib-denied.svg --- a/client/digitallibrary/img/digilib-denied.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,239 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/digilib-error.png Binary file client/digitallibrary/img/digilib-error.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/digilib-error.svg --- a/client/digitallibrary/img/digilib-error.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,234 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - ! - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/digilib-logo-small.png Binary file client/digitallibrary/img/digilib-logo-small.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/digilib-logo-sw.svg --- a/client/digitallibrary/img/digilib-logo-sw.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,219 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/digilib-logo-text1.png Binary file client/digitallibrary/img/digilib-logo-text1.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/digilib-logo.png Binary file client/digitallibrary/img/digilib-logo.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/digilib-logo.svg --- a/client/digitallibrary/img/digilib-logo.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,219 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/digilib-notfound.png Binary file client/digitallibrary/img/digilib-notfound.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/digilib-notfound.svg --- a/client/digitallibrary/img/digilib-notfound.svg Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,230 +0,0 @@ - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - ? - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/down.gif Binary file client/digitallibrary/img/down.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/left.gif Binary file client/digitallibrary/img/left.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/mark1.gif Binary file client/digitallibrary/img/mark1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/mark2.gif Binary file client/digitallibrary/img/mark2.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/mark3.gif Binary file client/digitallibrary/img/mark3.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/mark4.gif Binary file client/digitallibrary/img/mark4.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/mark5.gif Binary file client/digitallibrary/img/mark5.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/mark6.gif Binary file client/digitallibrary/img/mark6.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/mark7.gif Binary file client/digitallibrary/img/mark7.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/mark8.gif Binary file client/digitallibrary/img/mark8.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/olinks.gif Binary file client/digitallibrary/img/olinks.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/orechts.gif Binary file client/digitallibrary/img/orechts.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/right.gif Binary file client/digitallibrary/img/right.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/ulinks.gif Binary file client/digitallibrary/img/ulinks.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/up.gif Binary file client/digitallibrary/img/up.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/img/urechts.gif Binary file client/digitallibrary/img/urechts.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/back0.gif Binary file client/digitallibrary/oldskin/buttons/back0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/back1.gif Binary file client/digitallibrary/oldskin/buttons/back1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/background0.gif Binary file client/digitallibrary/oldskin/buttons/background0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/background1.gif Binary file client/digitallibrary/oldskin/buttons/background1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/description0.gif Binary file client/digitallibrary/oldskin/buttons/description0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/description1.gif Binary file client/digitallibrary/oldskin/buttons/description1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/digicat0.gif Binary file client/digitallibrary/oldskin/buttons/digicat0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/digicat1.gif Binary file client/digitallibrary/oldskin/buttons/digicat1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/download0.gif Binary file client/digitallibrary/oldskin/buttons/download0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/download1.gif Binary file client/digitallibrary/oldskin/buttons/download1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/fullpage0.gif Binary file client/digitallibrary/oldskin/buttons/fullpage0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/fullpage1.gif Binary file client/digitallibrary/oldskin/buttons/fullpage1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/glossar0.gif Binary file client/digitallibrary/oldskin/buttons/glossar0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/help0.gif Binary file client/digitallibrary/oldskin/buttons/help0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/home0.gif Binary file client/digitallibrary/oldskin/buttons/home0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/home1.gif Binary file client/digitallibrary/oldskin/buttons/home1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/makepdf0.gif Binary file client/digitallibrary/oldskin/buttons/makepdf0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/makepdf1.gif Binary file client/digitallibrary/oldskin/buttons/makepdf1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/mark.gif Binary file client/digitallibrary/oldskin/buttons/mark.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/mark0.gif Binary file client/digitallibrary/oldskin/buttons/mark0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/mark1.gif Binary file client/digitallibrary/oldskin/buttons/mark1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/matrix0.gif Binary file client/digitallibrary/oldskin/buttons/matrix0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/matrix1.gif Binary file client/digitallibrary/oldskin/buttons/matrix1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/menu.js --- a/client/digitallibrary/oldskin/buttons/menu.js Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,240 +0,0 @@ -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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/moveto0.gif Binary file client/digitallibrary/oldskin/buttons/moveto0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/moveto1.gif Binary file client/digitallibrary/oldskin/buttons/moveto1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/newwindow0.gif Binary file client/digitallibrary/oldskin/buttons/newwindow0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/newwindow1.gif Binary file client/digitallibrary/oldskin/buttons/newwindow1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/next0.gif Binary file client/digitallibrary/oldskin/buttons/next0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/next1.gif Binary file client/digitallibrary/oldskin/buttons/next1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/nomark.gif Binary file client/digitallibrary/oldskin/buttons/nomark.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/page0.gif Binary file client/digitallibrary/oldskin/buttons/page0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/page1.gif Binary file client/digitallibrary/oldskin/buttons/page1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/questionmark0.gif Binary file client/digitallibrary/oldskin/buttons/questionmark0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/questionmark1.gif Binary file client/digitallibrary/oldskin/buttons/questionmark1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/reference0.gif Binary file client/digitallibrary/oldskin/buttons/reference0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/reference1.gif Binary file client/digitallibrary/oldskin/buttons/reference1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/refresh0.gif Binary file client/digitallibrary/oldskin/buttons/refresh0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/refresh1.gif Binary file client/digitallibrary/oldskin/buttons/refresh1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/relation0.gif Binary file client/digitallibrary/oldskin/buttons/relation0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/relation1.gif Binary file client/digitallibrary/oldskin/buttons/relation1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/scale0.gif Binary file client/digitallibrary/oldskin/buttons/scale0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/scale1.gif Binary file client/digitallibrary/oldskin/buttons/scale1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/spacer.gif Binary file client/digitallibrary/oldskin/buttons/spacer.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/type0.gif Binary file client/digitallibrary/oldskin/buttons/type0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/type1.gif Binary file client/digitallibrary/oldskin/buttons/type1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/work0.gif Binary file client/digitallibrary/oldskin/buttons/work0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/work1.gif Binary file client/digitallibrary/oldskin/buttons/work1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/zoomarea0.gif Binary file client/digitallibrary/oldskin/buttons/zoomarea0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/zoomarea1.gif Binary file client/digitallibrary/oldskin/buttons/zoomarea1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/zoomin0.gif Binary file client/digitallibrary/oldskin/buttons/zoomin0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/zoomin1.gif Binary file client/digitallibrary/oldskin/buttons/zoomin1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/zoomout0.gif Binary file client/digitallibrary/oldskin/buttons/zoomout0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/zoomout1.gif Binary file client/digitallibrary/oldskin/buttons/zoomout1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/zoompoint0.gif Binary file client/digitallibrary/oldskin/buttons/zoompoint0.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/buttons/zoompoint1.gif Binary file client/digitallibrary/oldskin/buttons/zoompoint1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/dcMain.jsp --- a/client/digitallibrary/oldskin/dcMain.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -<%@ 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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/dcMenu.html --- a/client/digitallibrary/oldskin/dcMenu.html Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ - - - - - - - - -
-

-
- - - - - - - - - - - - - - - \ No newline at end of file diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/dclib.js --- a/client/digitallibrary/oldskin/dclib.js Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* -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 cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/dlMenu.html --- a/client/digitallibrary/oldskin/dlMenu.html Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,151 +0,0 @@ - - - - - - - - - - -
-
-
-

-
-

-
-
-
-

-

-

- - - - - - - - - - - - - - - - - - - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/oldskin/pageWin.html --- a/client/digitallibrary/oldskin/pageWin.html Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - - - - -

- -

- - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/pdf/error.jsp --- a/client/digitallibrary/pdf/error.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="ISO-8859-1"%> - - - - -Error - - -

Error

-There was an error while processing your request. Please check the parameters and try again. - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/pdf/wip.jsp --- a/client/digitallibrary/pdf/wip.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="ISO-8859-1"%> - - - - - -Work in progress ... - - -

Please wait ...

-your request is being processed. The download starts automatically when the document is finished. - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/server/dlCache.jsp --- a/client/digitallibrary/server/dlCache.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -<%@ 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); - } -} -%> - -<% -// get digilib config -digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig(); -// dir cache -digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache"); -%> - - - -Digilib cache info - - -

Digilib cache info

- - - - - - - - - - - - - - - - - - - -
size (directories)<%= dirCache.size() %>
numFiles<%= dirCache.getNumFiles() %>
hits<%= dirCache.getHits() %>
misses<%= dirCache.getMisses() %>
- - -<% - Object[] keys = dirCache.getChildren("", true).toArray(); - java.util.Arrays.sort(keys); - int l = keys.length; - for (int i = 0; i < l; i++) { - String key = (String) keys[i]; - // digilib.io.DocuDirectory val = (digilib.io.DocuDirectory) dirCache.getDirectory(key); -%> - - - - -<% - } -%> -
<%= key %><%= 1 /* val.getDirName() */ %>
- - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/server/dlConfig.jsp --- a/client/digitallibrary/server/dlConfig.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,156 +0,0 @@ -<%@page import="digilib.util.DigilibJobCenter"%> -<%@ 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); - } -} -%> - -<% -// get digilib config -digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig(); -// parsing the query -digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); -// add number of pages -dlRequest.setValue("pt", docBean.getNumPages(dlRequest)); -// dir cache -digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache"); -// image JobCenter -DigilibJobCenter imageProcessor = (DigilibJobCenter)dlConfig.getValue("servlet.worker.imageexecutor"); - -%> - - - -Digilib configuration page - - - -

Global servlet configuration

- - -<% - Object[] keys = dlConfig.getParams().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 = dlConfig.getAsString(key); - if (key.equals("basedir-list")) { - String[] bd = (String[]) dlConfig.getValue("basedir-list"); - val = ""; - if (bd != null) { - for (int j = 0; j < bd.length; j++) { - val += bd[j] + "
"; - } - } - } - if (val.length() == 0) { - val = "(none)"; - } -%> - - - - -<% - } -%> -
<%= key %><%= val %>
- -

Threads

- - - - - - - - - - -
currently waiting<%= imageProcessor.getWaitingJobs() %>
currently running<%= imageProcessor.getRunningJobs() %>
- -

Directory cache

- - - - - - - - - - - - - - - - - - -
size (directories)<%= dirCache.size() %>
numFiles<%= dirCache.getNumFiles() %>
hits<%= dirCache.getHits() %>
misses<%= dirCache.getMisses() %>
- -

JVM configuration

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
java.awt.headless<%= System.getProperty("java.awt.headless") %>
java.version<%= System.getProperty("java.version") %>
java.vendor<%= System.getProperty("java.vendor") %>
os.name<%= System.getProperty("os.name") %>
Runtime.maxMemory<%= Runtime.getRuntime().maxMemory() %>
Runtime.totalMemory<%= Runtime.getRuntime().totalMemory() %>
Runtime.freeMemory<%= Runtime.getRuntime().freeMemory() %>
- -

DocuImage configuration

- -

Supported image types

-
    -<% - java.util.Iterator dlfs = dlConfig.getDocuImageInstance().getSupportedFormats(); - for (Object f = dlfs.next(); dlfs.hasNext(); f = dlfs.next()) { -%> -
  • <%= (String)f %>
  • -<% - } -%> -
- - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/digitallibrary/server/dlRequest.jsp --- a/client/digitallibrary/server/dlRequest.jsp Tue Jan 18 12:58:09 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -<%@ 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); - } -} -%> - -<% -// get digilib config -digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig(); -// parsing the query -digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); -// add number of pages -dlRequest.setValue("pt", docBean.getNumPages(dlRequest)); -// dir cache -digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache"); -%> - - - -Digilib configuration page - - - -

Local request information

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Pt<%= dlRequest.getAsString("pt") %>total number of pages (generated by servlet)
RequestPath<%= dlRequest.getAsString("request.path") %>url of the page/document
Fn<%= dlRequest.getAsString("fn") %>url of the page/document
FilePath<%= dlRequest.getFilePath() %>effective path of the page/document
Pn<%= dlRequest.getAsString("pn") %>page number
Dw<%= dlRequest.getAsString("dw") %>width of client in pixels
Dh<%= dlRequest.getAsString("dh") %>height of client in pixels
Wx<%= dlRequest.getAsString("wx") %>left edge of image (float from 0 to 1)
Wy<%= dlRequest.getAsString("wy") %>top edge in image (float from 0 to 1)
Ww<%= dlRequest.getAsString("ww") %>width of image (float from 0 to 1)
Wh<%= dlRequest.getAsString("wh") %>height of image (float from 0 to 1)
Ws<%= dlRequest.getAsString("ws") %>scale factor
Mo<%= dlRequest.getAsString("mo") %>special options like 'fit' for gifs
Mk<%= dlRequest.getAsString("mk") %>marks
BaseURL<%= dlRequest.getAsString("base.url") %>
base URL (from http:// to below /servlet)
- -

All parameters

- - -<% - Object[] keys = dlRequest.getParams().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 = "(none)"; - } -%> - - - - -<% - } -%> -
<%= key %><%= val %><% if (! dlRequest.hasValue(key)) { %> (default) <% } %>
- - - - diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/pom.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/pom.xml Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,30 @@ + + + 4.0.0 + + digilib + digilib + 2.0-SNAPSHOT + + digilib + digilib-webapp + 2.0-SNAPSHOT + digilib-webapp + The Digital Image Library - Client + http://digilib.berlios.de + war + + + UTF-8 + + + + + digilib + digilib-servlet + jar + compile + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/ImgInfo-json.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/ImgInfo-json.jsp Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,44 @@ +<%@page language="java" + import="digilib.io.FileOps, digilib.io.ImageFileSet, digilib.io.ImageFile, + digilib.util.ImageSize, digilib.servlet.DigilibConfiguration" + contentType="application/json"%><%! +// 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); +// dir cache +digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig(); +digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache"); +// get file +FileOps.FileClass fc = FileOps.FileClass.IMAGE; +ImageFileSet imgFile = (ImageFileSet) dirCache.getFile(dlRequest.getFilePath(), dlRequest.getAsInt("pn"), fc); + +%>{ <% + if (imgFile != null) { + ImageFile img = (ImageFile) imgFile.getBiggest(); + ImageSize imgSize = img.getSize(); + %> + "filename" : "<%= imgFile.getName() %>", + "aspect" : <%= imgFile.getAspect() %>, + "dpi_x" : <%= imgFile.getResX() %>, + "dpi_y" : <%= imgFile.getResY() %><% + + if (imgSize != null) { + %>, + "width" : <%= imgSize.getWidth() %>, + "height" : <%= imgSize.getHeight() %> +<% } + } +%>} diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/WEB-INF/digilib-auth.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/WEB-INF/digilib-auth.xml Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,27 @@ + + + + + + + + + + + + +
+
+
+ + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/WEB-INF/digilib-config.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/WEB-INF/digilib-config.xml Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/WEB-INF/digilib-map.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/WEB-INF/digilib-map.xml Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/WEB-INF/log4j-config.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/WEB-INF/log4j-config.xml Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/WEB-INF/web-3.0.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/WEB-INF/web-3.0.xml Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,145 @@ + + + + + + digilib + + + This is the web frontend of the Digital Document Library. + + + + + digilib.servlet.Initialiser + + + + + + Scaler + + + digilib.servlet.Scaler + + + + 5 + + + + + + Texter + + + digilib.servlet.Texter + + + + + + PDFCache + + + digilib.servlet.PDFCache + + + + + + Scaler + + + /servlet/Scaler/* + + + + + Scaler + + + /Scaler + + + + + Scaler + + + /authenticated/servlet/Scaler/* + + + + + + Texter + + + /servlet/Texter/* + + + + + Texter + + + /authenticated/servlet/Texter/* + + + + + + PDFCache + + + /servlet/PDFCache/* + + + + + PDFCache + + + /authenticated/servlet/PDFCache/* + + + + + + + Authenticated Digilib + + + /authenticated/* + + + + + + + + + FORM + + + + /digilib-login.html + + + /digilib-fail.html + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/WEB-INF/web.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/WEB-INF/web.xml Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,142 @@ + + + + + + + digilib + + + This is the web frontend of the Digital Document Library. + + + + + digilib.servlet.Initialiser + + + + + + Scaler + + + digilib.servlet.ScalerNoAsync + + + + 5 + + + + + + Texter + + + digilib.servlet.Texter + + + + + + PDFCache + + + digilib.servlet.PDFCache + + + + + + Scaler + + + /servlet/Scaler/* + + + + + Scaler + + + /Scaler + + + + + Scaler + + + /authenticated/servlet/Scaler/* + + + + + + Texter + + + /servlet/Texter/* + + + + + Texter + + + /authenticated/servlet/Texter/* + + + + + + PDFCache + + + /servlet/PDFCache/* + + + + + PDFCache + + + /authenticated/servlet/PDFCache/* + + + + + + + Authenticated Digilib + + + /authenticated/* + + + + + + + + + FORM + + + + /digilib-login.html + + + /digilib-fail.html + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/baselib.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/baselib.js Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/digicat.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/digicat.html Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/digicat.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/digicat.jsp Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/digilib-fail.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/digilib-fail.html Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/digilib-login.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/digilib-login.html Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/digilib.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/digilib.html Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/digilib.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/digilib.jsp Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/digimage.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/digimage.jsp Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/digimage_img_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/digimage_img_inc.jsp Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/digimage_tbl_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/digimage_tbl_inc.jsp Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/dirInfo-xml.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/dirInfo-xml.jsp Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,47 @@ +<%@page import="digilib.io.FileOps"%><%@ 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()); +FileOps.FileClass fc = FileOps.FileClass.IMAGE; +int dirSize = dir.size(fc); + +%> +<% if (dir != null) { %> + <%= dirSize %> + <%= dir.getDirName() %> + <%= dir.getDir().getPath() %> +<% + if (!dlRequest.hasOption("mo", "dir")) { + for (int i = 0; i < dirSize; i++) { + digilib.io.DocuDirent f = dir.get(i, fc); + String fn = (f != null) ? f.getName() : "null"; +%> + <%= i+1 %> + <%= digilib.io.FileOps.basename(fn) %> + <%= fn %> + +<% + } // for + } // if not dironly + } // if dir +%> diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/dlContext-xml.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/dlContext-xml.jsp Tue Apr 26 11:38:11 2011 +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.FileClass.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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/dlInfo-json.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/dlInfo-json.jsp Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,36 @@ +<%@ 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); +%> +// JSON format metadata about request and image +{ +<% + Object[] keys = dlRequest.getParams().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 = ""; + } + %>"<%= key %>" : "<%= val %>", +<% + } +%> +} diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/dlInfo-xml.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/dlInfo-xml.jsp Tue Apr 26 11:38:11 2011 +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.getParams().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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/dllib.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/dllib.js Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/empty.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/empty.html Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,8 @@ + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/Thumbs.db Binary file client/src/main/webapp/greyskin/Thumbs.db has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/back.png Binary file client/src/main/webapp/greyskin/back.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/back.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/back.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/baselib.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/baselib.js Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/bg.png Binary file client/src/main/webapp/greyskin/bg.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/bg.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/bg.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,63 @@ + + + + + + + + + image/svg+xml + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/birds-eye.png Binary file client/src/main/webapp/greyskin/birds-eye.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/birds-eye.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/birds-eye.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/blue.png Binary file client/src/main/webapp/greyskin/blue.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/brightness-on.png Binary file client/src/main/webapp/greyskin/brightness-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/brightness-on.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/brightness-on.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/brightness.png Binary file client/src/main/webapp/greyskin/brightness.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/brightness.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/brightness.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/calibration-x.png Binary file client/src/main/webapp/greyskin/calibration-x.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/calibration-x.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/calibration-x.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/calibration-y.png Binary file client/src/main/webapp/greyskin/calibration-y.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/calibration-y.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/calibration-y.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/cat.png Binary file client/src/main/webapp/greyskin/cat.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/cat.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/cat.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/contrast-on.png Binary file client/src/main/webapp/greyskin/contrast-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/contrast-on.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/contrast-on.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/contrast.png Binary file client/src/main/webapp/greyskin/contrast.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/contrast.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/contrast.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/corona.png Binary file client/src/main/webapp/greyskin/corona.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/corona.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/corona.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,214 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/debug.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/debug.js Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/delmark.png Binary file client/src/main/webapp/greyskin/delmark.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/delmark.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/delmark.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + 1 + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/diginew.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/diginew.css Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/diginew.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/diginew.jsp Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/dlMenu.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/dlMenu.html Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,175 @@ + + + + + + + + + + +
+
+
+

+
+

+
+
+
+

+

+

+ + + + + + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/dllib.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/dllib.js Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/down.png Binary file client/src/main/webapp/greyskin/down.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/down.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/down.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/first.png Binary file client/src/main/webapp/greyskin/first.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/first.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/first.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/firstlast.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/firstlast.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/fixed.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/fixed.js Tue Apr 26 11:38:11 2011 +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 cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/help.png Binary file client/src/main/webapp/greyskin/help.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/help.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/help.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + ? + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/last.png Binary file client/src/main/webapp/greyskin/last.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/last.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/last.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/left.png Binary file client/src/main/webapp/greyskin/left.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/left.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/left.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mark-bg-16.png Binary file client/src/main/webapp/greyskin/mark-bg-16.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mark-bg.png Binary file client/src/main/webapp/greyskin/mark-bg.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mark-bg.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/mark-bg.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mark-bg_old.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/mark-bg_old.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mark.png Binary file client/src/main/webapp/greyskin/mark.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mark.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/mark.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + 1 + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mirror-horizontal-on.png Binary file client/src/main/webapp/greyskin/mirror-horizontal-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mirror-horizontal-on.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/mirror-horizontal-on.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mirror-horizontal.png Binary file client/src/main/webapp/greyskin/mirror-horizontal.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mirror-horizontal.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/mirror-horizontal.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mirror-vertical-on.png Binary file client/src/main/webapp/greyskin/mirror-vertical-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mirror-vertical-on.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/mirror-vertical-on.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mirror-vertical.png Binary file client/src/main/webapp/greyskin/mirror-vertical.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mirror-vertical.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/mirror-vertical.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/mirror.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/mirror.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/options.png Binary file client/src/main/webapp/greyskin/options.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/options.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/options.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/original-size.png Binary file client/src/main/webapp/greyskin/original-size.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/original-size.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/original-size.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + 1 + 1 + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/page.png Binary file client/src/main/webapp/greyskin/page.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/page.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/page.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/pagewidth.png Binary file client/src/main/webapp/greyskin/pagewidth.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/pagewidth.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/pagewidth.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/pixel-by-pixel.png Binary file client/src/main/webapp/greyskin/pixel-by-pixel.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/pixel-by-pixel.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/pixel-by-pixel.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/quality.png Binary file client/src/main/webapp/greyskin/quality.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/quality.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/quality.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + Q + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/reference.png Binary file client/src/main/webapp/greyskin/reference.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/reference.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/reference.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + http: + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/reset.png Binary file client/src/main/webapp/greyskin/reset.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/reset.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/reset.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/rgb-on.png Binary file client/src/main/webapp/greyskin/rgb-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/rgb-on.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/rgb-on.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/rgb.png Binary file client/src/main/webapp/greyskin/rgb.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/rgb.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/rgb.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/right.png Binary file client/src/main/webapp/greyskin/right.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/right.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/right.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/rightleft.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/rightleft.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/rotate-on.png Binary file client/src/main/webapp/greyskin/rotate-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/rotate-on.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/rotate-on.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/rotate.png Binary file client/src/main/webapp/greyskin/rotate.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/rotate.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/rotate.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/ruler-top.gif Binary file client/src/main/webapp/greyskin/ruler-top.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/size.png Binary file client/src/main/webapp/greyskin/size.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/size.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/size.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/trans.gif Binary file client/src/main/webapp/greyskin/trans.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/up.png Binary file client/src/main/webapp/greyskin/up.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/up.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/up.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/zoom-area.png Binary file client/src/main/webapp/greyskin/zoom-area.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/zoom-area.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/zoom-area.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/zoom-full.png Binary file client/src/main/webapp/greyskin/zoom-full.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/zoom-full.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/zoom-full.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/zoom-in.png Binary file client/src/main/webapp/greyskin/zoom-in.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/zoom-in.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/zoom-in.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/zoom-out.png Binary file client/src/main/webapp/greyskin/zoom-out.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/greyskin/zoom-out.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/greyskin/zoom-out.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/Thumbs.db Binary file client/src/main/webapp/img/Thumbs.db has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/digilib-denied.png Binary file client/src/main/webapp/img/digilib-denied.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/digilib-denied.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/img/digilib-denied.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,239 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/digilib-error.png Binary file client/src/main/webapp/img/digilib-error.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/digilib-error.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/img/digilib-error.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,234 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + ! + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/digilib-logo-small.png Binary file client/src/main/webapp/img/digilib-logo-small.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/digilib-logo-sw.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/img/digilib-logo-sw.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,219 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/digilib-logo-text1.png Binary file client/src/main/webapp/img/digilib-logo-text1.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/digilib-logo.png Binary file client/src/main/webapp/img/digilib-logo.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/digilib-logo.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/img/digilib-logo.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,219 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/digilib-notfound.png Binary file client/src/main/webapp/img/digilib-notfound.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/digilib-notfound.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/img/digilib-notfound.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,230 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + ? + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/down.gif Binary file client/src/main/webapp/img/down.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/left.gif Binary file client/src/main/webapp/img/left.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/mark1.gif Binary file client/src/main/webapp/img/mark1.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/mark2.gif Binary file client/src/main/webapp/img/mark2.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/mark3.gif Binary file client/src/main/webapp/img/mark3.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/mark4.gif Binary file client/src/main/webapp/img/mark4.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/mark5.gif Binary file client/src/main/webapp/img/mark5.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/mark6.gif Binary file client/src/main/webapp/img/mark6.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/mark7.gif Binary file client/src/main/webapp/img/mark7.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/mark8.gif Binary file client/src/main/webapp/img/mark8.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/olinks.gif Binary file client/src/main/webapp/img/olinks.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/orechts.gif Binary file client/src/main/webapp/img/orechts.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/right.gif Binary file client/src/main/webapp/img/right.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/ulinks.gif Binary file client/src/main/webapp/img/ulinks.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/up.gif Binary file client/src/main/webapp/img/up.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/img/urechts.gif Binary file client/src/main/webapp/img/urechts.gif has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/combiner-0.0.1.jar Binary file client/src/main/webapp/jquery/combiner-0.0.1.jar has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/digilib.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/jquery/digilib.html Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,43 @@ + + + + + + Digilib jQuery: fullscreen + + + + + + + + + + + + + + + + +
+

digilib doesn't work! Please switch on Javascript or notify the server administrator!

+ +
+ + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/dlGeometry.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/jquery/dlGeometry.js Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,486 @@ +/* digilib geometry classes + * should be integrated into jquery.digilib.js + */ + +var dlGeometry = function() { + /* + * Size class + */ + var size = function(w, h) { + var that; + if (typeof w === "object") { + // assume its size + that = { + width : w.width, + height : w.height + }; + } else { + that = { + width : parseFloat(w), + height : parseFloat(h) + }; + } + that.equals = function(other) { + return (this.width === other.width && this.height === other.height); + }; + that.toString = function() { + return (this.width + "x" + this.height); + }; + return that; + }; + + /* + * Position class + */ + var position = function(x, y) { + var that; + if (typeof x === "object") { + if (x instanceof jQuery) { + // jQuery object + var pos = x.offset(); + that = { + x : pos.left, + y : pos.top + }; + } else { + if (x.x != null) { + // position object + that = { + x : x.x, + y : x.y + }; + } + if (x.pageX != null) { + // event object + that = { + x : x.pageX, + y : x.pageY + }; + } + } + } else { + that = { + x : parseFloat(x), + y : parseFloat(y) + }; + } + that.equals = function(other) { + return (this.x === other.x && this.y === other.y); + }; + // add position other to this + that.add = function(other) { + this.x += other.x; + this.y += other.y; + return this; + }; + // returns negative position + that.neg = function() { + return position({ + x : -this.x, + y : -this.y + }); + }; + // returns new position that is the difference between this and other + that.delta = function(other) { + return position({ + x : other.x - this.x, + y : other.y - this.y + }); + }; + // adjusts position $elem to this position + that.adjustDiv = function($elem) { + $elem.offset({ + left : this.x, + top : this.y + }); + }; + // returns distance of this position to pos (length if pos == null) + that.distance = function(pos) { + if (pos == null) { + pos = { + x : 0, + y : 0 + }; + } + var dx = pos.x - this.x; + var dy = pos.y - this.y; + return Math.sqrt(dx * dx + dy * dy); + }; + that.toString = function() { + return (this.x + "," + this.y); + }; + return that; + }; + /* + * Rectangle class + */ + var rectangle = function(x, y, w, h) { + var that = {}; + if (typeof x === "object") { + if (x instanceof jQuery) { + // jQuery object + var pos = x.offset(); + that = { + x : pos.left, + y : pos.top, + width : x.width(), + height : x.height() + }; + } else if (y == null) { + // assume x is rectangle + that = { + x : x.x, + y : x.y, + width : x.width, + height : x.height + }; + } else { + // assume x and y are Position + that = { + x : Math.min(x.x, y.x), + y : Math.min(x.y, y.y), + width : Math.abs(y.x - x.x), + height : Math.abs(y.y - x.y) + }; + } + } else { + that = { + x : parseFloat(x), + y : parseFloat(y), + width : parseFloat(w), + height : parseFloat(h) + }; + } + // returns a copy of this Rectangle + that.copy = function() { + return rectangle(this); + }; + // returns the position of this Rectangle + that.getPosition = function() { + return position(this); + }; + // returns the size of this Rectangle + that.getSize = function() { + return size(this); + }; + // returns the upper left corner position + that.getPt1 = that.getPosition; + // returns the lower right corner position of this Rectangle + that.getPt2 = function() { + return position({ + x : this.x + this.width, + y : this.y + this.height + }); + }; + // sets the upper left corner position to pos + that.setPosition = function(pos) { + this.x = pos.x; + this.y = pos.y; + return this; + }; + that.setPt1 = that.setPosition; // TODO: not really the same + // adds pos to the position + that.addPosition = function(pos) { + this.x += pos.x; + this.y += pos.y; + return this; + }; + // sets the lower right corner to position pos + that.setPt2 = function(pos) { + this.width = pos.x - this.x; + this.height = pos.y - this.y; + return this; + }; + // returns the center position of this Rectangle + that.getCenter = function() { + return position({ + x : this.x + this.width / 2, + y : this.y + this.height / 2 + }); + }; + // moves this Rectangle's center to position pos + that.setCenter = function(pos) { + this.x = pos.x - this.width / 2; + this.y = pos.y - this.height / 2; + return this; + }; + that.equals = function(other) { + // equal props + var eq = (this.x === other.x && this.y === other.y && this.width === other.width); + return eq; + }; + // returns the area of this Rectangle + that.getArea = function() { + return (this.width * this.height); + }; + // eliminates negative width and height + that.normalize = function() { + 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; + }; + // returns if Position "pos" lies inside of this rectangle + that.containsPosition = function(pos) { + var ct = ((pos.x >= this.x) && (pos.y >= this.y) + && (pos.x <= this.x + this.width) && (pos.y <= this.y + + this.height)); + return ct; + }; + // returns if rectangle "rect" is contained in this rectangle + that.containsRect = function(rect) { + return (this.containsPosition(rect.getPt1()) && this + .containsPosition(rect.getPt2())); + }; + // changes this rectangle's x/y values so it stays inside of rectangle + // rect + // keeping the proportions + that.stayInside = function(rect) { + 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; + }; + // clips this rectangle so it stays inside of rectangle rect + that.clipTo = function(rect) { + var p1 = rect.getPt1(); + var p2 = rect.getPt2(); + var this2 = this.getPt2(); + this.setPosition(position(Math.max(this.x, p1.x), Math.max(this.y, p1.y))); + this.setPt2(position(Math.min(this2.x, p2.x), Math.min(this2.y, p2.y))); + return this; + }; + // returns the intersection of the given Rectangle and this one + that.intersect = function(rect) { + // 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; + }; + // returns a Rectangle that fits into this one (by moving first) + that.fit = function(rect) { + 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); + }; + // adjusts position and size of $elem to this rectangle + that.adjustDiv = function($elem) { + $elem.offset({ + left : this.x, + top : this.y + }); + $elem.width(this.width).height(this.height); + }; + // returns size and position in css-compatible format + that.getAsCss = function() { + return { + left : this.x, + top : this.y, + width : this.width, + height : this.height + }; + }; + that.toString = function() { + return this.width + "x" + this.height + "@" + this.x + "," + this.y; + }; + return that; + }; + + /* + * Transform class + * + * defines a class of affine transformations + */ + var transform = function(spec) { + var that = { + m00 : 1.0, + m01 : 0.0, + m02 : 0.0, + m10 : 0.0, + m11 : 1.0, + m12 : 0.0, + m20 : 0.0, + m21 : 0.0, + m22 : 1.0 + }; + if (spec) { + jQuery.extend(that, spec); + } + ; + that.concat = function(trafA) { + // add Transform trafA to this Transform (i.e. this = trafC = trafA + // * this) + var trafC = {}; + 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 += trafA["m" + i + k] * this["m" + k + j]; + } + trafC["m" + i + j] = c; + } + } + jQuery.extend(this, trafC); + return this; + }; + that.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; + var pt = position(x, y); + if (rect.width) { + // transform the other corner point + var pt2 = this.transform(rect.getPt2()); + return rectangle(pt, pt2); + } + return pt; + }; + that.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; + var pt = position(x, y); + if (rect.width) { + // transform the other corner point + var pt2 = this.invtransform(rect.getPt2()); + return rectangle(pt, pt2); + } + return pt; + }; + that.toString = function(pretty) { + var s = '['; + if (pretty) + s += '\n'; + for ( var i = 0; i < 3; ++i) { + s += '['; + for ( var j = 0; j < 3; ++j) { + if (j) + s += ','; + s += this['m' + i + j]; + } + s += ']'; + if (pretty) + s += '\n'; + } + s += ']'; + if (pretty) + s += '\n'; + return s; + }; + // add class methods to instance + that.getRotation = transform.getRotation; + that.getRotationAround = transform.getRotationAround; + that.getTranslation = transform.getTranslation; + that.getMirror = transform.getMirror; + that.getScale = transform.getScale; + + return that; + }; + + transform.getRotation = function(angle) { + // returns a Transform that is a rotation by angle degrees around [0,0] + if (angle !== 0) { + var t = Math.PI * parseFloat(angle) / 180.0; + var cost = Math.cos(t); + var sint = Math.sin(t); + var traf = { + m00 : cost, + m01 : -sint, + m10 : sint, + m11 : cost + }; + return transform(traf); + } + return transform(); + }; + + transform.getRotationAround = function(angle, pos) { + // returns a Transform that is a rotation by angle degrees around pos + var traf = transform.getTranslation(pos.neg()); + traf.concat(transform.getRotation(angle)); + traf.concat(transform.getTranslation(pos)); + return traf; + }; + + transform.getTranslation = function(pos) { + // returns a Transform that is a translation by [pos.x, pos,y] + var traf = { + m02 : pos.x, + m12 : pos.y + }; + return transform(traf); + }; + + transform.getMirror = function(type) { + // returns a Transform that is a mirror about the axis type + if (type === 'x') { + var traf = { + m00 : 1, + m11 : -1 + }; + } else { + var traf = { + m00 : -1, + m11 : 1 + }; + } + return transform(traf); + }; + + transform.getScale = function(size) { + // returns a Transform that is a scale by [size.width, size.height] + var traf = { + m00 : size.width, + m11 : size.height + }; + return transform(traf); + }; + + // export functions + var that = { + size : size, + position : position, + rectangle : rectangle, + transform : transform + }; + + return that; +}; diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/jquery/img/embedded.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,1081 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/addregion.png Binary file client/src/main/webapp/jquery/img/embedded/16/addregion.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/back.png Binary file client/src/main/webapp/jquery/img/embedded/16/back.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/birds-eye.png Binary file client/src/main/webapp/jquery/img/embedded/16/birds-eye.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/brightness.png Binary file client/src/main/webapp/jquery/img/embedded/16/brightness.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/calibration-x.png Binary file client/src/main/webapp/jquery/img/embedded/16/calibration-x.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/calibration-y.png Binary file client/src/main/webapp/jquery/img/embedded/16/calibration-y.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/cat.png Binary file client/src/main/webapp/jquery/img/embedded/16/cat.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/contrast.png Binary file client/src/main/webapp/jquery/img/embedded/16/contrast.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/delmark.png Binary file client/src/main/webapp/jquery/img/embedded/16/delmark.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/delregion.png Binary file client/src/main/webapp/jquery/img/embedded/16/delregion.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/down.png Binary file client/src/main/webapp/jquery/img/embedded/16/down.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/fonds.png Binary file client/src/main/webapp/jquery/img/embedded/16/fonds.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/fwd.png Binary file client/src/main/webapp/jquery/img/embedded/16/fwd.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/help.png Binary file client/src/main/webapp/jquery/img/embedded/16/help.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/left.png Binary file client/src/main/webapp/jquery/img/embedded/16/left.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/mark.png Binary file client/src/main/webapp/jquery/img/embedded/16/mark.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/mirror-horizontal.png Binary file client/src/main/webapp/jquery/img/embedded/16/mirror-horizontal.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/mirror-vertical.png Binary file client/src/main/webapp/jquery/img/embedded/16/mirror-vertical.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/options.png Binary file client/src/main/webapp/jquery/img/embedded/16/options.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/original-size.png Binary file client/src/main/webapp/jquery/img/embedded/16/original-size.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/page.png Binary file client/src/main/webapp/jquery/img/embedded/16/page.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/pagewidth.png Binary file client/src/main/webapp/jquery/img/embedded/16/pagewidth.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/pixel-by-pixel.png Binary file client/src/main/webapp/jquery/img/embedded/16/pixel-by-pixel.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/quality.png Binary file client/src/main/webapp/jquery/img/embedded/16/quality.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/reference.png Binary file client/src/main/webapp/jquery/img/embedded/16/reference.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/regioninfo.png Binary file client/src/main/webapp/jquery/img/embedded/16/regioninfo.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/regions.png Binary file client/src/main/webapp/jquery/img/embedded/16/regions.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/reset.png Binary file client/src/main/webapp/jquery/img/embedded/16/reset.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/rgb.png Binary file client/src/main/webapp/jquery/img/embedded/16/rgb.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/right.png Binary file client/src/main/webapp/jquery/img/embedded/16/right.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/rotate.png Binary file client/src/main/webapp/jquery/img/embedded/16/rotate.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/size.png Binary file client/src/main/webapp/jquery/img/embedded/16/size.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/up.png Binary file client/src/main/webapp/jquery/img/embedded/16/up.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/zoom-area.png Binary file client/src/main/webapp/jquery/img/embedded/16/zoom-area.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/zoom-full.png Binary file client/src/main/webapp/jquery/img/embedded/16/zoom-full.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/zoom-in.png Binary file client/src/main/webapp/jquery/img/embedded/16/zoom-in.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/16/zoom-out.png Binary file client/src/main/webapp/jquery/img/embedded/16/zoom-out.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/addregion.png Binary file client/src/main/webapp/jquery/img/embedded/32/addregion.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/back.png Binary file client/src/main/webapp/jquery/img/embedded/32/back.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/birds-eye.png Binary file client/src/main/webapp/jquery/img/embedded/32/birds-eye.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/brightness.png Binary file client/src/main/webapp/jquery/img/embedded/32/brightness.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/calibration-x.png Binary file client/src/main/webapp/jquery/img/embedded/32/calibration-x.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/calibration-y.png Binary file client/src/main/webapp/jquery/img/embedded/32/calibration-y.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/cat.png Binary file client/src/main/webapp/jquery/img/embedded/32/cat.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/contrast.png Binary file client/src/main/webapp/jquery/img/embedded/32/contrast.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/delmark.png Binary file client/src/main/webapp/jquery/img/embedded/32/delmark.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/delregion.png Binary file client/src/main/webapp/jquery/img/embedded/32/delregion.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/down.png Binary file client/src/main/webapp/jquery/img/embedded/32/down.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/fonds.png Binary file client/src/main/webapp/jquery/img/embedded/32/fonds.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/fwd.png Binary file client/src/main/webapp/jquery/img/embedded/32/fwd.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/help.png Binary file client/src/main/webapp/jquery/img/embedded/32/help.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/left.png Binary file client/src/main/webapp/jquery/img/embedded/32/left.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/mark.png Binary file client/src/main/webapp/jquery/img/embedded/32/mark.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/mirror-horizontal.png Binary file client/src/main/webapp/jquery/img/embedded/32/mirror-horizontal.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/mirror-vertical.png Binary file client/src/main/webapp/jquery/img/embedded/32/mirror-vertical.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/options.png Binary file client/src/main/webapp/jquery/img/embedded/32/options.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/original-size.png Binary file client/src/main/webapp/jquery/img/embedded/32/original-size.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/page.png Binary file client/src/main/webapp/jquery/img/embedded/32/page.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/pagewidth.png Binary file client/src/main/webapp/jquery/img/embedded/32/pagewidth.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/pixel-by-pixel.png Binary file client/src/main/webapp/jquery/img/embedded/32/pixel-by-pixel.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/quality.png Binary file client/src/main/webapp/jquery/img/embedded/32/quality.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/reference.png Binary file client/src/main/webapp/jquery/img/embedded/32/reference.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/regioninfo.png Binary file client/src/main/webapp/jquery/img/embedded/32/regioninfo.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/regions.png Binary file client/src/main/webapp/jquery/img/embedded/32/regions.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/reset.png Binary file client/src/main/webapp/jquery/img/embedded/32/reset.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/rgb.png Binary file client/src/main/webapp/jquery/img/embedded/32/rgb.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/right.png Binary file client/src/main/webapp/jquery/img/embedded/32/right.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/rotate.png Binary file client/src/main/webapp/jquery/img/embedded/32/rotate.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/size.png Binary file client/src/main/webapp/jquery/img/embedded/32/size.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/up.png Binary file client/src/main/webapp/jquery/img/embedded/32/up.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/zoom-area.png Binary file client/src/main/webapp/jquery/img/embedded/32/zoom-area.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/zoom-full.png Binary file client/src/main/webapp/jquery/img/embedded/32/zoom-full.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/zoom-in.png Binary file client/src/main/webapp/jquery/img/embedded/32/zoom-in.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/32/zoom-out.png Binary file client/src/main/webapp/jquery/img/embedded/32/zoom-out.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded/Thumbs.db Binary file client/src/main/webapp/jquery/img/embedded/Thumbs.db has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded_icons.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/jquery/img/embedded_icons.cmd Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,14 @@ +rem @echo off +setlocal + +rem saxon embedded.svg embedded_icons.xsl + +set ink=C:\prog_mr\inkscape-0.48.1\inkscape.exe + +for %%f in (embedded\svg\*.svg) do ( + echo %%~nf + %ink% %%f --export-png=embedded\16\%%~nf.png -w16 -h16 + %ink% %%f --export-png=embedded\32\%%~nf.png -w32 -h32 + ) + +endlocal \ No newline at end of file diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/embedded_icons.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/jquery/img/embedded_icons.xsl Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + display:inline + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/jquery/img/fullscreen.svg Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,1166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/addregion.png Binary file client/src/main/webapp/jquery/img/fullscreen/addregion.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/back.png Binary file client/src/main/webapp/jquery/img/fullscreen/back.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/bg.png Binary file client/src/main/webapp/jquery/img/fullscreen/bg.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/birds-eye.png Binary file client/src/main/webapp/jquery/img/fullscreen/birds-eye.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/blue.png Binary file client/src/main/webapp/jquery/img/fullscreen/blue.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/brightness-on.png Binary file client/src/main/webapp/jquery/img/fullscreen/brightness-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/brightness.png Binary file client/src/main/webapp/jquery/img/fullscreen/brightness.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/calibration-x.png Binary file client/src/main/webapp/jquery/img/fullscreen/calibration-x.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/calibration-y.png Binary file client/src/main/webapp/jquery/img/fullscreen/calibration-y.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/cat.png Binary file client/src/main/webapp/jquery/img/fullscreen/cat.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/contrast-on.png Binary file client/src/main/webapp/jquery/img/fullscreen/contrast-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/contrast.png Binary file client/src/main/webapp/jquery/img/fullscreen/contrast.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/corona.png Binary file client/src/main/webapp/jquery/img/fullscreen/corona.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/delmark.png Binary file client/src/main/webapp/jquery/img/fullscreen/delmark.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/delregion.png Binary file client/src/main/webapp/jquery/img/fullscreen/delregion.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/down.png Binary file client/src/main/webapp/jquery/img/fullscreen/down.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/first.png Binary file client/src/main/webapp/jquery/img/fullscreen/first.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/fwd.png Binary file client/src/main/webapp/jquery/img/fullscreen/fwd.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/help.png Binary file client/src/main/webapp/jquery/img/fullscreen/help.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/last.png Binary file client/src/main/webapp/jquery/img/fullscreen/last.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/left.png Binary file client/src/main/webapp/jquery/img/fullscreen/left.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/mark-bg-16.png Binary file client/src/main/webapp/jquery/img/fullscreen/mark-bg-16.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/mark-bg.png Binary file client/src/main/webapp/jquery/img/fullscreen/mark-bg.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/mark.png Binary file client/src/main/webapp/jquery/img/fullscreen/mark.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/mirror-horizontal.png Binary file client/src/main/webapp/jquery/img/fullscreen/mirror-horizontal.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/mirror-vertical.png Binary file client/src/main/webapp/jquery/img/fullscreen/mirror-vertical.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/options.png Binary file client/src/main/webapp/jquery/img/fullscreen/options.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/original-size.png Binary file client/src/main/webapp/jquery/img/fullscreen/original-size.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/page.png Binary file client/src/main/webapp/jquery/img/fullscreen/page.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/pagewidth.png Binary file client/src/main/webapp/jquery/img/fullscreen/pagewidth.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/pixel-by-pixel.png Binary file client/src/main/webapp/jquery/img/fullscreen/pixel-by-pixel.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/quality.png Binary file client/src/main/webapp/jquery/img/fullscreen/quality.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/reference.png Binary file client/src/main/webapp/jquery/img/fullscreen/reference.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/regioninfo.png Binary file client/src/main/webapp/jquery/img/fullscreen/regioninfo.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/regions.png Binary file client/src/main/webapp/jquery/img/fullscreen/regions.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/reset.png Binary file client/src/main/webapp/jquery/img/fullscreen/reset.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/rgb-on.png Binary file client/src/main/webapp/jquery/img/fullscreen/rgb-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/rgb.png Binary file client/src/main/webapp/jquery/img/fullscreen/rgb.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/right.png Binary file client/src/main/webapp/jquery/img/fullscreen/right.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/rotate-on.png Binary file client/src/main/webapp/jquery/img/fullscreen/rotate-on.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/rotate.png Binary file client/src/main/webapp/jquery/img/fullscreen/rotate.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/size.png Binary file client/src/main/webapp/jquery/img/fullscreen/size.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/up.png Binary file client/src/main/webapp/jquery/img/fullscreen/up.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/whitedisc.png Binary file client/src/main/webapp/jquery/img/fullscreen/whitedisc.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/zoom-area.png Binary file client/src/main/webapp/jquery/img/fullscreen/zoom-area.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/zoom-full.png Binary file client/src/main/webapp/jquery/img/fullscreen/zoom-full.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/zoom-in.png Binary file client/src/main/webapp/jquery/img/fullscreen/zoom-in.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/fullscreen/zoom-out.png Binary file client/src/main/webapp/jquery/img/fullscreen/zoom-out.png has changed diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/img/make_icon.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/jquery/img/make_icon.cmd Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,11 @@ +@echo off +setlocal + +rem saxon embedded.svg embedded_icons.xsl + +set ink=C:\prog_mr\inkscape-0.48.1\inkscape.exe + +%ink% embedded\svg\%1.svg --export-png=embedded\16\%1.png -w16 -h16 +%ink% embedded\svg\%1.svg --export-png=embedded\32\%1.png -w32 -h32 + +endlocal \ No newline at end of file diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/jquery-1.4.4.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/jquery/jquery-1.4.4.js Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,7181 @@ +/*! + * jQuery JavaScript Library v1.4.4 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Nov 11 19:04:53 2010 -0500 + */ +(function( window, undefined ) { + +// Use the correct document accordingly with window argument (sandbox) +var document = window.document; +var jQuery = (function() { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/, + + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + rwhite = /\s/, + + // Used for trimming whitespace + trimLeft = /^\s+/, + trimRight = /\s+$/, + + // Check for non-word characters + rnonword = /\W/, + + // Check for digits + rdigit = /\d/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + + // Useragent RegExp + rwebkit = /(webkit)[ \/]([\w.]+)/, + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, + rmsie = /(msie) ([\w.]+)/, + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // Has the ready events already been bound? + readyBound = false, + + // The functions to execute on DOM ready + readyList = [], + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context && document.body ) { + this.context = document; + this[0] = document.body; + this.selector = "body"; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + doc = (context ? context.ownerDocument || context : document); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); + selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $("TAG") + } else if ( !context && !rnonword.test( selector ) ) { + this.selector = selector; + this.context = document; + selector = document.getElementsByTagName( selector ); + return jQuery.merge( this, selector ); + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return (context || rootjQuery).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return jQuery( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if (selector.selector !== undefined) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.4.4", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = jQuery(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + (this.selector ? " " : "") + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // If the DOM is already ready + if ( jQuery.isReady ) { + // Execute the function immediately + fn.call( document, jQuery ); + + // Otherwise, remember the function for later + } else if ( readyList ) { + // Add the function to the wait list + readyList.push( fn ); + } + + return this; + }, + + eq: function( i ) { + return i === -1 ? + this.slice( i ) : + this.slice( i, +i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || jQuery(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + // A third-party is pushing the ready event forwards + if ( wait === true ) { + jQuery.readyWait--; + } + + // Make sure that the DOM is not already loaded + if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + if ( readyList ) { + // Execute all of them + var fn, + i = 0, + ready = readyList; + + // Reset the list of functions + readyList = null; + + while ( (fn = ready[ i++ ]) ) { + fn.call( document, jQuery ); + } + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger( "ready" ).unbind( "ready" ); + } + } + } + }, + + bindReady: function() { + if ( readyBound ) { + return; + } + + readyBound = true; + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + return setTimeout( jQuery.ready, 1 ); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent("onreadystatechange", DOMContentLoaded); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + // A crude way of determining if an object is a window + isWindow: function( obj ) { + return obj && typeof obj === "object" && "setInterval" in obj; + }, + + isNaN: function( obj ) { + return obj == null || !rdigit.test( obj ) || isNaN( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw msg; + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test(data.replace(rvalidescape, "@") + .replace(rvalidtokens, "]") + .replace(rvalidbraces, "")) ) { + + // Try to use the native JSON parser first + return window.JSON && window.JSON.parse ? + window.JSON.parse( data ) : + (new Function("return " + data))(); + + } else { + jQuery.error( "Invalid JSON: " + data ); + } + }, + + noop: function() {}, + + // Evalulates a script in a global context + globalEval: function( data ) { + if ( data && rnotwhite.test(data) ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + + if ( jQuery.support.scriptEval ) { + script.appendChild( document.createTextNode( data ) ); + } else { + script.text = data; + } + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction(object); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} + } + } + + return object; + }, + + // Use native String.trim function wherever possible + trim: trim ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // The extra typeof function check is to prevent crashes + // in Safari 2 (See: #3039) + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + var type = jQuery.type(array); + + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, + j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = [], retVal; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var ret = [], value; + + // Go through the array, translating each of the items to their + // new value (or values). + for ( var i = 0, length = elems.length; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + proxy: function( fn, proxy, thisObject ) { + if ( arguments.length === 2 ) { + if ( typeof proxy === "string" ) { + thisObject = fn; + fn = thisObject[ proxy ]; + proxy = undefined; + + } else if ( proxy && !jQuery.isFunction( proxy ) ) { + thisObject = proxy; + proxy = undefined; + } + } + + if ( !proxy && fn ) { + proxy = function() { + return fn.apply( thisObject || this, arguments ); + }; + } + + // Set the guid of unique handler to the same of original handler, so it can be removed + if ( fn ) { + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + } + + // So proxy can be declared as an argument + return proxy; + }, + + // Mutifunctional method to get and set values to a collection + // The value/s can be optionally by executed if its a function + access: function( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + jQuery.access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; + }, + + now: function() { + return (new Date()).getTime(); + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + browser: {} +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +if ( indexOf ) { + jQuery.inArray = function( elem, array ) { + return indexOf.call( array, elem ); + }; +} + +// Verify that \s matches non-breaking spaces +// (IE fails on this test) +if ( !rwhite.test( "\xA0" ) ) { + trimLeft = /^[\s\xA0]+/; + trimRight = /[\s\xA0]+$/; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch(e) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +// Expose jQuery to the global object +return (window.jQuery = window.$ = jQuery); + +})(); + + +(function() { + + jQuery.support = {}; + + var root = document.documentElement, + script = document.createElement("script"), + div = document.createElement("div"), + id = "script" + jQuery.now(); + + div.style.display = "none"; + div.innerHTML = "
a"; + + var all = div.getElementsByTagName("*"), + a = div.getElementsByTagName("a")[0], + select = document.createElement("select"), + opt = select.appendChild( document.createElement("option") ); + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return; + } + + jQuery.support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: div.firstChild.nodeType === 3, + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText insted) + style: /red/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: a.getAttribute("href") === "/a", + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55$/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: div.getElementsByTagName("input")[0].value === "on", + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Will be defined later + deleteExpando: true, + optDisabled: false, + checkClone: false, + scriptEval: false, + noCloneEvent: true, + boxModel: null, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableHiddenOffsets: true + }; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as diabled) + select.disabled = true; + jQuery.support.optDisabled = !opt.disabled; + + script.type = "text/javascript"; + try { + script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); + } catch(e) {} + + root.insertBefore( script, root.firstChild ); + + // Make sure that the execution of code works by injecting a script + // tag with appendChild/createTextNode + // (IE doesn't support this, fails, and uses .text instead) + if ( window[ id ] ) { + jQuery.support.scriptEval = true; + delete window[ id ]; + } + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete script.test; + + } catch(e) { + jQuery.support.deleteExpando = false; + } + + root.removeChild( script ); + + if ( div.attachEvent && div.fireEvent ) { + div.attachEvent("onclick", function click() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + jQuery.support.noCloneEvent = false; + div.detachEvent("onclick", click); + }); + div.cloneNode(true).fireEvent("onclick"); + } + + div = document.createElement("div"); + div.innerHTML = ""; + + var fragment = document.createDocumentFragment(); + fragment.appendChild( div.firstChild ); + + // WebKit doesn't clone checked state correctly in fragments + jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; + + // Figure out if the W3C box model works as expected + // document.body must exist before we can do this + jQuery(function() { + var div = document.createElement("div"); + div.style.width = div.style.paddingLeft = "1px"; + + document.body.appendChild( div ); + jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; + + if ( "zoom" in div.style ) { + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + // (IE < 8 does this) + div.style.display = "inline"; + div.style.zoom = 1; + jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2; + + // Check if elements with layout shrink-wrap their children + // (IE 6 does this) + div.style.display = ""; + div.innerHTML = "
"; + jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; + } + + div.innerHTML = "
t
"; + var tds = div.getElementsByTagName("td"); + + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + // (only IE 8 fails this test) + jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0; + + tds[0].style.display = ""; + tds[1].style.display = "none"; + + // Check if empty table cells still have offsetWidth/Height + // (IE < 8 fail this test) + jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0; + div.innerHTML = ""; + + document.body.removeChild( div ).style.display = "none"; + div = tds = null; + }); + + // Technique from Juriy Zaytsev + // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ + var eventSupported = function( eventName ) { + var el = document.createElement("div"); + eventName = "on" + eventName; + + var isSupported = (eventName in el); + if ( !isSupported ) { + el.setAttribute(eventName, "return;"); + isSupported = typeof el[eventName] === "function"; + } + el = null; + + return isSupported; + }; + + jQuery.support.submitBubbles = eventSupported("submit"); + jQuery.support.changeBubbles = eventSupported("change"); + + // release memory in IE + root = script = div = all = a = null; +})(); + + + +var windowData = {}, + rbrace = /^(?:\{.*\}|\[.*\])$/; + +jQuery.extend({ + cache: {}, + + // Please use with caution + uuid: 0, + + // Unique for each copy of jQuery on the page + expando: "jQuery" + jQuery.now(), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + data: function( elem, name, data ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var isNode = elem.nodeType, + id = isNode ? elem[ jQuery.expando ] : null, + cache = jQuery.cache, thisCache; + + if ( isNode && !id && typeof name === "string" && data === undefined ) { + return; + } + + // Get the data from the object directly + if ( !isNode ) { + cache = elem; + + // Compute a unique ID for the element + } else if ( !id ) { + elem[ jQuery.expando ] = id = ++jQuery.uuid; + } + + // Avoid generating a new cache unless none exists and we + // want to manipulate it. + if ( typeof name === "object" ) { + if ( isNode ) { + cache[ id ] = jQuery.extend(cache[ id ], name); + + } else { + jQuery.extend( cache, name ); + } + + } else if ( isNode && !cache[ id ] ) { + cache[ id ] = {}; + } + + thisCache = isNode ? cache[ id ] : cache; + + // Prevent overriding the named cache with undefined values + if ( data !== undefined ) { + thisCache[ name ] = data; + } + + return typeof name === "string" ? thisCache[ name ] : thisCache; + }, + + removeData: function( elem, name ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var isNode = elem.nodeType, + id = isNode ? elem[ jQuery.expando ] : elem, + cache = jQuery.cache, + thisCache = isNode ? cache[ id ] : id; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( thisCache ) { + // Remove the section of cache data + delete thisCache[ name ]; + + // If we've removed all the data, remove the element's cache + if ( isNode && jQuery.isEmptyObject(thisCache) ) { + jQuery.removeData( elem ); + } + } + + // Otherwise, we want to remove all of the element's data + } else { + if ( isNode && jQuery.support.deleteExpando ) { + delete elem[ jQuery.expando ]; + + } else if ( elem.removeAttribute ) { + elem.removeAttribute( jQuery.expando ); + + // Completely remove the data cache + } else if ( isNode ) { + delete cache[ id ]; + + // Remove all fields from the object + } else { + for ( var n in elem ) { + delete elem[ n ]; + } + } + } + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + if ( elem.nodeName ) { + var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; + + if ( match ) { + return !(match === true || elem.getAttribute("classid") !== match); + } + } + + return true; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var data = null; + + if ( typeof key === "undefined" ) { + if ( this.length ) { + var attr = this[0].attributes, name; + data = jQuery.data( this[0] ); + + for ( var i = 0, l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( name.indexOf( "data-" ) === 0 ) { + name = name.substr( 5 ); + dataAttr( this[0], name, data[ name ] ); + } + } + } + + return data; + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + // Try to fetch any internally stored data first + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + data = dataAttr( this[0], key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + + } else { + return this.each(function() { + var $this = jQuery( this ), + args = [ parts[0], value ]; + + $this.triggerHandler( "setData" + parts[1] + "!", args ); + jQuery.data( this, key, value ); + $this.triggerHandler( "changeData" + parts[1] + "!", args ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + data = elem.getAttribute( "data-" + key ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + !jQuery.isNaN( data ) ? parseFloat( data ) : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + + + + +jQuery.extend({ + queue: function( elem, type, data ) { + if ( !elem ) { + return; + } + + type = (type || "fx") + "queue"; + var q = jQuery.data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( !data ) { + return q || []; + } + + if ( !q || jQuery.isArray(data) ) { + q = jQuery.data( elem, type, jQuery.makeArray(data) ); + + } else { + q.push( data ); + } + + return q; + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + fn = queue.shift(); + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift("inprogress"); + } + + fn.call(elem, function() { + jQuery.dequeue(elem, type); + }); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function( i ) { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; + type = type || "fx"; + + return this.queue( type, function() { + var elem = this; + setTimeout(function() { + jQuery.dequeue( elem, type ); + }, time ); + }); + }, + + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + } +}); + + + + +var rclass = /[\n\t]/g, + rspaces = /\s+/, + rreturn = /\r/g, + rspecialurl = /^(?:href|src|style)$/, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea)?$/i, + rradiocheck = /^(?:radio|checkbox)$/i; + +jQuery.props = { + "for": "htmlFor", + "class": "className", + readonly: "readOnly", + maxlength: "maxLength", + cellspacing: "cellSpacing", + rowspan: "rowSpan", + colspan: "colSpan", + tabindex: "tabIndex", + usemap: "useMap", + frameborder: "frameBorder" +}; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name, fn ) { + return this.each(function(){ + jQuery.attr( this, name, "" ); + if ( this.nodeType === 1 ) { + this.removeAttribute( name ); + } + }); + }, + + addClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.addClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( value && typeof value === "string" ) { + var classNames = (value || "").split( rspaces ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className ) { + elem.className = value; + + } else { + var className = " " + elem.className + " ", + setClass = elem.className; + + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { + setClass += " " + classNames[c]; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.removeClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + var classNames = (value || "").split( rspaces ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + var className = (" " + elem.className + " ").replace(rclass, " "); + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[c] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this); + self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( rspaces ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery.data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " "; + for ( var i = 0, l = this.length; i < l; i++ ) { + if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + if ( !arguments.length ) { + var elem = this[0]; + + if ( elem ) { + if ( jQuery.nodeName( elem, "option" ) ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery(option).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + } + + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { + return elem.getAttribute("value") === null ? "on" : elem.value; + } + + + // Everything else, we just grab the value + return (elem.value || "").replace(rreturn, ""); + + } + + return undefined; + } + + var isFunction = jQuery.isFunction(value); + + return this.each(function(i) { + var self = jQuery(this), val = value; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call(this, i, self.val()); + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray(val) ) { + val = jQuery.map(val, function (value) { + return value == null ? "" : value + ""; + }); + } + + if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { + this.checked = jQuery.inArray( self.val(), val ) >= 0; + + } else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(val); + + jQuery( "option", this ).each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + this.selectedIndex = -1; + } + + } else { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attr: function( elem, name, value, pass ) { + // don't set attributes on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery(elem)[name](value); + } + + var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), + // Whether we are setting (or getting) + set = value !== undefined; + + // Try to normalize/fix the name + name = notxml && jQuery.props[ name ] || name; + + // These attributes require special treatment + var special = rspecialurl.test( name ); + + // Safari mis-reports the default selected property of an option + // Accessing the parent's selectedIndex property fixes it + if ( name === "selected" && !jQuery.support.optSelected ) { + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + + // If applicable, access the attribute via the DOM 0 way + // 'in' checks fail in Blackberry 4.7 #6931 + if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) { + if ( set ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } + + if ( value === null ) { + if ( elem.nodeType === 1 ) { + elem.removeAttribute( name ); + } + + } else { + elem[ name ] = value; + } + } + + // browsers index elements by id/name on forms, give priority to attributes. + if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { + return elem.getAttributeNode( name ).nodeValue; + } + + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + if ( name === "tabIndex" ) { + var attributeNode = elem.getAttributeNode( "tabIndex" ); + + return attributeNode && attributeNode.specified ? + attributeNode.value : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + + return elem[ name ]; + } + + if ( !jQuery.support.style && notxml && name === "style" ) { + if ( set ) { + elem.style.cssText = "" + value; + } + + return elem.style.cssText; + } + + if ( set ) { + // convert the value to a string (all browsers do this but IE) see #1070 + elem.setAttribute( name, "" + value ); + } + + // Ensure that missing attributes return undefined + // Blackberry 4.7 returns "" from getAttribute #6938 + if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) { + return undefined; + } + + var attr = !jQuery.support.hrefNormalized && notxml && special ? + // Some attributes require a special call on IE + elem.getAttribute( name, 2 ) : + elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return attr === null ? undefined : attr; + } +}); + + + + +var rnamespaces = /\.(.*)$/, + rformElems = /^(?:textarea|input|select)$/i, + rperiod = /\./g, + rspace = / /g, + rescape = /[^\w\s.|`]/g, + fcleanup = function( nm ) { + return nm.replace(rescape, "\\$&"); + }, + focusCounts = { focusin: 0, focusout: 0 }; + +/* + * A number of helper functions used for managing events. + * Many of the ideas behind this code originated from + * Dean Edwards' addEvent library. + */ +jQuery.event = { + + // Bind an event to an element + // Original by Dean Edwards + add: function( elem, types, handler, data ) { + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // For whatever reason, IE has trouble passing the window object + // around, causing it to be cloned in the process + if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) { + elem = window; + } + + if ( handler === false ) { + handler = returnFalse; + } else if ( !handler ) { + // Fixes bug #7229. Fix recommended by jdalton + return; + } + + var handleObjIn, handleObj; + + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the function being executed has a unique ID + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure + var elemData = jQuery.data( elem ); + + // If no elemData is found then we must be trying to bind to one of the + // banned noData elements + if ( !elemData ) { + return; + } + + // Use a key less likely to result in collisions for plain JS objects. + // Fixes bug #7150. + var eventKey = elem.nodeType ? "events" : "__events__", + events = elemData[ eventKey ], + eventHandle = elemData.handle; + + if ( typeof events === "function" ) { + // On plain objects events is a fn that holds the the data + // which prevents this data from being JSON serialized + // the function does not need to be called, it just contains the data + eventHandle = events.handle; + events = events.events; + + } else if ( !events ) { + if ( !elem.nodeType ) { + // On plain objects, create a fn that acts as the holder + // of the values to avoid JSON serialization of event data + elemData[ eventKey ] = elemData = function(){}; + } + + elemData.events = events = {}; + } + + if ( !eventHandle ) { + elemData.handle = eventHandle = function() { + // Handle the second event of a trigger and when + // an event is called after a page has unloaded + return typeof jQuery !== "undefined" && !jQuery.event.triggered ? + jQuery.event.handle.apply( eventHandle.elem, arguments ) : + undefined; + }; + } + + // Add elem as a property of the handle function + // This is to prevent a memory leak with non-native events in IE. + eventHandle.elem = elem; + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = types.split(" "); + + var type, i = 0, namespaces; + + while ( (type = types[ i++ ]) ) { + handleObj = handleObjIn ? + jQuery.extend({}, handleObjIn) : + { handler: handler, data: data }; + + // Namespaced event handlers + if ( type.indexOf(".") > -1 ) { + namespaces = type.split("."); + type = namespaces.shift(); + handleObj.namespace = namespaces.slice(0).sort().join("."); + + } else { + namespaces = []; + handleObj.namespace = ""; + } + + handleObj.type = type; + if ( !handleObj.guid ) { + handleObj.guid = handler.guid; + } + + // Get the current list of functions bound to this event + var handlers = events[ type ], + special = jQuery.event.special[ type ] || {}; + + // Init the event handler queue + if ( !handlers ) { + handlers = events[ type ] = []; + + // Check for a special event handler + // Only use addEventListener/attachEvent if the special + // events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add the function to the element's handler list + handlers.push( handleObj ); + + // Keep track of which events have been used, for global triggering + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, pos ) { + // don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + if ( handler === false ) { + handler = returnFalse; + } + + var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, + eventKey = elem.nodeType ? "events" : "__events__", + elemData = jQuery.data( elem ), + events = elemData && elemData[ eventKey ]; + + if ( !elemData || !events ) { + return; + } + + if ( typeof events === "function" ) { + elemData = events; + events = events.events; + } + + // types is actually an event object here + if ( types && types.type ) { + handler = types.handler; + types = types.type; + } + + // Unbind all events for the element + if ( !types || typeof types === "string" && types.charAt(0) === "." ) { + types = types || ""; + + for ( type in events ) { + jQuery.event.remove( elem, type + types ); + } + + return; + } + + // Handle multiple events separated by a space + // jQuery(...).unbind("mouseover mouseout", fn); + types = types.split(" "); + + while ( (type = types[ i++ ]) ) { + origType = type; + handleObj = null; + all = type.indexOf(".") < 0; + namespaces = []; + + if ( !all ) { + // Namespaced event handlers + namespaces = type.split("."); + type = namespaces.shift(); + + namespace = new RegExp("(^|\\.)" + + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + eventType = events[ type ]; + + if ( !eventType ) { + continue; + } + + if ( !handler ) { + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( all || namespace.test( handleObj.namespace ) ) { + jQuery.event.remove( elem, origType, handleObj.handler, j ); + eventType.splice( j--, 1 ); + } + } + + continue; + } + + special = jQuery.event.special[ type ] || {}; + + for ( j = pos || 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( handler.guid === handleObj.guid ) { + // remove the given handler for the given type + if ( all || namespace.test( handleObj.namespace ) ) { + if ( pos == null ) { + eventType.splice( j--, 1 ); + } + + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + + if ( pos != null ) { + break; + } + } + } + + // remove generic event handler if no more handlers exist + if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + ret = null; + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + var handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + delete elemData.events; + delete elemData.handle; + + if ( typeof elemData === "function" ) { + jQuery.removeData( elem, eventKey ); + + } else if ( jQuery.isEmptyObject( elemData ) ) { + jQuery.removeData( elem ); + } + } + }, + + // bubbling is internal + trigger: function( event, data, elem /*, bubbling */ ) { + // Event object or event type + var type = event.type || event, + bubbling = arguments[3]; + + if ( !bubbling ) { + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + jQuery.extend( jQuery.Event(type), event ) : + // Just the event type (string) + jQuery.Event(type); + + if ( type.indexOf("!") >= 0 ) { + event.type = type = type.slice(0, -1); + event.exclusive = true; + } + + // Handle a global trigger + if ( !elem ) { + // Don't bubble custom events when global (to avoid too much overhead) + event.stopPropagation(); + + // Only trigger if we've ever bound an event for it + if ( jQuery.event.global[ type ] ) { + jQuery.each( jQuery.cache, function() { + if ( this.events && this.events[type] ) { + jQuery.event.trigger( event, data, this.handle.elem ); + } + }); + } + } + + // Handle triggering a single element + + // don't do events on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + // Clean up in case it is reused + event.result = undefined; + event.target = elem; + + // Clone the incoming data, if any + data = jQuery.makeArray( data ); + data.unshift( event ); + } + + event.currentTarget = elem; + + // Trigger the event, it is assumed that "handle" is a function + var handle = elem.nodeType ? + jQuery.data( elem, "handle" ) : + (jQuery.data( elem, "__events__" ) || {}).handle; + + if ( handle ) { + handle.apply( elem, data ); + } + + var parent = elem.parentNode || elem.ownerDocument; + + // Trigger an inline bound script + try { + if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { + if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { + event.result = false; + event.preventDefault(); + } + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (inlineError) {} + + if ( !event.isPropagationStopped() && parent ) { + jQuery.event.trigger( event, data, parent, true ); + + } else if ( !event.isDefaultPrevented() ) { + var old, + target = event.target, + targetType = type.replace( rnamespaces, "" ), + isClick = jQuery.nodeName( target, "a" ) && targetType === "click", + special = jQuery.event.special[ targetType ] || {}; + + if ( (!special._default || special._default.call( elem, event ) === false) && + !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { + + try { + if ( target[ targetType ] ) { + // Make sure that we don't accidentally re-trigger the onFOO events + old = target[ "on" + targetType ]; + + if ( old ) { + target[ "on" + targetType ] = null; + } + + jQuery.event.triggered = true; + target[ targetType ](); + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (triggerError) {} + + if ( old ) { + target[ "on" + targetType ] = old; + } + + jQuery.event.triggered = false; + } + } + }, + + handle: function( event ) { + var all, handlers, namespaces, namespace_re, events, + namespace_sort = [], + args = jQuery.makeArray( arguments ); + + event = args[0] = jQuery.event.fix( event || window.event ); + event.currentTarget = this; + + // Namespaced event handlers + all = event.type.indexOf(".") < 0 && !event.exclusive; + + if ( !all ) { + namespaces = event.type.split("."); + event.type = namespaces.shift(); + namespace_sort = namespaces.slice(0).sort(); + namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.namespace = event.namespace || namespace_sort.join("."); + + events = jQuery.data(this, this.nodeType ? "events" : "__events__"); + + if ( typeof events === "function" ) { + events = events.events; + } + + handlers = (events || {})[ event.type ]; + + if ( events && handlers ) { + // Clone the handlers to prevent manipulation + handlers = handlers.slice(0); + + for ( var j = 0, l = handlers.length; j < l; j++ ) { + var handleObj = handlers[ j ]; + + // Filter the functions by class + if ( all || namespace_re.test( handleObj.namespace ) ) { + // Pass in a reference to the handler function itself + // So that we can later remove it + event.handler = handleObj.handler; + event.data = handleObj.data; + event.handleObj = handleObj; + + var ret = handleObj.handler.apply( this, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + } + + return event.result; + }, + + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // store a copy of the original event object + // and "clone" to set read-only properties + var originalEvent = event; + event = jQuery.Event( originalEvent ); + + for ( var i = this.props.length, prop; i; ) { + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary + if ( !event.target ) { + // Fixes #1925 where srcElement might not be defined either + event.target = event.srcElement || document; + } + + // check if target is a textnode (safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && event.fromElement ) { + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + } + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && event.clientX != null ) { + var doc = document.documentElement, + body = document.body; + + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Add which for key events + if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { + event.which = event.charCode != null ? event.charCode : event.keyCode; + } + + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) + if ( !event.metaKey && event.ctrlKey ) { + event.metaKey = event.ctrlKey; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && event.button !== undefined ) { + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); + } + + return event; + }, + + // Deprecated, use jQuery.guid instead + guid: 1E8, + + // Deprecated, use jQuery.proxy instead + proxy: jQuery.proxy, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady, + teardown: jQuery.noop + }, + + live: { + add: function( handleObj ) { + jQuery.event.add( this, + liveConvert( handleObj.origType, handleObj.selector ), + jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); + }, + + remove: function( handleObj ) { + jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); + } + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + if ( elem.detachEvent ) { + elem.detachEvent( "on" + type, handle ); + } + }; + +jQuery.Event = function( src ) { + // Allow instantiation without the 'new' keyword + if ( !this.preventDefault ) { + return new jQuery.Event( src ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + // Event type + } else { + this.type = src; + } + + // timeStamp is buggy for some events on Firefox(#3843) + // So we won't rely on the native value + this.timeStamp = jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Checks if an event happened on an element within another element +// Used in jQuery.event.special.mouseenter and mouseleave handlers +var withinElement = function( event ) { + // Check if mouse(over|out) are still within the same parent element + var parent = event.relatedTarget; + + // Firefox sometimes assigns relatedTarget a XUL element + // which we cannot access the parentNode property of + try { + // Traverse up the tree + while ( parent && parent !== this ) { + parent = parent.parentNode; + } + + if ( parent !== this ) { + // set the correct event type + event.type = event.data; + + // handle event if we actually just moused on to a non sub-element + jQuery.event.handle.apply( this, arguments ); + } + + // assuming we've left the element since we most likely mousedover a xul element + } catch(e) { } +}, + +// In case of event delegation, we only need to rename the event.type, +// liveHandler will take care of the rest. +delegate = function( event ) { + event.type = event.data; + jQuery.event.handle.apply( this, arguments ); +}; + +// Create mouseenter and mouseleave events +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + setup: function( data ) { + jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); + }, + teardown: function( data ) { + jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); + } + }; +}); + +// submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function( data, namespaces ) { + if ( this.nodeName.toLowerCase() !== "form" ) { + jQuery.event.add(this, "click.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { + e.liveFired = undefined; + return trigger( "submit", this, arguments ); + } + }); + + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { + e.liveFired = undefined; + return trigger( "submit", this, arguments ); + } + }); + + } else { + return false; + } + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialSubmit" ); + } + }; + +} + +// change delegation, happens here so we have bind. +if ( !jQuery.support.changeBubbles ) { + + var changeFilters, + + getVal = function( elem ) { + var type = elem.type, val = elem.value; + + if ( type === "radio" || type === "checkbox" ) { + val = elem.checked; + + } else if ( type === "select-multiple" ) { + val = elem.selectedIndex > -1 ? + jQuery.map( elem.options, function( elem ) { + return elem.selected; + }).join("-") : + ""; + + } else if ( elem.nodeName.toLowerCase() === "select" ) { + val = elem.selectedIndex; + } + + return val; + }, + + testChange = function testChange( e ) { + var elem = e.target, data, val; + + if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { + return; + } + + data = jQuery.data( elem, "_change_data" ); + val = getVal(elem); + + // the current data will be also retrieved by beforeactivate + if ( e.type !== "focusout" || elem.type !== "radio" ) { + jQuery.data( elem, "_change_data", val ); + } + + if ( data === undefined || val === data ) { + return; + } + + if ( data != null || val ) { + e.type = "change"; + e.liveFired = undefined; + return jQuery.event.trigger( e, arguments[1], elem ); + } + }; + + jQuery.event.special.change = { + filters: { + focusout: testChange, + + beforedeactivate: testChange, + + click: function( e ) { + var elem = e.target, type = elem.type; + + if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { + return testChange.call( this, e ); + } + }, + + // Change has to be called before submit + // Keydown will be called before keypress, which is used in submit-event delegation + keydown: function( e ) { + var elem = e.target, type = elem.type; + + if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || + (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || + type === "select-multiple" ) { + return testChange.call( this, e ); + } + }, + + // Beforeactivate happens also before the previous element is blurred + // with this event you can't trigger a change event, but you can store + // information + beforeactivate: function( e ) { + var elem = e.target; + jQuery.data( elem, "_change_data", getVal(elem) ); + } + }, + + setup: function( data, namespaces ) { + if ( this.type === "file" ) { + return false; + } + + for ( var type in changeFilters ) { + jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); + } + + return rformElems.test( this.nodeName ); + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialChange" ); + + return rformElems.test( this.nodeName ); + } + }; + + changeFilters = jQuery.event.special.change.filters; + + // Handle when the input is .focus()'d + changeFilters.focus = changeFilters.beforeactivate; +} + +function trigger( type, elem, args ) { + args[0].type = type; + return jQuery.event.handle.apply( elem, args ); +} + +// Create "bubbling" focus and blur events +if ( document.addEventListener ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + jQuery.event.special[ fix ] = { + setup: function() { + if ( focusCounts[fix]++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --focusCounts[fix] === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + + function handler( e ) { + e = jQuery.event.fix( e ); + e.type = fix; + return jQuery.event.trigger( e, null, e.target ); + } + }); +} + +jQuery.each(["bind", "one"], function( i, name ) { + jQuery.fn[ name ] = function( type, data, fn ) { + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ name ](key, data, type[key], fn); + } + return this; + } + + if ( jQuery.isFunction( data ) || data === false ) { + fn = data; + data = undefined; + } + + var handler = name === "one" ? jQuery.proxy( fn, function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }) : fn; + + if ( type === "unload" && name !== "one" ) { + this.one( type, data, fn ); + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.add( this[i], type, handler, data ); + } + } + + return this; + }; +}); + +jQuery.fn.extend({ + unbind: function( type, fn ) { + // Handle object literals + if ( typeof type === "object" && !type.preventDefault ) { + for ( var key in type ) { + this.unbind(key, type[key]); + } + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.remove( this[i], type, fn ); + } + } + + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.live( types, data, fn, selector ); + }, + + undelegate: function( selector, types, fn ) { + if ( arguments.length === 0 ) { + return this.unbind( "live" ); + + } else { + return this.die( types, null, fn, selector ); + } + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + + triggerHandler: function( type, data ) { + if ( this[0] ) { + var event = jQuery.Event( type ); + event.preventDefault(); + event.stopPropagation(); + jQuery.event.trigger( event, data, this[0] ); + return event.result; + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, + i = 1; + + // link all the functions, so any of them can unbind this click handler + while ( i < args.length ) { + jQuery.proxy( fn, args[ i++ ] ); + } + + return this.click( jQuery.proxy( fn, function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + })); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +var liveMap = { + focus: "focusin", + blur: "focusout", + mouseenter: "mouseover", + mouseleave: "mouseout" +}; + +jQuery.each(["live", "die"], function( i, name ) { + jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { + var type, i = 0, match, namespaces, preType, + selector = origSelector || this.selector, + context = origSelector ? this : jQuery( this.context ); + + if ( typeof types === "object" && !types.preventDefault ) { + for ( var key in types ) { + context[ name ]( key, data, types[key], selector ); + } + + return this; + } + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + types = (types || "").split(" "); + + while ( (type = types[ i++ ]) != null ) { + match = rnamespaces.exec( type ); + namespaces = ""; + + if ( match ) { + namespaces = match[0]; + type = type.replace( rnamespaces, "" ); + } + + if ( type === "hover" ) { + types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); + continue; + } + + preType = type; + + if ( type === "focus" || type === "blur" ) { + types.push( liveMap[ type ] + namespaces ); + type = type + namespaces; + + } else { + type = (liveMap[ type ] || type) + namespaces; + } + + if ( name === "live" ) { + // bind live handler + for ( var j = 0, l = context.length; j < l; j++ ) { + jQuery.event.add( context[j], "live." + liveConvert( type, selector ), + { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); + } + + } else { + // unbind live handler + context.unbind( "live." + liveConvert( type, selector ), fn ); + } + } + + return this; + }; +}); + +function liveHandler( event ) { + var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, + elems = [], + selectors = [], + events = jQuery.data( this, this.nodeType ? "events" : "__events__" ); + + if ( typeof events === "function" ) { + events = events.events; + } + + // Make sure we avoid non-left-click bubbling in Firefox (#3861) + if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) { + return; + } + + if ( event.namespace ) { + namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.liveFired = this; + + var live = events.live.slice(0); + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { + selectors.push( handleObj.selector ); + + } else { + live.splice( j--, 1 ); + } + } + + match = jQuery( event.target ).closest( selectors, event.currentTarget ); + + for ( i = 0, l = match.length; i < l; i++ ) { + close = match[i]; + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) { + elem = close.elem; + related = null; + + // Those two events require additional checking + if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { + event.type = handleObj.preType; + related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; + } + + if ( !related || related !== elem ) { + elems.push({ elem: elem, handleObj: handleObj, level: close.level }); + } + } + } + } + + for ( i = 0, l = elems.length; i < l; i++ ) { + match = elems[i]; + + if ( maxLevel && match.level > maxLevel ) { + break; + } + + event.currentTarget = match.elem; + event.data = match.handleObj.data; + event.handleObj = match.handleObj; + + ret = match.handleObj.origHandler.apply( match.elem, arguments ); + + if ( ret === false || event.isPropagationStopped() ) { + maxLevel = match.level; + + if ( ret === false ) { + stop = false; + } + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + + return stop; +} + +function liveConvert( type, selector ) { + return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&"); +} + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + if ( fn == null ) { + fn = data; + data = null; + } + + return arguments.length > 0 ? + this.bind( name, data, fn ) : + this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } +}); + +// Prevent memory leaks in IE +// Window isn't included so as not to unbind existing unload events +// More info: +// - http://isaacschlueter.com/2006/10/msie-memory-leaks/ +if ( window.attachEvent && !window.addEventListener ) { + jQuery(window).bind("unload", function() { + for ( var id in jQuery.cache ) { + if ( jQuery.cache[ id ].handle ) { + // Try/Catch is to handle iframes being unloaded, see #4280 + try { + jQuery.event.remove( jQuery.cache[ id ].handle.elem ); + } catch(e) {} + } + } + }); +} + + +/*! + * Sizzle CSS Selector Engine - v1.0 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function() { + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function( selector, context, results, seed ) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var m, set, checkSet, extra, ret, cur, pop, i, + prune = true, + contextXML = Sizzle.isXML( context ), + parts = [], + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec( "" ); + m = chunker.exec( soFar ); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? + Sizzle.filter( ret.expr, ret.set )[0] : + ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + + set = ret.expr ? + Sizzle.filter( ret.expr, ret.set ) : + ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray( set ); + + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function( results ) { + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + } + + return results; +}; + +Sizzle.matches = function( expr, set ) { + return Sizzle( expr, null, null, set ); +}; + +Sizzle.matchesSelector = function( node, expr ) { + return Sizzle( expr, null, null, [node] ).length > 0; +}; + +Sizzle.find = function( expr, context, isXML ) { + var set; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var match, + type = Expr.order[i]; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice( 1, 1 ); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace(/\\/g, ""); + set = Expr.find[ type ]( match, context, isXML ); + + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = context.getElementsByTagName( "*" ); + } + + return { set: set, expr: expr }; +}; + +Sizzle.filter = function( expr, set, inplace, not ) { + var match, anyFound, + old = expr, + result = [], + curLoop = set, + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var found, item, + filter = Expr.filter[ type ], + left = match[1]; + + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + + } else { + curLoop[i] = false; + } + + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + + leftMatch: {}, + + attrMap: { + "class": "className", + "for": "htmlFor" + }, + + attrHandle: { + href: function( elem ) { + return elem.getAttribute( "href" ); + } + }, + + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !/\W/.test( part ), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + + ">": function( checkSet, part ) { + var elem, + isPartStr = typeof part === "string", + i = 0, + l = checkSet.length; + + if ( isPartStr && !/\W/.test( part ) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + + "": function(checkSet, part, isXML){ + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); + }, + + "~": function( checkSet, part, isXML ) { + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); + } + }, + + find: { + ID: function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }, + + NAME: function( match, context ) { + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], + results = context.getElementsByName( match[1] ); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + + TAG: function( match, context ) { + return context.getElementsByTagName( match[1] ); + } + }, + preFilter: { + CLASS: function( match, curLoop, inplace, result, not, isXML ) { + match = " " + match[1].replace(/\\/g, "") + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + + ID: function( match ) { + return match[1].replace(/\\/g, ""); + }, + + TAG: function( match, curLoop ) { + return match[1].toLowerCase(); + }, + + CHILD: function( match ) { + if ( match[1] === "nth" ) { + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + + ATTR: function( match, curLoop, inplace, result, not, isXML ) { + var name = match[1].replace(/\\/g, ""); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + + PSEUDO: function( match, curLoop, inplace, result, not ) { + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + + if ( !inplace ) { + result.push.apply( result, ret ); + } + + return false; + } + + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + + POS: function( match ) { + match.unshift( true ); + + return match; + } + }, + + filters: { + enabled: function( elem ) { + return elem.disabled === false && elem.type !== "hidden"; + }, + + disabled: function( elem ) { + return elem.disabled === true; + }, + + checked: function( elem ) { + return elem.checked === true; + }, + + selected: function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + elem.parentNode.selectedIndex; + + return elem.selected === true; + }, + + parent: function( elem ) { + return !!elem.firstChild; + }, + + empty: function( elem ) { + return !elem.firstChild; + }, + + has: function( elem, i, match ) { + return !!Sizzle( match[3], elem ).length; + }, + + header: function( elem ) { + return (/h\d/i).test( elem.nodeName ); + }, + + text: function( elem ) { + return "text" === elem.type; + }, + radio: function( elem ) { + return "radio" === elem.type; + }, + + checkbox: function( elem ) { + return "checkbox" === elem.type; + }, + + file: function( elem ) { + return "file" === elem.type; + }, + password: function( elem ) { + return "password" === elem.type; + }, + + submit: function( elem ) { + return "submit" === elem.type; + }, + + image: function( elem ) { + return "image" === elem.type; + }, + + reset: function( elem ) { + return "reset" === elem.type; + }, + + button: function( elem ) { + return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; + }, + + input: function( elem ) { + return (/input|select|textarea|button/i).test( elem.nodeName ); + } + }, + setFilters: { + first: function( elem, i ) { + return i === 0; + }, + + last: function( elem, i, match, array ) { + return i === array.length - 1; + }, + + even: function( elem, i ) { + return i % 2 === 0; + }, + + odd: function( elem, i ) { + return i % 2 === 1; + }, + + lt: function( elem, i, match ) { + return i < match[3] - 0; + }, + + gt: function( elem, i, match ) { + return i > match[3] - 0; + }, + + nth: function( elem, i, match ) { + return match[3] - 0 === i; + }, + + eq: function( elem, i, match ) { + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function( elem, match, i, array ) { + var name = match[1], + filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; + + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + + } else { + Sizzle.error( "Syntax error, unrecognized expression: " + name ); + } + }, + + CHILD: function( elem, match ) { + var type = match[1], + node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + + case "nth": + var first = match[2], + last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + + if ( first === 0 ) { + return diff === 0; + + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + + ID: function( elem, match ) { + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + + TAG: function( elem, match ) { + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + + CLASS: function( elem, match ) { + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + + ATTR: function( elem, match ) { + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + + POS: function( elem, match, i, array ) { + var name = match[2], + filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} + +var makeArray = function( array, results ) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch( e ) { + makeArray = function( array, results ) { + var i = 0, + ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder, siblingCheck; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + return a.compareDocumentPosition ? -1 : 1; + } + + return a.compareDocumentPosition(b) & 4 ? -1 : 1; + }; + +} else { + sortOrder = function( a, b ) { + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // If the nodes are siblings (or identical) we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + + siblingCheck = function( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +Sizzle.getText = function( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += Sizzle.getText( elem.childNodes ); + } + } + + return ret; +}; + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date()).getTime(), + root = document.documentElement; + + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + + return m ? + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? + [m] : + undefined : + []; + } + }; + + Expr.filter.ID = function( elem, match ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + + // release memory in IE + root = form = null; +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function( match, context ) { + var results = context.getElementsByTagName( match[1] ); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + + Expr.attrHandle.href = function( elem ) { + return elem.getAttribute( "href", 2 ); + }; + } + + // release memory in IE + div = null; +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, + div = document.createElement("div"), + id = "__sizzle__"; + + div.innerHTML = "

"; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function( query, context, extra, seed ) { + context = context || document; + + // Make sure that attribute selectors are quoted + query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && !Sizzle.isXML(context) ) { + if ( context.nodeType === 9 ) { + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(qsaError) {} + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + var old = context.getAttribute( "id" ), + nid = old || id; + + if ( !old ) { + context.setAttribute( "id", nid ); + } + + try { + return makeArray( context.querySelectorAll( "#" + nid + " " + query ), extra ); + + } catch(pseudoError) { + } finally { + if ( !old ) { + context.removeAttribute( "id" ); + } + } + } + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + // release memory in IE + div = null; + })(); +} + +(function(){ + var html = document.documentElement, + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector, + pseudoWorks = false; + + try { + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( document.documentElement, "[test!='']:sizzle" ); + + } catch( pseudoError ) { + pseudoWorks = true; + } + + if ( matches ) { + Sizzle.matchesSelector = function( node, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + if ( !Sizzle.isXML( node ) ) { + try { + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { + return matches.call( node, expr ); + } + } catch(e) {} + } + + return Sizzle(expr, null, null, [node]).length > 0; + }; + } +})(); + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
"; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function( match, context, isXML ) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + // release memory in IE + div = null; +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +if ( document.documentElement.contains ) { + Sizzle.contains = function( a, b ) { + return a !== b && (a.contains ? a.contains(b) : true); + }; + +} else if ( document.documentElement.compareDocumentPosition ) { + Sizzle.contains = function( a, b ) { + return !!(a.compareDocumentPosition(b) & 16); + }; + +} else { + Sizzle.contains = function() { + return false; + }; +} + +Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function( selector, context ) { + var match, + tmpSet = [], + later = "", + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})(); + + +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + isSimple = /^.[^:#\[\.,]*$/, + slice = Array.prototype.slice, + POS = jQuery.expr.match.POS; + +jQuery.fn.extend({ + find: function( selector ) { + var ret = this.pushStack( "", "find", selector ), + length = 0; + + for ( var i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( var n = length; n < ret.length; n++ ) { + for ( var r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && jQuery.filter( selector, this ).length > 0; + }, + + closest: function( selectors, context ) { + var ret = [], i, l, cur = this[0]; + + if ( jQuery.isArray( selectors ) ) { + var match, selector, + matches = {}, + level = 1; + + if ( cur && selectors.length ) { + for ( i = 0, l = selectors.length; i < l; i++ ) { + selector = selectors[i]; + + if ( !matches[selector] ) { + matches[selector] = jQuery.expr.match.POS.test( selector ) ? + jQuery( selector, context || this.context ) : + selector; + } + } + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( selector in matches ) { + match = matches[selector]; + + if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { + ret.push({ selector: selector, elem: cur, level: level }); + } + } + + cur = cur.parentNode; + level++; + } + } + + return ret; + } + + var pos = POS.test( selectors ) ? + jQuery( selectors, context || this.context ) : null; + + for ( i = 0, l = this.length; i < l; i++ ) { + cur = this[i]; + + while ( cur ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + + } else { + cur = cur.parentNode; + if ( !cur || !cur.ownerDocument || cur === context ) { + break; + } + } + } + } + + ret = ret.length > 1 ? jQuery.unique(ret) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + if ( !elem || typeof elem === "string" ) { + return jQuery.inArray( this[0], + // If it receives a string, the selector is used + // If it receives nothing, the siblings are used + elem ? jQuery( elem ) : this.parent().children() ); + } + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context || this.context ) : + jQuery.makeArray( selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( elem.parentNode.firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, slice.call(arguments).join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return (elem === qualifier) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return (jQuery.inArray( elem, qualifier ) >= 0) === keep; + }); +} + + + + +var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rtagName = /<([\w:]+)/, + rtbody = /\s]+\/)>/g, + wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
", "
" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + col: [ 2, "", "
" ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }; + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
DEBUG
+
+ + +
+ + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/jquery-test-embedded.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/jquery/jquery-test-embedded.html Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,123 @@ + + + + Digilib jQuery Test: embedded + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ testalt +
+
+
+ +
+
+ + +
+ +
+
+
DEBUG
+
+ + +
+ + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/jquery-test-full-rc.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/jquery/jquery-test-full-rc.html Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,49 @@ + + + + + Digilib jQuery Test: fullscreen + + + + + + + + + + + + + + + + + +
+ +
+ + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/jquery-test-full.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/jquery/jquery-test-full.html Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,98 @@ + + + + + Digilib jQuery Test: fullscreen + + + + + + + + + + + + + + + + + + +
+ +
+
DEBUG
+ + + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/jquery-test-svg.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/jquery/jquery-test-svg.html Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,43 @@ + + + + + jQuery.digilibSVG test + + + + + + + + + + + + + + + + + + +
+ +
+
DEBUG
+ + + diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/jquery.cookie.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/jquery/jquery.cookie.js Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,96 @@ +/** + * Cookie plugin + * + * Copyright (c) 2006 Klaus Hartl (stilbuero.de) + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ + +/** + * Create a cookie with the given name and value and other optional parameters. + * + * @example $.cookie('the_cookie', 'the_value'); + * @desc Set the value of a cookie. + * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); + * @desc Create a cookie with all available options. + * @example $.cookie('the_cookie', 'the_value'); + * @desc Create a session cookie. + * @example $.cookie('the_cookie', null); + * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain + * used when the cookie was set. + * + * @param String name The name of the cookie. + * @param String value The value of the cookie. + * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. + * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. + * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. + * If set to null or omitted, the cookie will be a session cookie and will not be retained + * when the the browser exits. + * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). + * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). + * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will + * require a secure protocol (like HTTPS). + * @type undefined + * + * @name $.cookie + * @cat Plugins/Cookie + * @author Klaus Hartl/klaus.hartl@stilbuero.de + */ + +/** + * Get the value of a cookie with the given name. + * + * @example $.cookie('the_cookie'); + * @desc Get the value of a cookie. + * + * @param String name The name of the cookie. + * @return The value of the cookie. + * @type String + * + * @name $.cookie + * @cat Plugins/Cookie + * @author Klaus Hartl/klaus.hartl@stilbuero.de + */ +jQuery.cookie = function(name, value, options) { + if (typeof value != 'undefined') { // name and value given, set cookie + options = options || {}; + if (value === null) { + value = ''; + options.expires = -1; + } + var expires = ''; + if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { + var date; + if (typeof options.expires == 'number') { + date = new Date(); + date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); + } else { + date = options.expires; + } + expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE + } + // CAUTION: Needed to parenthesize options.path and options.domain + // in the following expressions, otherwise they evaluate to undefined + // in the packed version for some reason... + var path = options.path ? '; path=' + (options.path) : ''; + var domain = options.domain ? '; domain=' + (options.domain) : ''; + var secure = options.secure ? '; secure' : ''; + document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); + } else { // only name given, get cookie + var cookieValue = null; + if (document.cookie && document.cookie != '') { + var cookies = document.cookie.split(';'); + for (var i = 0; i < cookies.length; i++) { + var cookie = jQuery.trim(cookies[i]); + // Does this cookie string begin with the name we want? + if (cookie.substring(0, name.length + 1) == (name + '=')) { + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); + break; + } + } + } + return cookieValue; + } +}; diff -r cad6d3d5aeb3 -r 89ba3ffcf552 client/src/main/webapp/jquery/jquery.digilib.birdseye.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/main/webapp/jquery/jquery.digilib.birdseye.js Tue Apr 26 11:38:11 2011 +0200 @@ -0,0 +1,330 @@ +/** +digilib bird's eye view plugin + */ + +(function($) { + + // affine geometry plugin stub + var geom; + + // digilib object + var digilib; + + var FULL_AREA; + + var buttons = { + bird : { + onclick : "showBirdDiv", + tooltip : "show bird's eye view", + icon : "birds-eye.png" + } + }; + + var defaults = { + // is birdView shown? + 'isBirdDivVisible' : false, + // dimensions of bird's eye div + 'birdDivWidth' : 200, + 'birdDivHeight' : 200, + // parameters used by bird's eye div + 'birdDivParams' : ['fn','pn','dw','dh'] + }; + + var actions = { + // event handler: toggles the visibility of the bird's eye window + showBirdDiv : function (data, show) { + var settings = data.settings; + if (data.$birdDiv == null) { + // no bird div -> create + setupBirdDiv(data); + } + var on = digilib.fn.showDiv(settings.isBirdDivVisible, data.$birdDiv, show); + settings.isBirdDivVisible = on; + digilib.fn.highlightButtons(data, 'bird', on); + updateBirdDiv(data); + digilib.fn.storeOptions(data); + } + }; + + // plugin installation called by digilib on plugin object. + var install = function(plugin) { + digilib = plugin; + console.debug('installing birdseye plugin. digilib:', digilib); + // import geometry classes + geom = digilib.fn.geometry; + FULL_AREA = geom.rectangle(0,0,1,1); + // add defaults + $.extend(digilib.defaults, defaults); + // add actions + $.extend(digilib.actions, actions); + // add buttons + $.extend(digilib.buttons, buttons); + // insert in button list -- not elegant + digilib.defaults.buttonSettings.fullscreen.standardSet.splice(9, 0, 'bird'); + digilib.defaults.buttonSettings.embedded.standardSet.splice(5, 0, 'bird'); + }; + + // plugin initialization + var init = function (data) { + console.debug('initialising birdseye plugin. data:', data); + var $data = $(data); + // install event handler + $data.bind('setup', handleSetup); + $data.bind('update', handleUpdate); + $data.bind('redisplay', handleRedisplay); + $data.bind('dragZoom', handleDragZoom); + }; + + + var handleSetup = function (evt) { + console.debug("birdseye: handleSetup"); + data = this; + // bird's eye view creation + if (data.settings.isBirdDivVisible) { + setupBirdDiv(data); + data.$birdDiv.show(); + } + }; + + var handleUpdate = function (evt) { + console.debug("birdseye: handleUpdate"); + data = this; + if (data.settings.isBirdDivVisible) { + renderBirdArea(data); + setupBirdDrag(data); + } + }; + + var handleRedisplay = function (evt) { + console.debug("birdseye: handleRedisplay"); + data = this; + if (data.settings.isBirdDivVisible) { + updateBirdDiv(data); + } + }; + + var handleDragZoom = function (evt, zoomArea) { + //console.debug("birdseye: handleDragZoom za="+zoomArea); + data = this; + if (data.settings.isBirdDivVisible) { + setBirdZoom(data, zoomArea); + } + }; + + // returns URL for bird's eye view image + var getBirdImgUrl = function (data) { + var settings = data.settings; + var birdDivOptions = { + dw : settings.birdDivWidth, + dh : settings.birdDivHeight + }; + var birdSettings = $.extend({}, settings, birdDivOptions); + // use only the relevant parameters + var params = digilib.fn.getParamString(birdSettings, settings.birdDivParams, digilib.defaults); + var url = settings.scalerBaseUrl + '?' + params; + return url; + }; + + // creates HTML structure for the bird's eye view in elem + var setupBirdDiv = function (data) { + var $elem = data.$elem; + // the bird's eye div + var $birdDiv = $('