# HG changeset patch
# User robcast
# Date 1302089200 -7200
# Node ID 918caa243a5cff15b1a94c877c95b47b82367615
# Parent 66e1a997850c45ae6829e39bb0549af54fef754f# Parent eceabe0126bbcc166137f830c5227dc14e244682
merge
with 80a695f683c702570c981aef4471a13d2d7f7f87
diff -r eceabe0126bb -r 918caa243a5c client/digitallibrary/WEB-INF/web-2.3.xml
--- a/client/digitallibrary/WEB-INF/web-2.3.xml Tue Mar 22 18:33:52 2011 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-
-
-
-
-
-
- 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 eceabe0126bb -r 918caa243a5c client/digitallibrary/WEB-INF/web-3.0.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/WEB-INF/web-3.0.xml Wed Apr 06 13:26:40 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 eceabe0126bb -r 918caa243a5c client/digitallibrary/WEB-INF/web.xml
--- a/client/digitallibrary/WEB-INF/web.xml Tue Mar 22 18:33:52 2011 +0100
+++ b/client/digitallibrary/WEB-INF/web.xml Wed Apr 06 13:26:40 2011 +0200
@@ -1,10 +1,7 @@
-
-
+
+
+
digilib
@@ -12,19 +9,19 @@
This is the web frontend of the Digital Document Library.
-
+
digilib.servlet.Initialiser
-
+
Scaler
- digilib.servlet.Scaler
+ digilib.servlet.ScalerNoAsync
diff -r eceabe0126bb -r 918caa243a5c client/digitallibrary/jquery/jquery.digilib.js
--- a/client/digitallibrary/jquery/jquery.digilib.js Tue Mar 22 18:33:52 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js Wed Apr 06 13:26:40 2011 +0200
@@ -237,6 +237,7 @@
'fullscreen' : {
// path to button images (must end with a slash)
'imagePath' : 'img/fullscreen/',
+ 'buttonSetWidth' : 36,
'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","back","fwd","page","help","reset","toggleoptions"],
'specialSet' : ["mark","delmark","hmir","vmir","rot","brgt","cont","rgb","quality","size","calibrationx","scale","lessoptions"],
'arrowSet' : ["up", "down", "left", "right"],
@@ -244,11 +245,12 @@
},
'embedded' : {
'imagePath' : 'img/embedded/16/',
+ 'buttonSetWidth' : 18,
'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","help","reset","toggleoptions"],
'specialSet' : ["mark","delmark","hmir","vmir","rot","brgt","cont","rgb","quality","scale","lessoptions"],
'arrowSet' : ["up", "down", "left", "right"],
'buttonSets' : ['standardSet', 'specialSet']
- }
+ },
},
// arrow bar overlays for moving the zoomed area
'showZoomArrows' : true,
@@ -929,6 +931,8 @@
if (typeof history.pushState === 'function') {
console.debug("faking reload to "+url);
// change url without reloading (stateObj, title, url)
+ // TODO: we really need to put the state in stateObj and listen to pop-events
+ // TODO: use replace-state(?)
history.pushState({}, '', url);
// change img src
var imgurl = getScalerUrl(data);
@@ -962,31 +966,33 @@
// returns maximum size for scaler img in fullscreen mode
var getFullscreenImgSize = function (data) {
+ var mode = data.settings.interactionMode;
var $win = $(window);
var winH = $win.height();
var winW = $win.width();
- console.debug("window size="+winW+"x"+winH);
var $body = $('body');
- // include standard body margins
+ // include standard body margins and check plausibility
var borderW = $body.outerWidth(true) - $body.width();
+ if (borderW === 0 || borderW > 100) {
+ console.debug("fixing border width for getFullscreenImgSize!");
+ borderW = data.settings.scalerInset;
+ }
var borderH = $body.outerHeight(true) - $body.height();
- console.debug("body outerwidth="+$body.outerWidth(true)+" width="+$body.width());
- // get width of first button div
+ if (borderH === 0 || borderH > 100) {
+ console.debug("fixing border height for getFullscreenImgSize!");
+ borderH = 5;
+ }
var buttonsW = 0;
- if (data.$buttonSets) {
- buttonsW = data.$buttonSets[0].outerWidth();
- // try to fix ipad...
- if (buttonsW === $body.width()) {
- console.error("buttons width can't be measured -- using 32");
- buttonsW = 32;
- }
+ if (data.settings.visibleButtonSets) {
+ // get button width from settings
+ buttonsW = data.settings.buttonSettings[mode].buttonSetWidth;
+ // TODO: leave space for all button sets?
}
// account for left/right border, body margins and additional requirements
- var calcW = winW - borderW - buttonsW - data.settings.scalerInset;
- var calcH = winH - borderH;
- console.debug("calcw="+calcW+" buttonsw="+buttonsW+" inset="+data.settings.scalerInset+" calcH="+calcH);
- console.debug(winW, winH, 'winW:', $win.width(), 'border:', borderW, 'buttonsW:', buttonsW, 'calc:', calcW);
- return geom.size(calcW, calcH);
+ var imgW = winW - borderW - buttonsW;
+ var imgH = winH - borderH;
+ console.debug(winW, winH, 'winW:', $win.width(), 'border:', borderW, 'buttonsW:', buttonsW, 'calc:', imgW);
+ return geom.size(imgW, imgH);
};
// creates HTML structure for digilib in elem
@@ -1210,7 +1216,7 @@
var $elem = data.$elem;
var settings = data.settings;
var $aboutDiv = $('');
- var $header = $('Digilib Graphic Viewer
');
+ var $header = $('Digilib Image Viewer
');
var $link = $('');
var $logo = $('
');
var $content = $('');
@@ -1249,6 +1255,9 @@
// display more (or less) button sets
var showButtons = function (data, more, setIdx, animated) {
var atime = animated ? 'fast': 0;
+ // get button width from settings
+ var mode = data.settings.interactionMode;
+ var btnWidth = data.settings.buttonSettings[mode].buttonSetWidth;
if (more) {
// add set
var $otherSets = data.$elem.find('div.buttons:visible');
@@ -1261,7 +1270,7 @@
}
if ($set == null) return false;
// include border in calculation
- var btnWidth = $set.outerWidth();
+ //var btnWidth = $set.outerWidth();
// console.debug("btnWidth", btnWidth);
// move remaining sets left and show new set
if ($otherSets.length > 0) {
@@ -1274,7 +1283,7 @@
// remove set
var $set = data.$buttonSets[setIdx];
if ($set == null) return false;
- var btnWidth = $set.outerWidth();
+ //var btnWidth = $set.outerWidth();
// hide last set
$set.hide();
// take remaining sets and move right
@@ -1713,7 +1722,7 @@
return ((movx < 0) && (za.x > 0))
|| ((movx > 0) && (x2 < 1.0))
|| ((movy < 0) && (za.y > 0))
- || ((movy > 0) && (y2 < 1.0));
+ || ((movy > 0) && (y2 < 1.0))
};
// auxiliary function (from old dllib.js)