--- zogiLib/js/dllib.js 2005/11/08 18:10:10 1.7 +++ zogiLib/js/dllib.js 2011/02/14 16:33:43 1.10 @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suit Authors: Christian Luginbuehl, 01.05.2003 (first version) DW 24.03.2004 (Changed for digiLib in Zope) - Robert Casties, 8.11.2005 + Robert Casties, 14.7.2006 ! Requires baselib.js ! @@ -178,11 +178,20 @@ function bestPicSize(elem, inset) { inset = 25; } var ws = getWinSize(); + var wsold = ws.copy(); var es = getElementPosition(elem); if (es) { - ws.width = ws.width - es.x - inset; - ws.height = ws.height - es.y - inset; + if ((es.x > ws.width)||(es.y > ws.height)) { + alert("es="+es+" is outside ws="+ws+" fixing..."); + ws.width = ws.width - inset; + ws.height = ws.height - inset; + } else { + ws.width = ws.width - es.x - inset; + ws.height = ws.height - es.y - inset; + } } + alert("ws="+wsold+" es="+es+" -> ws="+ws); + //alert("ws="+ws+"("+typeof(ws)+") es="+es); return ws; } @@ -217,7 +226,7 @@ function dl_param_init() { if (!baseScriptVersion) { base_init(); } - dlScriptVersion = "1.2b"; + dlScriptVersion = "1.3a"; 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(); @@ -228,11 +237,14 @@ function dl_param_init() { ZOOMFACTOR = Math.sqrt(2); // put the query parameters (sans "?") in the parameters array - parseParameters(location.search.slice(1)); + // non-digilib parameters get detail level 32 + parseParameters(location.search.slice(1),32); // treat special parameters dlMarks = parseMarks(); dlArea = parseArea(); dlFlags = parseFlags(); + // mask for parameters when creating new URL + dlUrlParamMask = 255; } @@ -258,7 +270,7 @@ function dl_init() { window.name = "digilib"; } // put the query parameters (sans "?") in the parameters array - parseParameters(location.search.slice(1)); + //parseParameters(location.search.slice(1),32); // treat special parameters dlMarks = parseMarks(); dlArea = parseArea(); @@ -276,7 +288,7 @@ function display(detail) { if (! detail) { detail = 255; } - var queryString = getAllParameters(detail); + var queryString = getAllParameters(detail & dlUrlParamMask); location.href = location.protocol + "//" + location.host + location.pathname + "?" + queryString; } @@ -503,7 +515,7 @@ function getRef() { var baseUrl = location.protocol + "//" + location.host + location.pathname; } var hyperlinkRef = baseUrl; - var par = getAllParameters(7+16); // all without ddpi, pt + var par = getAllParameters((7+32+64) & dlUrlParamMask); // all without ddpi, pt if (par.length > 0) { hyperlinkRef += "?" + par; } @@ -582,9 +594,9 @@ function gotoPage(gopage, keep) { } } if (keep) { - display(15+32); // all, no mark + display(63+128); // all, no mark } else { - display(3+32); // fn, pn, ws, mo + pt + display(3+32+128); // fn, pn, ws, mo + pt } } @@ -611,4 +623,10 @@ function showOptions(show) { // show or hide option div var elem = getElement("dloptions"); showElement(elem, show); -} \ No newline at end of file +} + +function toggleOptions() { + // toggle option div + var elem = getElement("dloptions"); + showOptions(! isElementVisible(elem)); +}