Mercurial > hg > digilib-old
annotate client/digitallibrary/greyskin/diginew.jsp @ 451:a6c83fa262b2
still somewhat experimental intermediary release
- Digilib is now an object with methods
- in theory we could now have more than one digilib instance on a page
- for compatibility one instance is created and wrapper methods exist
- setting a mark recenters the view for some (unrelated) reason
author | robcast |
---|---|
date | Mon, 23 Jan 2006 22:36:29 +0100 |
parents | 4255c09a8147 |
children | 9c16290e6f44 |
rev | line source |
---|---|
400 | 1 <%@ page language="java" %><%! |
2 // -- JSP init ------------- | |
3 | |
4 // create DocumentBean instance for all JSP requests | |
5 digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean(); | |
6 | |
7 // initialize DocumentBean instance in JSP init | |
8 public void jspInit() { | |
9 try { | |
450 | 10 // set servlet init-parameter |
11 docBean.setConfig(getServletConfig()); | |
400 | 12 } catch (javax.servlet.ServletException e) { |
450 | 13 System.out.println(e); |
400 | 14 } |
15 } | |
16 // -- end of JSP init ------------- | |
450 | 17 %><% |
400 | 18 // -- JSP request ------------- |
19 | |
20 // parsing the query | |
21 // ----------------- | |
22 digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); | |
23 docBean.setRequest(dlRequest); | |
24 // check if authentication is needed and redirect if necessary | |
25 docBean.doAuthentication(response); | |
26 // add number of pages | |
27 dlRequest.setValue("pt", docBean.getNumPages()); | |
28 // store objects for jsp:include | |
29 pageContext.setAttribute("docBean", docBean, pageContext.REQUEST_SCOPE); | |
30 | |
450 | 31 %><html> |
400 | 32 <head> |
33 <title>Digital Document Library NG</title> | |
34 | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
35 <link rel="stylesheet" type="text/css" href="diginew.css" /> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
36 |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
37 <script type="text/javascript" src="debug.js"></script> |
400 | 38 |
39 <script type="text/javascript" src="baselib.js"></script> | |
40 | |
41 <script type="text/javascript" src="dllib.js"></script> | |
42 | |
43 <script language="JavaScript"> | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
44 |
450 | 45 var jspVersion = "diginew.jsp 1.020"; |
434 | 46 var cookie = new Cookie(); |
47 // alert(strObject(cookie)); | |
48 | |
49 var isOptionDivVisible = cookie.getbool("isOptionDivVisible"); | |
50 var isBirdDivVisible = cookie.getbool("isBirdDivVisible"); | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
51 var isAboutDivVisible = false; |
443 | 52 var isSizeMenuVisible = false; |
53 var isOriginalSize = false; | |
54 var isPixelByPixel = false; | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
55 var dlTarget = window.name; |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
56 var baseUrl = '<%= dlRequest.getAsString("base.url") %>'; |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
57 var toolbarEnabledURL = window.location.href; |
445 | 58 var waited = 0; |
400 | 59 |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
60 function toggleOptionDiv() { |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
61 isOptionDivVisible = !isOptionDivVisible; |
434 | 62 cookie.addbool("isOptionDivVisible", isOptionDivVisible); |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
63 showOptions(isOptionDivVisible); |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
64 } |
400 | 65 |
434 | 66 function toggleBirdDiv() { |
67 isBirdDivVisible = !isBirdDivVisible; | |
68 cookie.addbool("isBirdDivVisible", isBirdDivVisible); | |
69 showBirdDiv(isBirdDivVisible); | |
70 } | |
71 | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
72 function toggleAboutDiv() { |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
73 isAboutDivVisible = !isAboutDivVisible; |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
74 showAboutDiv(isAboutDivVisible); |
400 | 75 } |
76 | |
443 | 77 function toggleSizeMenu() { |
78 isSizeMenuVisible = !isSizeMenuVisible; | |
79 showSizeMenu(isSizeMenuVisible); | |
80 } | |
81 | |
82 function toggleOriginalSize(on) { | |
83 isOriginalSize = (arguments.length == 1) | |
84 ? on | |
85 : !isOriginalSize; | |
86 togglePixelByPixel(false); | |
87 originalSize(isOriginalSize); | |
88 } | |
89 | |
90 function togglePixelByPixel(on) { | |
91 isPixelByPixel = (arguments.length == 1) | |
92 ? on | |
93 : !isPixelByPixel; | |
94 toggleOriginalSize(false); | |
95 pixelByPixel(isPixelByPixel); | |
96 } | |
97 | |
98 function setOnImage(id, src, value) { | |
415 | 99 // replace img src and display "on" status |
100 var elem = getElement(id); | |
101 elem.src = src; | |
443 | 102 if (value) |
103 elem.title += ": " + value; | |
104 else | |
105 elem.title += ": on"; | |
415 | 106 } |
107 | |
108 // change icons if image functions are on | |
109 function reflectImageStatus() { | |
110 if (hasFlag("hmir")) setOnImage("hmir", "mirror-horizontal-on.png"); | |
111 if (hasFlag("vmir")) setOnImage("vmir", "mirror-vertical-on.png"); | |
451 | 112 if (hasParameter("brgt")) |
113 setOnImage("brgt", "brightness-on.png", getParameter("brgt")); | |
114 if (hasParameter("cont")) | |
115 setOnImage("cont", "contrast-on.png", getParameter("cont")); | |
116 if (hasParameter("rot")) | |
117 setOnImage("rot", "rotate-on.png", getParameter("rot")); | |
118 if (hasParameter("rgb")) | |
119 setOnImage("rgb", "rgb-on.png", getParameter("rgb")); | |
415 | 120 } |
450 | 121 |
445 | 122 |
123 // initialize digilib; called by body.onload | |
434 | 124 function onBodyLoad() { |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
125 document.id = 'digilib'; |
451 | 126 dl.onLoad(); |
127 dl.showOptions(isOptionDivVisible); | |
128 reflectImageStatus(); // adjust icons | |
129 } | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
130 |
434 | 131 function onBodyUnload() { |
132 // alert(strObject(cookie)); | |
133 cookie.store(); | |
134 } | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
135 |
400 | 136 </script> |
137 </head> | |
138 | |
434 | 139 <body onload="onBodyLoad();" onunload="onBodyUnload();"> |
400 | 140 |
141 <!-- slot for the scaled image --> | |
434 | 142 <div id="scaler"> |
143 <img id="pic"></img> | |
400 | 144 </div> |
145 | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
146 <!-- sensitive overlay for zoom area etc --> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
147 <div id="overlay"> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
148 </div> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
149 |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
150 <!-- the zoom area selection rectangle --> |
400 | 151 <div id="zoom"> |
152 </div> | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
153 |
415 | 154 <!-- the bird's eye overview image --> |
155 <img id="bird-image"></img> | |
156 | |
157 <!-- the bird's eye select area --> | |
158 <div id="bird-area"> | |
159 </div> | |
434 | 160 |
415 | 161 <!-- the arrows --> |
162 <a class="arrow" id="up" href="javascript:moveBy(0, -0.5)"></a> | |
163 <a class="arrow" id="down" href="javascript:moveBy(0, 0.5)"></a> | |
164 <a class="arrow" id="left" href="javascript:moveBy(-0.5, 0)"></a> | |
165 <a class="arrow" id="right" href="javascript:moveBy(0.5, 0)"></a> | |
166 | |
167 <!-- the about window --> | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
168 <div id="about" class="about" onclick="toggleAboutDiv()"> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
169 <p>Digilib Graphic Viewer</p> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
170 <a href="http://digilib.berlios.de" target="_blank" > |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
171 <img class="logo" src="../img/digilib-logo-text1.png" title="digilib"></img> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
172 </a> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
173 <p id="digilib-version"></p> |
434 | 174 <p id="jsp-version"></p> |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
175 <p id="baselib-version"></p> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
176 <p id="dllib-version"></p> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
177 </div> |
400 | 178 |
434 | 179 <!-- the calibration div --> |
439 | 180 <div id="calibration"> |
181 <div> | |
182 <p>0 px</p> | |
183 <p class="cm">10 cm</p> | |
184 </div> | |
185 </div> | |
400 | 186 |
440 | 187 <!-- the size menu --> |
188 <div id="sizes"> | |
443 | 189 <p><a href="javascript:resize(1)">1 x</a></p> |
190 <p><a href="javascript:resize(1.41)">1.41 x</a></p> | |
191 <p><a href="javascript:resize(2)">2 x</a></p> | |
192 <p><a href="javascript:resize(3)">3 x</a></p> | |
445 | 193 <div id="sizes-bar"> |
194 <div id="sizes-slider"></div> | |
195 </div> | |
196 <p id="sizes-value"></p> | |
440 | 197 </div> |
198 | |
439 | 199 <!-- the buttons --> |
400 | 200 <div id="buttons"> |
440 | 201 <div class="separator"> |
202 </div> | |
203 | |
400 | 204 <div class="button"> |
205 <a | |
206 class="icon" | |
440 | 207 href="javascript:getRefWin()" |
400 | 208 > |
209 | |
210 <img | |
211 class="png" | |
440 | 212 id="reference" |
213 title="get a reference URL" | |
214 src="reference.png" | |
400 | 215 > |
440 | 216 </a> |
400 | 217 </div> |
440 | 218 |
400 | 219 <div class="button"> |
220 <a | |
221 class="icon" | |
451 | 222 href="javascript:dl.zoomBy(1.4)" |
400 | 223 > |
224 | |
225 <img | |
226 class="png" | |
227 id="zoom-in" | |
228 title="zoom in" | |
229 src="zoom-in.png" | |
230 > | |
231 </a> | |
232 </div> | |
233 | |
234 <div class="button"> | |
235 <a | |
236 class="icon" | |
237 href="javascript:zoomBy(0.7)" | |
238 > | |
239 | |
240 <img | |
241 class="png" | |
242 id="zoom-out" | |
243 title="zoom out" | |
244 src="zoom-out.png" | |
245 > | |
246 </a> | |
247 </div> | |
248 | |
249 <div class="button"> | |
250 <a | |
251 class="icon" | |
401 | 252 href="javascript:zoomArea()" |
400 | 253 > |
254 | |
255 <img | |
256 class="png" | |
257 id="zoom-area" | |
258 title="zoom area" | |
259 src="zoom-area.png" | |
260 > | |
261 </a> | |
262 </div> | |
263 | |
264 <div class="button"> | |
265 <a | |
266 class="icon" | |
267 href="javascript:zoomFullpage()" | |
268 > | |
269 | |
270 <img | |
271 class="png" | |
272 id="zoom-full" | |
273 title="view the whole image" | |
274 src="zoom-full.png" | |
275 > | |
276 </a> | |
277 </div> | |
278 | |
279 <div class="button"> | |
280 <a | |
281 class="icon" | |
439 | 282 href="javascript:pageWidth()" |
283 > | |
284 | |
285 <img | |
286 class="png" | |
287 id="page-width" | |
288 title="page width" | |
289 src="pagewidth.png" | |
290 > | |
291 </a> | |
292 </div> | |
293 | |
294 <div class="button"> | |
295 <a | |
296 class="icon" | |
443 | 297 href="javascript:toggleSizeMenu()" |
440 | 298 > |
299 | |
300 <img | |
301 class="png" | |
302 id="size" | |
303 title="resize page" | |
304 src="size.png" | |
305 > | |
306 </a> | |
307 </div> | |
308 | |
309 <div class="button"> | |
310 <a | |
311 class="icon" | |
400 | 312 href="javascript:gotoPage('-1')" |
313 > | |
314 | |
315 <img | |
316 class="png" | |
317 id="back" | |
318 title="goto previous image" | |
319 src="back.png" | |
320 > | |
321 </a> | |
322 </div> | |
323 | |
324 <div class="button"> | |
325 <a | |
326 class="icon" | |
327 href="javascript:gotoPage('+1')" | |
328 > | |
329 | |
330 <img | |
331 class="png" | |
332 id="fwd" | |
333 title="goto next image" | |
334 src="fwd.png" | |
335 > | |
336 </a> | |
337 </div> | |
338 | |
339 <div class="button"> | |
340 <a | |
341 class="icon" | |
434 | 342 href="javascript:gotoPageWin()" |
343 > | |
344 | |
345 <img | |
346 class="png" | |
347 id="page" | |
348 title="specify image" | |
349 src="page.png" | |
350 > | |
351 </a> | |
352 </div> | |
353 | |
354 <div class="button"> | |
355 <a | |
356 class="icon" | |
440 | 357 href="javascript:toggleBirdDiv()" |
415 | 358 > |
359 | |
360 <img | |
361 class="png" | |
440 | 362 id="bird" |
363 title="show bird's eye view" | |
364 src="birds-eye.png" | |
415 | 365 > |
440 | 366 </a> |
415 | 367 </div> |
439 | 368 |
440 | 369 <div class="separator"> |
370 </div> | |
371 | |
415 | 372 <div class="button"> |
373 <a | |
374 class="icon" | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
375 href="javascript:toggleAboutDiv()" |
400 | 376 > |
377 | |
378 <img | |
379 class="png" | |
380 id="help" | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
381 title="about Digilib" |
400 | 382 src="help.png" |
383 > | |
384 </a> | |
385 </div> | |
386 | |
387 <div class="button"> | |
388 <a | |
389 class="icon" | |
390 href="javascript:toggleOptionDiv()" | |
391 > | |
392 | |
393 <img | |
394 class="png" | |
395 id="options" | |
396 title="more options" | |
397 src="options.png" | |
398 > | |
399 </a> | |
400 </div> | |
401 | |
440 | 402 <div class="separator"> |
403 </div> | |
400 | 404 </div> |
405 | |
406 <!-- options div --> | |
407 | |
408 <div id="dloptions"> | |
440 | 409 <div class="separator"> |
410 </div> | |
411 | |
400 | 412 <div class="button"> |
413 <a | |
414 class="icon" | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
415 href="javascript:setMark();" |
400 | 416 > |
417 | |
418 <img | |
419 class="png" | |
420 id="mark" | |
421 title="set a mark" | |
422 src="mark.png" | |
423 > | |
424 </a> | |
425 </div> | |
426 | |
427 <div class="button"> | |
428 <a | |
429 class="icon" | |
430 href="javascript:removeMark()" | |
431 > | |
432 | |
433 <img | |
434 class="png" | |
435 id="delmark" | |
436 title="delete the last mark" | |
437 src="delmark.png" | |
438 > | |
439 </a> | |
440 </div> | |
441 | |
442 <div class="button"> | |
443 <a | |
444 class="icon" | |
445 href="javascript:mirror('h')" | |
446 > | |
447 | |
448 <img | |
449 class="png" | |
415 | 450 id="hmir" |
400 | 451 title="mirror horizontally" |
452 src="mirror-horizontal.png" | |
453 > | |
454 </a> | |
455 </div> | |
456 | |
457 <div class="button"> | |
458 <a | |
459 class="icon" | |
460 href="javascript:mirror('v')" | |
461 > | |
462 | |
463 <img | |
464 class="png" | |
415 | 465 id="vmir" |
400 | 466 title="mirror vertically" |
467 src="mirror-vertical.png" | |
468 > | |
469 </a> | |
470 </div> | |
471 | |
472 <div class="button"> | |
473 <a | |
474 class="icon" | |
475 href="javascript:setParamWin('rot', 'Rotate (0..360) clockwise')" | |
476 > | |
477 | |
478 <img | |
479 class="png" | |
415 | 480 id="rot" |
400 | 481 title="rotate image" |
482 src="rotate.png" | |
483 > | |
484 </a> | |
485 </div> | |
486 | |
487 <div class="button"> | |
488 <a | |
489 class="icon" | |
490 href="javascript:setParamWin('brgt', 'Brightness (-255..255)')" | |
491 > | |
492 | |
493 <img | |
494 class="png" | |
415 | 495 id="brgt" |
400 | 496 title="set brightness" |
497 src="brightness.png" | |
498 > | |
499 </a> | |
500 </div> | |
501 | |
502 <div class="button"> | |
503 <a | |
504 class="icon" | |
505 href="javascript:setParamWin('cont', 'Contrast (0..8)')" | |
506 > | |
507 | |
508 <img | |
509 class="png" | |
415 | 510 id="cont" |
400 | 511 title="set contrast" |
512 src="contrast.png" | |
513 > | |
514 </a> | |
515 </div> | |
516 | |
517 <div class="button"> | |
518 <a | |
519 class="icon" | |
520 href="javascript:setParamWin('rgb', '...')" | |
521 > | |
522 | |
523 <img | |
524 class="png" | |
525 id="rgb" | |
526 title="set rgb values" | |
527 src="rgb.png" | |
528 > | |
529 </a> | |
530 </div> | |
531 | |
532 <div class="button"> | |
533 <a | |
534 class="icon" | |
535 href="javascript:setQualityWin('Quality (0..2)')" | |
536 > | |
537 | |
538 <img | |
539 class="png" | |
540 id="quality" | |
541 title="set image quality" | |
542 src="quality.png" | |
543 > | |
544 </a> | |
545 </div> | |
546 | |
547 <div class="button"> | |
548 <a | |
549 class="icon" | |
434 | 550 href="javascript:calibrate('x')" |
400 | 551 > |
552 | |
553 <img | |
554 class="png" | |
434 | 555 id="calibration-x" |
556 title="calibrate screen x-ratio" | |
557 src="calibration-x.png" | |
400 | 558 > |
434 | 559 </a> |
400 | 560 </div> |
434 | 561 |
562 <div class="button"> | |
563 <a | |
564 class="icon" | |
565 href="javascript:calibrate('y')" | |
566 > | |
567 | |
568 <img | |
569 class="png" | |
570 id="calibration-y" | |
571 title="calibrate screen y-ratio" | |
572 src="calibration-y.png" | |
573 > | |
574 </a> | |
575 </div> | |
576 | |
400 | 577 <div class="button"> |
578 <a | |
579 class="icon" | |
580 href="javascript:pixelByPixel()" | |
581 > | |
582 | |
583 <img | |
584 class="png" | |
585 id="pixel-by-pixel" | |
586 title="view image pixel by pixel" | |
587 src="pixel-by-pixel.png" | |
588 > | |
589 </a> | |
590 </div> | |
591 | |
592 <div class="button"> | |
593 <a | |
594 class="icon" | |
595 href="javascript:originalSize()" | |
596 > | |
597 | |
598 <img | |
599 class="png" | |
600 id="original-size" | |
601 title="view image in original size" | |
602 src="original-size.png" | |
603 > | |
604 </a> | |
605 </div> | |
606 | |
440 | 607 <div class="separator"> |
608 </div> | |
609 | |
400 | 610 <div class="button"> |
611 <a | |
612 class="icon" | |
613 href="javascript:toggleOptionDiv()" | |
614 > | |
615 | |
616 <img | |
617 class="png" | |
618 id="options-1" | |
619 title="hide options" | |
620 src="options.png" | |
621 > | |
622 </a> | |
623 </div> | |
440 | 624 |
625 <div class="separator"> | |
626 </div> | |
627 | |
400 | 628 </div> |
629 | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
630 <div class="debug" id="debug"><p class="debug">Debug</p></div> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
631 |
400 | 632 </body> |
633 | |
634 </html> |