|
|
| version 1.6, 2005/11/08 10:13:31 | version 1.7, 2005/11/08 18:10:10 |
|---|---|
| Line 17 Foundation, Inc., 59 Temple Place - Suit | Line 17 Foundation, Inc., 59 Temple Place - Suit |
| Authors: | Authors: |
| Christian Luginbuehl, 01.05.2003 (first version) | Christian Luginbuehl, 01.05.2003 (first version) |
| DW 24.03.2004 (Changed for digiLib in Zope) | DW 24.03.2004 (Changed for digiLib in Zope) |
| Robert Casties, 2.11.2004 | Robert Casties, 8.11.2005 |
| ! Requires baselib.js ! | ! Requires baselib.js ! |
| Line 186 function bestPicSize(elem, inset) { | Line 186 function bestPicSize(elem, inset) { |
| return ws; | return ws; |
| } | } |
| function setDLParam(e, s) { | function setDLParam(e, s, relative) { |
| // sets parameter based on HTML event | // sets parameter based on HTML event |
| var nam; | var nam; |
| var val; | var val; |
| Line 198 function setDLParam(e, s) { | Line 198 function setDLParam(e, s) { |
| val = s.value; | val = s.value; |
| } | } |
| if (nam && val) { | if (nam && val) { |
| setParameter(nam, val); | setParameter(nam, val, relative); |
| display(); | display(); |
| } else { | } else { |
| alert("unable to process event!"); | alert("ERROR: unable to process event!"); |
| } | } |
| return true; | return true; |
| } | } |
| Line 217 function dl_param_init() { | Line 217 function dl_param_init() { |
| if (!baseScriptVersion) { | if (!baseScriptVersion) { |
| base_init(); | base_init(); |
| } | } |
| dlScriptVersion = "1.1b"; | dlScriptVersion = "1.2b"; |
| dlArea = new Rectangle(0.0, 0.0, 1.0, 1.0); | dlArea = new Rectangle(0.0, 0.0, 1.0, 1.0); |
| dlMaxArea = new Rectangle(0.0, 0.0, 1.0, 1.0); | dlMaxArea = new Rectangle(0.0, 0.0, 1.0, 1.0); |
| dlTrafo = new Transform(); | dlTrafo = new Transform(); |
| Line 274 function dl_init() { | Line 274 function dl_init() { |
| function display(detail) { | function display(detail) { |
| // redisplay the page | // redisplay the page |
| if (! detail) { | if (! detail) { |
| detail = 9; | detail = 255; |
| } | } |
| var queryString = getAllParameters(detail); | var queryString = getAllParameters(detail); |
| location.href = location.protocol + "//" + location.host + location.pathname + "?" + queryString; | location.href = location.protocol + "//" + location.host + location.pathname + "?" + queryString; |
| Line 460 function zoomFullpage() { | Line 460 function zoomFullpage() { |
| function moveCenter() { | function moveCenter() { |
| // move visible area so that it's centered around the clicked point | // move visible area so that it's centered around the clicked point |
| if ( (dlArea.width == 1.0) && (dlArea.height == 1.0) ) { | if ( (dlArea.width == 1.0) && (dlArea.height == 1.0) ) { |
| // noting to do | // nothing to do |
| return; | return; |
| } | } |
| window.focus(); | window.focus(); |
| Line 503 function getRef() { | Line 503 function getRef() { |
| var baseUrl = location.protocol + "//" + location.host + location.pathname; | var baseUrl = location.protocol + "//" + location.host + location.pathname; |
| } | } |
| var hyperlinkRef = baseUrl; | var hyperlinkRef = baseUrl; |
| var par = getAllParameters(9); | var par = getAllParameters(7+16); // all without ddpi, pt |
| if (par.length > 0) { | if (par.length > 0) { |
| hyperlinkRef += "?" + par; | hyperlinkRef += "?" + par; |
| } | } |
| Line 563 function mirror(dir) { | Line 563 function mirror(dir) { |
| display(); | display(); |
| } | } |
| function gotoPage(gopage) { | function gotoPage(gopage, keep) { |
| // goto given page nr (+/- relative) | // goto given page nr (+/-: relative) |
| setParameter("pn", gopage); | var oldpn = parseInt(getParameter("pn")); |
| setParameter("pn", gopage, true); | |
| var pn = parseInt(getParameter("pn")); | var pn = parseInt(getParameter("pn")); |
| if (pn < 1) { | if (pn < 1) { |
| pn = 1; | alert("No such page! (Page number too low)"); |
| setParameter("pn", pn); | 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 | |
| } | } |
| // TODO: check for last page | |
| display(1); | |
| } | } |
| function gotoPageWin() { | function gotoPageWin() { |
| // dialog to ask for new page nr | // dialog to ask for new page nr |
| var pn = getParameter('pn'); | var pn = getParameter("pn"); |
| var gopage = window.prompt("Go to page", pn); | var gopage = window.prompt("Go to page", pn); |
| if (gopage) { | if (gopage) { |
| gotoPage(gopage); | gotoPage(gopage); |
| } | } |
| } | } |
| function setParamWin(param, text) { | function setParamWin(param, text, relative) { |
| // dialog to ask for new parameter value | // dialog to ask for new parameter value |
| var val = getParameter(param); | var val = getParameter(param); |
| var newval = window.prompt(text, val); | var newval = window.prompt(text, val); |
| if (newval) { | if (newval) { |
| setParameter(param, newval); | setParameter(param, newval, relative); |
| display(); | display(); |
| } | } |
| } | } |