|
516
|
1 /* Copyright (C) 2003,2004 IT-Group MPIWG, WTWG Uni Bern and others
|
|
|
2
|
|
|
3 This program is free software; you can redistribute it and/or
|
|
|
4 modify it under the terms of the GNU General Public License
|
|
|
5 as published by the Free Software Foundation; either version 2
|
|
|
6 of the License, or (at your option) any later version.
|
|
|
7
|
|
|
8 This program is distributed in the hope that it will be useful,
|
|
|
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
11 GNU General Public License for more details.
|
|
|
12
|
|
|
13 You should have received a copy of the GNU General Public License
|
|
|
14 along with this program; if not, write to the Free Software
|
|
|
15 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
|
16
|
|
|
17 Authors:
|
|
|
18 Christian Luginbuehl, 01.05.2003 (first version)
|
|
|
19 DW 24.03.2004 (Changed for digiLib in Zope)
|
|
|
20 Robert Casties, 8.11.2005
|
|
|
21 Martin Raspe <hertzhaft@biblhertz.it>, 12.12.2005
|
|
|
22 Robert Casties, 4.9.2009
|
|
|
23
|
|
|
24 ! Requires baselib.js !
|
|
|
25 */
|
|
|
26 digilibVersion = "Digilib NG";
|
|
|
27 dllibVersion = "2.041";
|
|
|
28
|
|
|
29 function identify() {
|
|
|
30 // used for identifying a digilib instance
|
|
|
31 // Relato uses that function - lugi
|
|
|
32 return digilibVersion;
|
|
|
33 }
|
|
|
34
|
|
|
35 function createMarkDiv(index) {
|
|
|
36 var div = document.createElement("div");
|
|
|
37 div.className = "mark";
|
|
|
38 div.id = "mark" + index;
|
|
|
39 div.innerHTML = index + 1;
|
|
|
40 document.body.appendChild(div);
|
|
|
41 return div;
|
|
|
42 }
|
|
|
43
|
|
|
44 function bestPicSize(elem, inset) {
|
|
|
45 // returns a Size with the best image size for the given element
|
|
|
46 if (! defined(inset)) {
|
|
|
47 inset = 25;
|
|
|
48 }
|
|
|
49 var ws = getWinSize();
|
|
|
50 var es = getElementPosition(elem);
|
|
|
51 if (es) {
|
|
|
52 ws.width = ws.width - es.x - inset;
|
|
|
53 ws.height = ws.height - es.y - inset;
|
|
|
54 }
|
|
|
55 return ws;
|
|
|
56 }
|
|
|
57
|
|
|
58
|
|
|
59 /****************************************************
|
|
|
60 * digilib specific classes (must be defined first)
|
|
|
61 ****************************************************/
|
|
|
62
|
|
|
63 /*
|
|
|
64 * Marks class
|
|
|
65 */
|
|
|
66 function Marks() {
|
|
|
67 return this;
|
|
|
68 }
|
|
|
69 // Marks inherits from Array
|
|
|
70 Marks.prototype = new Array();
|
|
|
71 Marks.prototype.parse = function(query) {
|
|
|
72 this.length = 0;
|
|
|
73 if (query.indexOf(";") >= 0) {
|
|
|
74 var pa = query.split(";"); // old format with ";"
|
|
|
75 } else {
|
|
|
76 var pa = query.split(","); // new format
|
|
|
77 }
|
|
|
78 for (var i = 0; i < pa.length ; i++) {
|
|
|
79 var pos = pa[i].split("/");
|
|
|
80 if (pos.length > 1) this.push(new Position(pos[0], pos[1]));
|
|
|
81 }
|
|
|
82 }
|
|
|
83 Marks.prototype.getAll = function() {
|
|
|
84 var ma = new Array();
|
|
|
85 for (var i = 0; i < this.length; i++) {
|
|
|
86 ma.push(cropFloat(this[i].x) + "/" + cropFloat(this[i].y));
|
|
|
87 }
|
|
|
88 return ma.join(",");
|
|
|
89 }
|
|
|
90 Marks.prototype.addEvent = function(evt, digilib) {
|
|
|
91 // add a mark from a screen event
|
|
|
92 if (!digilib) digilib = dl;
|
|
|
93 var pos = digilib.trafo.invtransform(evtPosition(evt));
|
|
|
94 this.push(pos);
|
|
|
95 }
|
|
|
96
|
|
|
97 /*
|
|
|
98 * DLParameters -- digilib parameter class
|
|
|
99 */
|
|
|
100 function DLParameters() {
|
|
|
101 // flags for parameter sets
|
|
|
102 this.PARAM_FILE = 1;
|
|
|
103 this.PARAM_MODE = 2;
|
|
|
104 this.PARAM_DIM = 4;
|
|
|
105 this.PARAM_IMAGE = 8;
|
|
|
106 this.PARAM_DPI = 16;
|
|
|
107 this.PARAM_SIZE = 32;
|
|
|
108 this.PARAM_MARK = 64;
|
|
|
109 this.PARAM_PAGES = 128;
|
|
|
110 this.PARAM_CLIENT = 256;
|
|
|
111 /* request parameters */
|
|
|
112 with (this) {
|
|
|
113 // file
|
|
|
114 define('fn', '', PARAM_FILE);
|
|
|
115 define('pn', '1', PARAM_FILE);
|
|
|
116 // mode
|
|
|
117 define('mo', '', PARAM_MODE);
|
|
|
118 // relative dimensions of zoomed image
|
|
|
119 define('wx', '0.0', PARAM_DIM);
|
|
|
120 define('wy', '0.0', PARAM_DIM);
|
|
|
121 define('ww', '1.0', PARAM_DIM);
|
|
|
122 define('wh', '1.0', PARAM_DIM);
|
|
|
123 // image manipulation
|
|
|
124 define('brgt', '0.0', PARAM_IMAGE);
|
|
|
125 define('cont', '0.0', PARAM_IMAGE);
|
|
|
126 define('rot', '0.0', PARAM_IMAGE);
|
|
|
127 define('rgba', '', PARAM_IMAGE);
|
|
|
128 define('rgbm', '', PARAM_IMAGE);
|
|
|
129 // resolution
|
|
|
130 define('ddpi', '', PARAM_DPI);
|
|
|
131 define('ddpix', '', PARAM_DPI);
|
|
|
132 define('ddpiy', '', PARAM_DPI);
|
|
|
133 // marks
|
|
|
134 define('mk', '', PARAM_MARK);
|
|
|
135 // pages total
|
|
|
136 define('pt', '0', PARAM_PAGES);
|
|
|
137 // size
|
|
|
138 define('ws', '1.0', PARAM_SIZE);
|
|
|
139 // client side options
|
|
|
140 define('clop', '', PARAM_CLIENT);
|
|
|
141 }
|
|
|
142 return this;
|
|
|
143 }
|
|
|
144 DLParameters.prototype = new Parameters();
|
|
|
145 // move the inherited getAll because we need it later
|
|
|
146 DLParameters.prototype._getAll = Parameters.prototype.getAll;
|
|
|
147 DLParameters.prototype.getAll = function(paDetail, moDetail, digilib) {
|
|
|
148 if (!digilib) digilib = dl;
|
|
|
149 // get Flags and Marks first
|
|
|
150 var mo = digilib.flags.getAll(moDetail);
|
|
|
151 this.set("mo", mo);
|
|
|
152 var clop = digilib.opts.getAll();
|
|
|
153 this.set("clop", clop);
|
|
|
154 var mk = digilib.marks.getAll();
|
|
|
155 this.set("mk", mk);
|
|
|
156 var ret = this._getAll(paDetail);
|
|
|
157 return ret;
|
|
|
158 }
|
|
|
159
|
|
|
160 /*
|
|
|
161 * DLModes -- digilib flags class
|
|
|
162 */
|
|
|
163 function DLFlags() {
|
|
|
164 // flags for mode sets
|
|
|
165 this.MODE_QUAL = 1;
|
|
|
166 this.MODE_SIZE = 2;
|
|
|
167 this.MODE_MIR = 4;
|
|
|
168 this.MODE_OTHER = 128;
|
|
|
169 this.MODE_ALL = 255;
|
|
|
170 /* mode flags */
|
|
|
171 with (this) {
|
|
|
172 define('q0', MODE_QUAL);
|
|
|
173 define('q1', MODE_QUAL);
|
|
|
174 define('q2', MODE_QUAL);
|
|
|
175 define('fit', MODE_SIZE);
|
|
|
176 define('clip', MODE_SIZE);
|
|
|
177 define('osize', MODE_SIZE);
|
|
|
178 define('vmir', MODE_MIR);
|
|
|
179 define('hmir', MODE_MIR);
|
|
|
180 }
|
|
|
181 return this;
|
|
|
182 }
|
|
|
183 // inherits from Flags
|
|
|
184 DLFlags.prototype = new Flags();
|
|
|
185
|
|
|
186
|
|
|
187 /*
|
|
|
188 * Digilib -- digilib base class
|
|
|
189 */
|
|
|
190 function Digilib() {
|
|
|
191 if (!baseLibVersion) alert("ERROR: baselib.js not loaded!");
|
|
|
192 /* constants */
|
|
|
193 this.MAX_AREA = new Rectangle(0.0, 0.0, 1.0, 1.0);
|
|
|
194 // default inset (for scalerImg relativ to scalerDiv
|
|
|
195 this.INSET = 40; // because of scrollbars of main window and scaler [Firefox bug?]
|
|
|
196 // mouse drag area that counts as one click
|
|
|
197 this.MIN_AREA_SIZE = 3 * 3 + 1;
|
|
|
198 // standard zoom factor
|
|
|
199 this.ZOOMFACTOR = Math.sqrt(2);
|
|
|
200 // bird's eye view dimensions
|
|
|
201 this.BIRD_MAXX = 200;
|
|
|
202 this.BIRD_MAXY = 200;
|
|
|
203 // witdh of arrow bars
|
|
|
204 this.ARROW_WIDTH = 32;
|
|
|
205 // width of calibration bar
|
|
|
206 this.CALIBRATION_WIDTH = 64;
|
|
|
207 /* variables */
|
|
|
208 this.fitOnlyWidth = false;
|
|
|
209 this.fitOnlyHeight = false;
|
|
|
210 this.trafo = null;
|
|
|
211 // page elements
|
|
|
212 this.scalerDiv = null;
|
|
|
213 this.scalerImg = null;
|
|
|
214 this.buttons1Div = null;
|
|
|
215 this.buttons2Div = null;
|
|
|
216 /* parse parameters */
|
|
|
217 this.params = new DLParameters();
|
|
|
218 // put the query parameters (sans "?") in the parameters array
|
|
|
219 this.params.parse(location.search.slice(1));
|
|
|
220 // treat special parameters
|
|
|
221 this.area = this.parseArea();
|
|
|
222 this.marks = new Marks();
|
|
|
223 this.marks.parse(this.params.get("mk"));
|
|
|
224 this.flags = new DLFlags();
|
|
|
225 this.flags.parse(this.params.get("mo"));
|
|
|
226 this.opts = new Flags();
|
|
|
227 this.opts.parse(this.params.get("clop"));
|
|
|
228 return this;
|
|
|
229 }
|
|
|
230 Digilib.prototype.setDLParam = function(e, s, relative) {
|
|
|
231 // sets parameter based on HTML event
|
|
|
232 var nam;
|
|
|
233 var val;
|
|
|
234 if (s.type && (s.type == "select-one")) {
|
|
|
235 nam = s.name;
|
|
|
236 val = s.options[s.selectedIndex].value;
|
|
|
237 } else if (s.name && s.value) {
|
|
|
238 nam = s.name;
|
|
|
239 val = s.value;
|
|
|
240 }
|
|
|
241 if (nam && val) {
|
|
|
242 dl.params.set(nam, val, relative);
|
|
|
243 display();
|
|
|
244 } else {
|
|
|
245 alert("ERROR: unable to process event!");
|
|
|
246 }
|
|
|
247 return true;
|
|
|
248 }
|
|
|
249 Digilib.prototype.parseArea = function() {
|
|
|
250 // returns area Rectangle from current parameters
|
|
|
251 return new Rectangle(
|
|
|
252 this.params.get("wx"),
|
|
|
253 this.params.get("wy"),
|
|
|
254 this.params.get("ww"),
|
|
|
255 this.params.get("wh"));
|
|
|
256 }
|
|
|
257 Digilib.prototype.setParamFromArea = function(rect) {
|
|
|
258 // sets digilib wx etc. from rect
|
|
|
259 this.params.set("wx", cropFloat(rect.x));
|
|
|
260 this.params.set("wy", cropFloat(rect.y));
|
|
|
261 this.params.set("ww", cropFloat(rect.width));
|
|
|
262 this.params.set("wh", cropFloat(rect.height));
|
|
|
263 return true;
|
|
|
264 }
|
|
|
265
|
|
|
266 Digilib.prototype.parseTrafo = function(elem) {
|
|
|
267 // returns Transform from current dlArea and picsize
|
|
|
268 var picsize = getElementRect(elem);
|
|
|
269 var trafo = new Transform();
|
|
|
270 // subtract area offset and size
|
|
|
271 trafo.concat(trafo.getTranslation(new Position(-this.area.x, -this.area.y)));
|
|
|
272 trafo.concat(trafo.getScale(new Size(1/this.area.width, 1/this.area.height)));
|
|
|
273 // scale to screen size
|
|
|
274 trafo.concat(trafo.getScale(picsize));
|
|
|
275 trafo.concat(trafo.getTranslation(picsize));
|
|
|
276 // FIX ME: Robert, kannst Du mal nachsehen, ob das folgende tut, was es soll?
|
|
|
277 // oder gibt es dafuer neuen Code? -- ROC: Bisher funktioniert es nicht!
|
|
|
278 // rotate
|
|
|
279 //var rot = getRotation(- dl.params.get("rot"), new Position(0.5*picsize.width, 0.5*picsize.height));
|
|
|
280 //trafo.concat(rot);
|
|
|
281 // mirror
|
|
|
282 //if (hasFlag("hmir")) trafo.m00 = - trafo.m00; // ??
|
|
|
283 //if (hasFlag("vmir")) trafo.m11 = - trafo.m11; // ??
|
|
|
284 return trafo;
|
|
|
285 }
|
|
|
286
|
|
|
287 Digilib.prototype.onLoad = function() {
|
|
|
288 // initialize digilib; called by body.onload
|
|
|
289 this.scalerDiv = getElement("scaler", true);
|
|
|
290 this.scalerImg = getElement("pic", true);
|
|
|
291 this.buttons1Div = getElement("buttons", true);
|
|
|
292 this.buttons2Div = getElement("options", true);
|
|
|
293 /*
|
|
|
294 * if (this.scalerImg == null && this.scalerDiv) { // in N4 pic is in the
|
|
|
295 * scaler layer this.scalerImg = this.scalerDiv.document.images[0]; }
|
|
|
296 */
|
|
|
297 if ((!this.scalerImg)||(!this.scalerDiv)) {
|
|
|
298 alert("Sorry, digilib doesn't work here!");
|
|
|
299 return false;
|
|
|
300 }
|
|
|
301 // fix fixed menus
|
|
|
302 var ms1 = getElementSize(this.buttons1Div);
|
|
|
303 var ms2 = getElementSize(this.buttons2Div);
|
|
|
304 var maxh = (ms1.height > ms2.height) ? ms1.height : ms2.height;
|
|
|
305 var wins = getWinSize();
|
|
|
306 if ((wins.height <= maxh) || (browserType.isIE && (browserType.versIE < 7))) {
|
|
|
307 // unlock fixed menus to absolute if window is too small or IE
|
|
|
308 this.buttons1Div.style.position = "absolute";
|
|
|
309 this.buttons2Div.style.position = "absolute";
|
|
|
310 }
|
|
|
311 this.setScalerImage(); // setzt auch onImgLoad
|
|
|
312 this.setBirdImage(); // laedt das Bird's Eye Bild
|
|
|
313 }
|
|
|
314
|
|
|
315 Digilib.prototype.setScalerImage = function() {
|
|
|
316 // set the scaler image source (needs the browser size)
|
|
|
317 var picsize = bestPicSize(this.scalerDiv);
|
|
|
318 var menusize = getElementSize(this.buttons1Div);
|
|
|
319 // subtract menu width
|
|
|
320 picsize.width -= menusize.width;
|
|
|
321 picsize.height -= this.INSET;
|
|
|
322 // compose Scaler URL
|
|
|
323 var src = "../servlet/Scaler?"
|
|
|
324 + this.params.getAll(this.params.PARAM_ALL & ~(this.params.PARAM_MARK | this.params.PARAM_PAGES));
|
|
|
325 if (this.opts.get('fitwidth')) {
|
|
|
326 src += "&dw=" + picsize.width;
|
|
|
327 } else if (this.opts.get('fitheight')) {
|
|
|
328 src += "&dh=" + picsize.height;
|
|
|
329 } else {
|
|
|
330 src += "&dw=" + picsize.width + "&dh=" + picsize.height;
|
|
|
331 }
|
|
|
332 // debug(src);
|
|
|
333 this.scalerImg.onload = onImgLoad;
|
|
|
334 this.scalerImg.src = src;
|
|
|
335
|
|
|
336 var digilib = this;
|
|
|
337 // this is a local callback function that can use the current scope
|
|
|
338
|
|
|
339 function onImgLoad() {
|
|
|
340 if (! digilib)
|
|
|
341 return;
|
|
|
342 // make sure the image is loaded so we know its size
|
|
|
343 /* this test seems to have problems sometimes :-(
|
|
|
344 if (defined(digilib.scalerImg.complete) && !digilib.scalerImg.complete) {
|
|
|
345 alert("ERROR: the image seems not to be complete in onImgLoad!?");
|
|
|
346 } */
|
|
|
347 digilib.trafo = digilib.parseTrafo(digilib.scalerImg);
|
|
|
348 // display marks
|
|
|
349 digilib.renderMarks();
|
|
|
350 digilib.showBirdDiv(isBirdDivVisible);
|
|
|
351 digilib.showArrows(); // show arrow overlays for zoom navigation
|
|
|
352 //digilib.moveCenter(true); // click to move point to center
|
|
|
353 // new Slider("sizes", 1, 5, 2);
|
|
|
354
|
|
|
355 //Drag Image (6.9.2009, not yet working)
|
|
|
356 //registerEvent("mousedown", digilib.scalerDiv, dragImage);
|
|
|
357
|
|
|
358 focus();
|
|
|
359 }
|
|
|
360 }
|
|
|
361
|
|
|
362 Digilib.prototype.renderMarks = function() {
|
|
|
363 // make sure the image is loaded so we know its size
|
|
|
364 if (!this.trafo) {
|
|
|
365 alert("ERROR: trafo missing, cannot render marks!");
|
|
|
366 return;
|
|
|
367 }
|
|
|
368 // debugProps(dlArea, "dlArea");
|
|
|
369 for (var i = 0; i < this.marks.length; i++) {
|
|
|
370 var div = getElement("mark" + i, true) || createMarkDiv(i);
|
|
|
371 var mark = this.marks[i];
|
|
|
372 // debugProps(mark, "mark");
|
|
|
373 if (this.area.containsPosition(mark)) {
|
|
|
374 var mpos = this.trafo.transform(mark);
|
|
|
375 // debugProps(mark, "mpos");
|
|
|
376 // better not hide the marked spot (MR)
|
|
|
377 // suboptimal to place -5 pixels and not half size of mark-image
|
|
|
378 // mpos.x = mpos.x -5;
|
|
|
379 // mpos.y = mpos.y -5;
|
|
|
380 moveElement(div, mpos);
|
|
|
381 showElement(div, true);
|
|
|
382 } else {
|
|
|
383 // hide the other marks
|
|
|
384 showElement(div, false);
|
|
|
385 }
|
|
|
386 }
|
|
|
387 }
|
|
|
388
|
|
|
389 Digilib.prototype.display = function(detail, moDetail) {
|
|
|
390 // redisplay the page
|
|
|
391 var queryString = this.params.getAll(detail, moDetail);
|
|
|
392 location.href
|
|
|
393 = location.protocol + "//"
|
|
|
394 + location.host
|
|
|
395 + location.pathname
|
|
|
396 + "?" + queryString;
|
|
|
397 }
|
|
|
398
|
|
|
399 /* **********************************************
|
|
|
400 * interactive digilib functions
|
|
|
401 * ******************************************** */
|
|
|
402
|
|
|
403 Digilib.prototype.setMark = function() {
|
|
|
404 // add a mark where clicked
|
|
|
405 window.focus();
|
|
|
406 this.moveCenter(false);
|
|
|
407
|
|
|
408 // start event capturing
|
|
|
409 registerEvent("mousedown", this.scalerDiv, markEvent);
|
|
|
410
|
|
|
411 // our own reference to this for the local function
|
|
|
412 var digilib = this;
|
|
|
413
|
|
|
414 function markEvent(evt) {
|
|
|
415 // event handler adding a new mark
|
|
|
416 unregisterEvent("mousedown", digilib.scalerDiv, markEvent);
|
|
|
417 digilib.marks.addEvent(evt);
|
|
|
418 digilib.display();
|
|
|
419 return stopEvent(evt);
|
|
|
420 }
|
|
|
421
|
|
|
422 }
|
|
|
423
|
|
|
424 Digilib.prototype.removeMark = function() {
|
|
|
425 // remove the last mark
|
|
|
426 this.marks.pop();
|
|
|
427 this.display();
|
|
|
428 }
|
|
|
429
|
|
|
430 Digilib.prototype.resetImage = function() {
|
|
|
431 // reset the image to its original state
|
|
|
432 this.display(this.params.PARAM_FILE); // keep only fn/pn
|
|
|
433 }
|
|
|
434
|
|
|
435 Digilib.prototype.dragImage = function(evt) {
|
|
|
436 // drag the image and load a new detail on mouse up
|
|
|
437 // makes sense only when zoomed
|
|
|
438 if (this.isFullArea())
|
|
|
439 return;
|
|
|
440 var startPos = evtPosition(evt);
|
|
|
441 var picRect = getElementRect(this.scalerImg);
|
|
|
442 var newRect; // position after drag
|
|
|
443 // start event capturing
|
|
|
444 registerEvent("mousemove", document, moveDragEvent);
|
|
|
445 registerEvent("mouseup", document, moveEndEvent);
|
|
|
446 window.focus();
|
|
|
447
|
|
|
448 // our own reference to this for the local function
|
|
|
449 var digilib = this;
|
|
|
450
|
|
|
451 function moveDragEvent(evt) {
|
|
|
452 // mousemove handler: drag
|
|
|
453 var pos = evtPosition(evt);
|
|
|
454 var dx = pos.x - startPos.x;
|
|
|
455 var dy = pos.y - startPos.y;
|
|
|
456 // move scalerImg div
|
|
|
457 newRect = new Rectangle(
|
|
|
458 picRect.x + dx,
|
|
|
459 picRect.y + dy,
|
|
|
460 picRect.width,
|
|
|
461 picRect.height);
|
|
|
462 // move scalerImg to new position
|
|
|
463 moveElement(this.scalerImg, newRect);
|
|
|
464 return stopEvent(evt);
|
|
|
465 }
|
|
|
466
|
|
|
467 function moveEndEvent(evt) {
|
|
|
468 // mouseup handler: reload page
|
|
|
469 unregisterEvent("mousemove", document, moveDragEvent);
|
|
|
470 unregisterEvent("mouseup", document, moveEndEvent);
|
|
|
471 if (newRect == null) { // no movement happened
|
|
|
472 return stopEvent(evt);
|
|
|
473 }
|
|
|
474 var newX = cropFloat(newRect.x - picRect.x);
|
|
|
475 var newY = cropFloat(newRect.y - picRect.y);
|
|
|
476 // if (newX < 0) newX = 0;
|
|
|
477 // if (newY < 0) newY = 0;
|
|
|
478 digilib.params.set("wx", newX);
|
|
|
479 digilib.params.set("wy", newY);
|
|
|
480 // zoomed is always fit
|
|
|
481 // digilib.params.set("ws", 1);
|
|
|
482 digilib.display();
|
|
|
483 return stopEvent(evt);
|
|
|
484 }
|
|
|
485 }
|
|
|
486
|
|
|
487 Digilib.prototype.zoomArea = function() {
|
|
|
488 var pt1, pt2;
|
|
|
489 var zoomdiv = getElement("zoom");
|
|
|
490 var overlay = getElement("overlay");
|
|
|
491 // use overlay div to avoid <img> mousemove problems
|
|
|
492 var picRect = getElementRect(this.scalerImg);
|
|
|
493 // FIX ME: is there a way to query the border width from CSS info?
|
|
|
494 // rect.x -= 2; // account for overlay borders
|
|
|
495 // rect.y -= 2;
|
|
|
496 moveElement(overlay, picRect);
|
|
|
497 showElement(overlay, true);
|
|
|
498 // start event capturing
|
|
|
499 registerEvent("mousedown", overlay, zoomStart);
|
|
|
500 registerEvent("mousedown", this.scalerImg, zoomStart);
|
|
|
501 window.focus();
|
|
|
502
|
|
|
503 // our own reference to "this" for the local functions
|
|
|
504 var digilib = this;
|
|
|
505
|
|
|
506 // mousedown handler: start moving
|
|
|
507 function zoomStart(evt) {
|
|
|
508 pt1 = evtPosition(evt);
|
|
|
509 unregisterEvent("mousedown", overlay, zoomStart);
|
|
|
510 unregisterEvent("mousedown", digilib.scalerImg, zoomStart);
|
|
|
511 // setup and show zoom div
|
|
|
512 moveElement(zoomdiv, Rectangle(pt1.x, pt1.y, 0, 0));
|
|
|
513 showElement(zoomdiv, true);
|
|
|
514 // register events
|
|
|
515 registerEvent("mousemove", document, zoomMove);
|
|
|
516 registerEvent("mouseup", document, zoomEnd);
|
|
|
517 return stopEvent(evt);
|
|
|
518 }
|
|
|
519
|
|
|
520 // mouseup handler: end moving
|
|
|
521 function zoomEnd(evt) {
|
|
|
522 pt2 = evtPosition(evt);
|
|
|
523 // assume a click if the area is too small (up to 3 x 3 pixel)
|
|
|
524 var clickRect = new Rectangle(pt1, pt2);
|
|
|
525 clickRect.normalize();
|
|
|
526 if (clickRect.getArea() <= digilib.MIN_AREA_SIZE) {
|
|
|
527 return stopEvent(evt);
|
|
|
528 }
|
|
|
529 // hide zoom div
|
|
|
530 showElement(zoomdiv, false);
|
|
|
531 showElement(overlay, false);
|
|
|
532 // unregister events
|
|
|
533 unregisterEvent("mousemove", document, zoomMove);
|
|
|
534 unregisterEvent("mouseup", document, zoomEnd);
|
|
|
535 // clip and transform
|
|
|
536 clickRect.clipTo(picRect);
|
|
|
537 var area = digilib.trafo.invtransform(clickRect);
|
|
|
538 digilib.setParamFromArea(area);
|
|
|
539 // zoomed is always fit
|
|
|
540 digilib.params.set("ws", 1);
|
|
|
541 digilib.display();
|
|
|
542 return stopEvent(evt);
|
|
|
543 }
|
|
|
544
|
|
|
545 // mouse move handler
|
|
|
546 function zoomMove(evt) {
|
|
|
547 pt2 = evtPosition(evt);
|
|
|
548 var rect = new Rectangle(pt1, pt2);
|
|
|
549 rect.normalize();
|
|
|
550 rect.clipTo(picRect);
|
|
|
551 // update zoom div
|
|
|
552 moveElement(zoomdiv, rect);
|
|
|
553 return stopEvent(evt);
|
|
|
554 }
|
|
|
555 }
|
|
|
556
|
|
|
557 Digilib.prototype.zoomBy = function(factor) {
|
|
|
558 // zooms by the given factor
|
|
|
559 var newarea = this.area.copy();
|
|
|
560 newarea.width /= factor;
|
|
|
561 newarea.height /= factor;
|
|
|
562 newarea.x -= 0.5 * (newarea.width - this.area.width);
|
|
|
563 newarea.y -= 0.5 * (newarea.height - this.area.height);
|
|
|
564 newarea = this.MAX_AREA.fit(newarea);
|
|
|
565 this.setParamFromArea(newarea);
|
|
|
566 this.display();
|
|
|
567 }
|
|
|
568
|
|
|
569
|
|
|
570 Digilib.prototype.zoomFullpage = function(fit) {
|
|
|
571 // zooms out to show the whole image
|
|
|
572 this.params.set("wx", 0.0);
|
|
|
573 this.params.set("wy", 0.0);
|
|
|
574 this.params.set("ww", 1.0);
|
|
|
575 this.params.set("wh", 1.0);
|
|
|
576 if (fit == "width") {
|
|
|
577 this.opts.set('fitwidth');
|
|
|
578 } else if (fit == "height") {
|
|
|
579 this.opts.set('fitheight');
|
|
|
580 } else {
|
|
|
581 this.opts.reset('fitwidth');
|
|
|
582 this.opts.reset('fitheight');
|
|
|
583 }
|
|
|
584 this.display();
|
|
|
585 }
|
|
|
586
|
|
|
587
|
|
|
588 Digilib.prototype.moveCenter = function(on) {
|
|
|
589 // move visible area so that it's centered around the clicked point
|
|
|
590 if (this.isFullArea()) return; // nothing to do
|
|
|
591 // starting event capture
|
|
|
592 if (on) registerEvent("mousedown", this.scalerImg, moveCenterEvent);
|
|
|
593 else unregisterEvent("mousedown", this.scalerImg, moveCenterEvent);
|
|
|
594 window.focus();
|
|
|
595
|
|
|
596 // our own reference to this for the local function
|
|
|
597 var digilib = this;
|
|
|
598
|
|
|
599 function moveCenterEvent(evt) {
|
|
|
600 // move to handler
|
|
|
601 var pt = digilib.trafo.invtransform(evtPosition(evt));
|
|
|
602 var newarea = digilib.area.copy();
|
|
|
603 newarea.setCenter(pt);
|
|
|
604 newarea.stayInside(this.MAX_AREA);
|
|
|
605 // newarea = dlMaxArea.fit(newarea);
|
|
|
606 // debugProps(newarea, "newarea");
|
|
|
607 // debugProps(dlArea, "dlArea");
|
|
|
608 if (newarea.equals(digilib.area)) return; // keep event handler
|
|
|
609 unregisterEvent("mousedown", digilib.scalerImg, moveCenterEvent);
|
|
|
610 // set parameters
|
|
|
611 digilib.setParamFromArea(newarea);
|
|
|
612 digilib.display();
|
|
|
613 }
|
|
|
614 }
|
|
|
615
|
|
|
616 Digilib.prototype.isFullArea = function(area) {
|
|
|
617 if (!area) area = this.area;
|
|
|
618 return (area.width == 1.0) && (area.height == 1.0);
|
|
|
619 }
|
|
|
620
|
|
|
621 Digilib.prototype.canMove = function(movx, movy) {
|
|
|
622 if (this.isFullArea()) return false;
|
|
|
623 var x2 = this.area.x + this.area.width;
|
|
|
624 var y2 = this.area.y + this.area.height;
|
|
|
625 // debugProps(dlArea);
|
|
|
626 return ((movx < 0) && (this.area.x > 0))
|
|
|
627 || ((movx > 0) && (x2 < 1.0))
|
|
|
628 || ((movy < 0) && (this.area.y > 0))
|
|
|
629 || ((movy > 0) && (y2 < 1.0))
|
|
|
630 }
|
|
|
631
|
|
|
632 Digilib.prototype.moveBy = function(movx, movy) {
|
|
|
633 // move visible area by movx and movy (in units of ww, wh)
|
|
|
634 if (!this.canMove(movx, movy)) return; // nothing to do
|
|
|
635 var newarea = this.area.copy();
|
|
|
636 newarea.x += parseFloat(movx)*this.area.width;
|
|
|
637 newarea.y += parseFloat(movy)*this.area.height;
|
|
|
638 newarea = this.MAX_AREA.fit(newarea);
|
|
|
639 // set parameters
|
|
|
640 this.setParamFromArea(newarea);
|
|
|
641 this.display();
|
|
|
642 }
|
|
|
643
|
|
|
644 Digilib.prototype.getRef = function(baseUrl) {
|
|
|
645 // returns a reference to the current digilib set
|
|
|
646 if (!baseUrl) baseUrl
|
|
|
647 = location.protocol
|
|
|
648 + "//"
|
|
|
649 + location.host
|
|
|
650 + location.pathname;
|
|
|
651 var hyperlinkRef = baseUrl;
|
|
|
652 with (this.params) {
|
|
|
653 // all without ddpi, pt
|
|
|
654 var ps = getAll(PARAM_ALL & ~(PARAM_DPI | PARAM_PAGES | PARAM_CLIENT));
|
|
|
655 }
|
|
|
656 if (ps.length > 0) hyperlinkRef += "?" + ps;
|
|
|
657 return hyperlinkRef;
|
|
|
658 }
|
|
|
659
|
|
|
660 Digilib.prototype.getRefWin = function(type, msg) {
|
|
|
661 // shows an alert with a reference to the current digilib set
|
|
|
662 if (! msg) msg = "URL reference to the current view";
|
|
|
663 prompt(msg, this.getRef());
|
|
|
664 }
|
|
|
665
|
|
|
666 Digilib.prototype.getQuality = function() {
|
|
|
667 // returns the current q setting
|
|
|
668 for (var i = 0; i < 3; i++) {
|
|
|
669 if (this.flags.get("q"+i)) return i;
|
|
|
670 }
|
|
|
671 return 1
|
|
|
672 }
|
|
|
673
|
|
|
674 Digilib.prototype.setQuality = function(qual) {
|
|
|
675 // set the image quality
|
|
|
676 if ((qual < 0)||(qual > 2)) return alert("Quality setting not supported");
|
|
|
677 for (var i = 0; i < 3; i++) this.flags.reset("q" + i);
|
|
|
678 this.flags.set("q" + qual);
|
|
|
679 this.display();
|
|
|
680 }
|
|
|
681
|
|
|
682 Digilib.prototype.setQualityWin = function(msg) {
|
|
|
683 // dialog for setting quality
|
|
|
684 if (! msg) msg = "Quality (0..2)";
|
|
|
685 var q = this.getQuality();
|
|
|
686 var newq = window.prompt(msg, q);
|
|
|
687 if (newq) this.setQuality(newq);
|
|
|
688 }
|
|
|
689
|
|
|
690 Digilib.prototype.mirror = function(dir) {
|
|
|
691 // mirror the image horizontally or vertically
|
|
|
692 if (dir == "h") {
|
|
|
693 this.flags.toggle("hmir");
|
|
|
694 } else {
|
|
|
695 this.flags.toggle("vmir");
|
|
|
696 }
|
|
|
697 this.display();
|
|
|
698 }
|
|
|
699
|
|
|
700 Digilib.prototype.gotoPage = function(gopage, keep) {
|
|
|
701 // goto given page nr (+/-: relative)
|
|
|
702 var oldpn = parseInt(this.params.get("pn"));
|
|
|
703 // set with relative=true uses the sign
|
|
|
704 this.params.set("pn", gopage, true);
|
|
|
705 // now check the outcome
|
|
|
706 var pn = parseInt(this.params.get("pn"));
|
|
|
707 if (pn < 1) {
|
|
|
708 alert("No such page! (Page number too low)");
|
|
|
709 this.params.set("pn", oldpn);
|
|
|
710 return;
|
|
|
711 }
|
|
|
712 if (this.params.isSet("pt")) {
|
|
|
713 pt = parseInt(this.params.get("pt"))
|
|
|
714 if (pn > pt) {
|
|
|
715 alert("No such page! (Page number too high)");
|
|
|
716 this.params.set("pn", oldpn);
|
|
|
717 return;
|
|
|
718 }
|
|
|
719 }
|
|
|
720 if (keep) {
|
|
|
721 this.display(this.params.PARAM_ALL & ~this.params.PARAM_MARK); // all, no mark
|
|
|
722 } else {
|
|
|
723 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
|
|
|
724 }
|
|
|
725 }
|
|
|
726
|
|
|
727 Digilib.prototype.gotoPageWin = function() {
|
|
|
728 // dialog to ask for new page nr
|
|
|
729 var pn = this.params.get("pn");
|
|
|
730 var gopage = window.prompt("Go to page", pn);
|
|
|
731 if (gopage) this.gotoPage(gopage);
|
|
|
732 }
|
|
|
733
|
|
|
734 Digilib.prototype.setParamWin = function(param, text, relative) {
|
|
|
735 // dialog to ask for new parameter value
|
|
|
736 var val = this.params.get(param);
|
|
|
737 var newval = window.prompt(text, val);
|
|
|
738 if (newval) {
|
|
|
739 this.params.set(param, newval, relative);
|
|
|
740 this.display();
|
|
|
741 }
|
|
|
742 }
|
|
|
743
|
|
|
744 Digilib.prototype.showOptions = function(show) {
|
|
|
745 // show or hide option div
|
|
|
746 var elem = getElement("dloptions");
|
|
|
747 showElement(elem, show);
|
|
|
748 // FIX ME: get rid of the dotted line around the buttons when focused
|
|
|
749 }
|
|
|
750
|
|
|
751 Digilib.prototype.showAboutDiv = function(show) {
|
|
|
752 // show or hide "about" div
|
|
|
753 var elem = getElement("about");
|
|
|
754 if (elem == null) {
|
|
|
755 if (show) alert("About Digilib - dialog missing in HTML code!"
|
|
|
756 + "\nDigilib Version: " + digilibVersion
|
|
|
757 + "\JSP Version: " + jspVersion
|
|
|
758 + "\ndlLib Version: " + dllibVersion
|
|
|
759 + "\nbaseLib Version: " + baseLibVersion);
|
|
|
760 return;
|
|
|
761 }
|
|
|
762 if (show) {
|
|
|
763 getElement("digilib-version").innerHTML = "Digilib Version: " + digilibVersion;
|
|
|
764 getElement("jsp-version").innerHTML = "JSP Version: " + jspVersion;
|
|
|
765 getElement("baselib-version").innerHTML = "baseLib Version: " + baseLibVersion;
|
|
|
766 getElement("dllib-version").innerHTML = "dlLib Version: " + dllibVersion;
|
|
|
767 var aboutRect = getElementRect(elem);
|
|
|
768 aboutRect.setCenter(getWinRect().getCenter());
|
|
|
769 moveElement(elem, aboutRect);
|
|
|
770 }
|
|
|
771 showElement(elem, show);
|
|
|
772 }
|
|
|
773
|
|
|
774 Digilib.prototype.setBirdImage = function() {
|
|
|
775 var img = getElement("bird-image");
|
|
|
776 var src = "../servlet/Scaler?"
|
|
|
777 + this.params.getAll(this.params.PARAM_FILE)
|
|
|
778 + "&dw=" + this.BIRD_MAXX
|
|
|
779 + "&dh=" + this.BIRD_MAXY;
|
|
|
780 img.src = src;
|
|
|
781 }
|
|
|
782
|
|
|
783 Digilib.prototype.showBirdDiv = function(show) {
|
|
|
784 // show or hide "bird's eye" div
|
|
|
785 var startPos; // anchor for dragging
|
|
|
786 var newRect; // position after drag
|
|
|
787 var birdImg = getElement("bird-image");
|
|
|
788 var birdArea = getElement("bird-area");
|
|
|
789 var overlay = getElement("bird-overlay");
|
|
|
790 showElement(birdImg, show);
|
|
|
791 // dont show selector if area has full size
|
|
|
792 if (!show || this.isFullArea()) {
|
|
|
793 // hide area
|
|
|
794 showElement(birdArea, false);
|
|
|
795 showElement(overlay, false);
|
|
|
796 return;
|
|
|
797 };
|
|
|
798 var birdImgRect = getElementRect(birdImg);
|
|
|
799 var area = this.area;
|
|
|
800 if (this.flags.get("osize") || this.flags.get("clip")) {
|
|
|
801 // in original-size and pixel-by-pixel mode the area size is not valid
|
|
|
802 var birdAreaRect = new Rectangle(
|
|
|
803 birdImgRect.x + birdImgRect.width * area.x,
|
|
|
804 birdImgRect.y + birdImgRect.height * area.y,
|
|
|
805 5,
|
|
|
806 5);
|
|
|
807 } else {
|
|
|
808 // scale area down to img size
|
|
|
809 var birdAreaRect = new Rectangle(
|
|
|
810 // what about borders ??
|
|
|
811 birdImgRect.x + birdImgRect.width * area.x,
|
|
|
812 birdImgRect.y + birdImgRect.height * area.y,
|
|
|
813 birdImgRect.width * area.width,
|
|
|
814 birdImgRect.height * area.height);
|
|
|
815 }
|
|
|
816 moveElement(birdArea, birdAreaRect);
|
|
|
817 showElement(birdArea, true);
|
|
|
818 moveElement(overlay, birdImgRect);
|
|
|
819 showElement(overlay, true);
|
|
|
820 registerEvent("mousedown", overlay, birdAreaStartDrag);
|
|
|
821 registerEvent("mousedown", birdImg, birdAreaStartDrag);
|
|
|
822
|
|
|
823 // our own reference to this for local functions
|
|
|
824 var digilib = this;
|
|
|
825
|
|
|
826 function birdAreaStartDrag(evt) {
|
|
|
827 // mousedown handler: start drag
|
|
|
828 startPos = evtPosition(evt);
|
|
|
829 unregisterEvent("mousedown", overlay, birdAreaStartDrag);
|
|
|
830 unregisterEvent("mousedown", birdImg, birdAreaStartDrag);
|
|
|
831 registerEvent("mousemove", document, birdAreaMove);
|
|
|
832 registerEvent("mouseup", document, birdAreaEndDrag);
|
|
|
833 // debugProps(getElementRect(bird))
|
|
|
834 return stopEvent(evt);
|
|
|
835 }
|
|
|
836
|
|
|
837 function birdAreaMove(evt) {
|
|
|
838 // mousemove handler: drag
|
|
|
839 var pos = evtPosition(evt);
|
|
|
840 var dx = pos.x - startPos.x;
|
|
|
841 var dy = pos.y - startPos.y;
|
|
|
842 // move birdArea div, keeping size
|
|
|
843 newRect = new Rectangle(
|
|
|
844 birdAreaRect.x + dx,
|
|
|
845 birdAreaRect.y + dy,
|
|
|
846 birdAreaRect.width,
|
|
|
847 birdAreaRect.height);
|
|
|
848 // stay within image
|
|
|
849 newRect.stayInside(birdImgRect);
|
|
|
850 moveElement(birdArea, newRect);
|
|
|
851 showElement(birdArea, true);
|
|
|
852 return stopEvent(evt);
|
|
|
853 }
|
|
|
854
|
|
|
855 function birdAreaEndDrag(evt) {
|
|
|
856 // mouseup handler: reload page
|
|
|
857 unregisterEvent("mousemove", document, birdAreaMove);
|
|
|
858 unregisterEvent("mouseup", document, birdAreaEndDrag);
|
|
|
859 showElement(overlay, false);
|
|
|
860 if (newRect == null) { // no movement happened
|
|
|
861 startPos = birdAreaRect.getCenter();
|
|
|
862 birdAreaMove(evt); // set center to click position
|
|
|
863 }
|
|
|
864 digilib.params.set("wx", cropFloat((newRect.x - birdImgRect.x) / birdImgRect.width));
|
|
|
865 digilib.params.set("wy", cropFloat((newRect.y - birdImgRect.y) / birdImgRect.height));
|
|
|
866 // zoomed is always fit
|
|
|
867 digilib.params.set("ws", 1);
|
|
|
868 digilib.display();
|
|
|
869 return stopEvent(evt);
|
|
|
870 }
|
|
|
871 }
|
|
|
872
|
|
|
873 Digilib.prototype.showArrow = function(name, rect, show) {
|
|
|
874 var arrow = getElement(name);
|
|
|
875 moveElement(arrow, rect);
|
|
|
876 showElement(arrow, show);
|
|
|
877 }
|
|
|
878
|
|
|
879 Digilib.prototype.showArrows = function() {
|
|
|
880 // show the 4 arrow bars on top of scaler img according to current dlArea
|
|
|
881 var r = getElementRect(this.scalerImg);
|
|
|
882 this.showArrow('up',
|
|
|
883 new Rectangle(r.x, r.y, r.width, this.ARROW_WIDTH),
|
|
|
884 this.canMove(0, -1)
|
|
|
885 );
|
|
|
886 this.showArrow('down',
|
|
|
887 new Rectangle(r.x, r.y + r.height - this.ARROW_WIDTH, r.width, this.ARROW_WIDTH),
|
|
|
888 this.canMove(0, 1)
|
|
|
889 );
|
|
|
890 this.showArrow('left',
|
|
|
891 new Rectangle(r.x, r.y, this.ARROW_WIDTH, r.height),
|
|
|
892 this.canMove(-1, 0)
|
|
|
893 );
|
|
|
894 this.showArrow('right',
|
|
|
895 new Rectangle(r.x + r.width - this.ARROW_WIDTH, r.y, this.ARROW_WIDTH, r.height),
|
|
|
896 this.canMove(1, 0)
|
|
|
897 );
|
|
|
898 }
|
|
|
899
|
|
|
900 Digilib.prototype.calibrate = function() {
|
|
|
901 // calibrate screen resolution
|
|
|
902 var calDiv = getElement("calibration");
|
|
|
903 var calRect = getElementRect(calDiv);
|
|
|
904 moveCenter(false);
|
|
|
905 var wins = getWinSize();
|
|
|
906 calRect.setCenter(new Position(wins.width / 2, wins.height / 2));
|
|
|
907 moveElement(calDiv, calRect);
|
|
|
908 showElement(calDiv, true);
|
|
|
909 var cm = window.prompt("The length of the scale on your screen in centimeter:");
|
|
|
910 if (cm) {
|
|
|
911 var dpi = calRect.width / parseFloat(cm) * 2.54;
|
|
|
912 this.params.set("ddpi", cropFloat(dpi));
|
|
|
913 }
|
|
|
914 showElement(calDiv, false);
|
|
|
915 }
|
|
|
916
|
|
|
917
|
|
|
918 Digilib.prototype.setScale = function(scale) {
|
|
|
919 // sets original-size, pixel-by-pixel or fit-to-screen scale type
|
|
|
920 if (scale == "pixel") {
|
|
|
921 // pixel by pixel
|
|
|
922 this.flags.set("clip");
|
|
|
923 this.flags.reset("osize");
|
|
|
924 this.flags.reset("fit");
|
|
|
925 } else if (scale == "original") {
|
|
|
926 // original size -- needs calibrated screen
|
|
|
927 if (!this.params.isSet("ddpi")) {
|
|
|
928 var dpi = cookie.get("ddpi");
|
|
|
929 if (dpi == null) {
|
|
|
930 alert("Your screen has not yet been calibrated - using default value of 72 dpi");
|
|
|
931 dpi = 72;
|
|
|
932 }
|
|
|
933 this.params.set("ddpi", dpi);
|
|
|
934 }
|
|
|
935 this.flags.set("osize");
|
|
|
936 this.flags.reset("clip");
|
|
|
937 this.flags.reset("fit");
|
|
|
938 } else {
|
|
|
939 // scale to screen size (default)
|
|
|
940 this.flags.reset("clip");
|
|
|
941 this.flags.reset("osize");
|
|
|
942 }
|
|
|
943 this.display();
|
|
|
944 }
|
|
|
945
|
|
|
946 Digilib.prototype.getScale = function() {
|
|
|
947 // returns scale type
|
|
|
948 if (this.flags.get("clip")) {
|
|
|
949 return "pixel";
|
|
|
950 } else if (this.flags.get("osize")) {
|
|
|
951 return "original";
|
|
|
952 } else {
|
|
|
953 return "fit";
|
|
|
954 }
|
|
|
955 }
|
|
|
956
|
|
|
957 Digilib.prototype.pageWidth = function() {
|
|
|
958 this.zoomFullpage('width');
|
|
|
959 }
|
|
|
960
|
|
|
961 Digilib.prototype.setSize = function(factor) {
|
|
|
962 this.params.set("ws", factor);
|
|
|
963 this.display();
|
|
|
964 }
|
|
|
965
|
|
|
966 Digilib.prototype.showMenu = function(menuId, buttonId, show) {
|
|
|
967 var menu = getElement(menuId);
|
|
|
968 if (show) {
|
|
|
969 // align right side of menu with button
|
|
|
970 var buttonPos = getElementPosition(getElement(buttonId));
|
|
|
971 var menusize = getElementSize(menu);
|
|
|
972 moveElement(menu, new Position(buttonPos.x - menusize.width - 3, buttonPos.y));
|
|
|
973 }
|
|
|
974 showElement(menu, show);
|
|
|
975 }
|
|
|
976
|
|
|
977
|
|
|
978 /********************************
|
|
|
979 * global variables
|
|
|
980 ********************************/
|
|
|
981
|
|
|
982 var dl = new Digilib();
|
|
|
983
|
|
|
984 /* old parameter function compatibility stuff */
|
|
|
985 function newParameter(a,b,c) {return dl.params.define(a,b,c)};
|
|
|
986 function resetParameter(a) {return dl.params.reset(a)};
|
|
|
987 function deleteParameter(a) {return dl.params.remove(a)};
|
|
|
988 function getParameter(a) {return dl.params.get(a)};
|
|
|
989 function setParameter(a,b,c) {return dl.params.set(a,b,c)};
|
|
|
990 function hasParameter(a) {return dl.params.isSet(a)};
|
|
|
991 function getAllParameters(a) {return dl.params.getAll(a)};
|
|
|
992 getQueryString = getAllParameters;
|
|
|
993 function parseParameters(a) {return dl.params.parse(a)};
|
|
|
994 function getAllMarks() {return dl.marks.getAll()};
|
|
|
995 getMarksQueryString = getAllMarks;
|
|
|
996 function addMark(evt) {return dl.marks.addEvent(evt)};
|
|
|
997 function deleteMark() {return dl.marks.pop()};
|
|
|
998 function deleteAllMarks() {return dl.marks = new Marks()};
|
|
|
999 function hasFlag(mode) {return dl.flags.get(mode)};
|
|
|
1000 function addFlag(mode) {return dl.flags.set(mode)};
|
|
|
1001 function removeFlag(mode) {return dl.flags.reset(mode)};
|
|
|
1002 function toggleFlag(mode) {return dl.flags.toggle(mode)};
|
|
|
1003 function getAllFlags() {return dl.flags.getAll()};
|
|
|
1004 /* old digilib function compatibility */
|
|
|
1005 function setDLParam(e, s, relative) {dl.setDLParam(e, s, relative)};
|
|
|
1006 function display(detail, moDetail) {dl.display(detail, moDetail)};
|
|
|
1007 function setMark(reload) {dl.setMark(reload)};
|
|
|
1008 function removeMark(reload) {dl.removeMark(reload)};
|
|
|
1009 function resetImage() {dl.resetImage()};
|
|
|
1010 function dragImage(evt) {dl.dragImage(evt)};
|
|
|
1011 function zoomArea() {dl.zoomArea()};
|
|
|
1012 function zoomBy(factor) {dl.zoomBy(factor)};
|
|
|
1013 function zoomFullpage(a) {dl.zoomFullpage(a)};
|
|
|
1014 function moveCenter(on) {dl.moveCenter(on)};
|
|
|
1015 function isFullArea(area) {dl.isFullArea(area)};
|
|
|
1016 function canMove(movx, movy) {dl.canMove(movx, movy)};
|
|
|
1017 function moveBy(movx, movy) {dl.moveBy(movx, movy)};
|
|
|
1018 function getRef(baseURL) {dl.getRef(baseURL)};
|
|
|
1019 function getRefWin(type, msg) {dl.getRefWin(type, msg)};
|
|
|
1020 function getQuality() {dl.getQuality()};
|
|
|
1021 function setQuality(qual) {dl.setQuality(qual)};
|
|
|
1022 function setQualityWin(msg) {dl.setQualityWin(msg)};
|
|
|
1023 function mirror(dir) {dl.mirror(dir)};
|
|
|
1024 function gotoPage(gopage, keep) {dl.gotoPage(gopage, keep)};
|
|
|
1025 function gotoPageWin() {dl.gotoPageWin()};
|
|
|
1026 function setParamWin(param, text, relative) {dl.setParamWin(param, text, relative)};
|
|
|
1027 function showOptions(show) {dl.showOptions(show)};
|
|
|
1028 function showBirdDiv(show) {dl.showBirdDiv(show)};
|
|
|
1029 function showAboutDiv(show) {dl.showAboutDiv(show)};
|
|
|
1030 function calibrate(direction) {dl.calibrate(direction)};
|
|
|
1031 function setScale(a) {dl.setScale(a)};
|
|
|
1032 function getScale(a) {dl.getScale(a)};
|
|
|
1033 function originalSize(on) {dl.originalSize(on)};
|
|
|
1034 function pixelByPixel(on) {dl.pixelByPixel(on)};
|
|
|
1035 function pageWidth() {dl.pageWidth()};
|
|
|
1036 function setSize(factor) {dl.setSize(factor)};
|
|
|
1037 function showMenu(a,b,c) {dl.showMenu(a,b,c)};
|
|
|
1038
|
|
|
1039
|
|
|
1040 // :tabSize=4:indentSize=4:noTabs=true:
|
|
|
1041
|