Mercurial > hg > digilib-old
annotate client/digitallibrary/greyskin/diginew.jsp @ 455:9c16290e6f44
ongoing experimental intermediary release
- calibration and scale modes are working
author | robcast |
---|---|
date | Mon, 30 Jan 2006 16:02:04 +0100 |
parents | a6c83fa262b2 |
children | f0fb0d781548 |
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; |
455 | 53 var isScaleMenuVisible = false; |
443 | 54 var isOriginalSize = false; |
55 var isPixelByPixel = false; | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
56 var dlTarget = window.name; |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
57 var baseUrl = '<%= dlRequest.getAsString("base.url") %>'; |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
58 var toolbarEnabledURL = window.location.href; |
445 | 59 var waited = 0; |
400 | 60 |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
61 function toggleOptionDiv() { |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
62 isOptionDivVisible = !isOptionDivVisible; |
434 | 63 cookie.addbool("isOptionDivVisible", isOptionDivVisible); |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
64 showOptions(isOptionDivVisible); |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
65 } |
400 | 66 |
434 | 67 function toggleBirdDiv() { |
68 isBirdDivVisible = !isBirdDivVisible; | |
69 cookie.addbool("isBirdDivVisible", isBirdDivVisible); | |
70 showBirdDiv(isBirdDivVisible); | |
71 } | |
72 | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
73 function toggleAboutDiv() { |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
74 isAboutDivVisible = !isAboutDivVisible; |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
75 showAboutDiv(isAboutDivVisible); |
400 | 76 } |
77 | |
443 | 78 function toggleSizeMenu() { |
79 isSizeMenuVisible = !isSizeMenuVisible; | |
455 | 80 showMenu("size-menu", "size", isSizeMenuVisible); |
443 | 81 } |
82 | |
455 | 83 function toggleScaleMenu() { |
84 isScaleMenuVisible = !isScaleMenuVisible; | |
85 showMenu("scale-menu", "scale", isScaleMenuVisible); | |
86 } | |
443 | 87 |
88 function setOnImage(id, src, value) { | |
415 | 89 // replace img src and display "on" status |
90 var elem = getElement(id); | |
91 elem.src = src; | |
443 | 92 if (value) |
93 elem.title += ": " + value; | |
94 else | |
95 elem.title += ": on"; | |
415 | 96 } |
97 | |
98 // change icons if image functions are on | |
99 function reflectImageStatus() { | |
100 if (hasFlag("hmir")) setOnImage("hmir", "mirror-horizontal-on.png"); | |
101 if (hasFlag("vmir")) setOnImage("vmir", "mirror-vertical-on.png"); | |
451 | 102 if (hasParameter("brgt")) |
103 setOnImage("brgt", "brightness-on.png", getParameter("brgt")); | |
104 if (hasParameter("cont")) | |
105 setOnImage("cont", "contrast-on.png", getParameter("cont")); | |
106 if (hasParameter("rot")) | |
107 setOnImage("rot", "rotate-on.png", getParameter("rot")); | |
108 if (hasParameter("rgb")) | |
109 setOnImage("rgb", "rgb-on.png", getParameter("rgb")); | |
415 | 110 } |
450 | 111 |
445 | 112 |
113 // initialize digilib; called by body.onload | |
434 | 114 function onBodyLoad() { |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
115 document.id = 'digilib'; |
451 | 116 dl.onLoad(); |
117 dl.showOptions(isOptionDivVisible); | |
118 reflectImageStatus(); // adjust icons | |
119 } | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
120 |
434 | 121 function onBodyUnload() { |
122 // alert(strObject(cookie)); | |
123 cookie.store(); | |
124 } | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
125 |
400 | 126 </script> |
127 </head> | |
128 | |
434 | 129 <body onload="onBodyLoad();" onunload="onBodyUnload();"> |
400 | 130 <!-- slot for the scaled image --> |
434 | 131 <div id="scaler"> |
132 <img id="pic"></img> | |
400 | 133 </div> |
134 | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
135 <!-- sensitive overlay for zoom area etc --> |
455 | 136 <div id="overlay"></div> |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
137 |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
138 <!-- the zoom area selection rectangle --> |
455 | 139 <div id="zoom"></div> |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
140 |
415 | 141 <!-- the bird's eye overview image --> |
142 <img id="bird-image"></img> | |
143 | |
144 <!-- the bird's eye select area --> | |
455 | 145 <div id="bird-area"></div> |
434 | 146 |
415 | 147 <!-- the arrows --> |
148 <a class="arrow" id="up" href="javascript:moveBy(0, -0.5)"></a> | |
149 <a class="arrow" id="down" href="javascript:moveBy(0, 0.5)"></a> | |
150 <a class="arrow" id="left" href="javascript:moveBy(-0.5, 0)"></a> | |
151 <a class="arrow" id="right" href="javascript:moveBy(0.5, 0)"></a> | |
152 | |
153 <!-- the about window --> | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
154 <div id="about" class="about" onclick="toggleAboutDiv()"> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
155 <p>Digilib Graphic Viewer</p> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
156 <a href="http://digilib.berlios.de" target="_blank" > |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
157 <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
|
158 </a> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
159 <p id="digilib-version"></p> |
434 | 160 <p id="jsp-version"></p> |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
161 <p id="baselib-version"></p> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
162 <p id="dllib-version"></p> |
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
163 </div> |
400 | 164 |
434 | 165 <!-- the calibration div --> |
439 | 166 <div id="calibration"> |
167 <div> | |
455 | 168 <p class="cm">measure the length of this scale on your screen</p> |
439 | 169 </div> |
170 </div> | |
400 | 171 |
440 | 172 <!-- the size menu --> |
455 | 173 <div id="size-menu" class="popup-menu"> |
174 <p><a href="javascript:setSize(1)">1 x</a></p> | |
175 <p><a href="javascript:setSize(1.41)">1.41 x</a></p> | |
176 <p><a href="javascript:setSize(2)">2 x</a></p> | |
177 <p><a href="javascript:setSize(3)">3 x</a></p> | |
445 | 178 <div id="sizes-bar"> |
179 <div id="sizes-slider"></div> | |
180 </div> | |
181 <p id="sizes-value"></p> | |
440 | 182 </div> |
183 | |
455 | 184 <!-- the scale menu --> |
185 <div id="scale-menu" class="popup-menu"> | |
186 <p><a href="javascript:setScale('fit')">fit to screen</a></p> | |
187 <p><a href="javascript:setScale('pixel')">pixel by pixel</a></p> | |
188 <p><a href="javascript:setScale('original')">original size</a></p> | |
189 </div> | |
190 | |
439 | 191 <!-- the buttons --> |
400 | 192 <div id="buttons"> |
440 | 193 <div class="separator"> |
194 </div> | |
195 | |
400 | 196 <div class="button"> |
197 <a | |
198 class="icon" | |
440 | 199 href="javascript:getRefWin()" |
400 | 200 > |
201 | |
202 <img | |
203 class="png" | |
440 | 204 id="reference" |
205 title="get a reference URL" | |
206 src="reference.png" | |
400 | 207 > |
440 | 208 </a> |
400 | 209 </div> |
440 | 210 |
400 | 211 <div class="button"> |
212 <a | |
213 class="icon" | |
451 | 214 href="javascript:dl.zoomBy(1.4)" |
400 | 215 > |
216 | |
217 <img | |
218 class="png" | |
219 id="zoom-in" | |
220 title="zoom in" | |
221 src="zoom-in.png" | |
222 > | |
223 </a> | |
224 </div> | |
225 | |
226 <div class="button"> | |
227 <a | |
228 class="icon" | |
229 href="javascript:zoomBy(0.7)" | |
230 > | |
231 | |
232 <img | |
233 class="png" | |
234 id="zoom-out" | |
235 title="zoom out" | |
236 src="zoom-out.png" | |
237 > | |
238 </a> | |
239 </div> | |
240 | |
241 <div class="button"> | |
242 <a | |
243 class="icon" | |
401 | 244 href="javascript:zoomArea()" |
400 | 245 > |
246 | |
247 <img | |
248 class="png" | |
249 id="zoom-area" | |
250 title="zoom area" | |
251 src="zoom-area.png" | |
252 > | |
253 </a> | |
254 </div> | |
255 | |
256 <div class="button"> | |
257 <a | |
258 class="icon" | |
259 href="javascript:zoomFullpage()" | |
260 > | |
261 | |
262 <img | |
263 class="png" | |
264 id="zoom-full" | |
265 title="view the whole image" | |
266 src="zoom-full.png" | |
267 > | |
268 </a> | |
269 </div> | |
270 | |
271 <div class="button"> | |
272 <a | |
273 class="icon" | |
455 | 274 href="javascript:zoomFullpage('width')" |
439 | 275 > |
276 | |
277 <img | |
278 class="png" | |
279 id="page-width" | |
280 title="page width" | |
281 src="pagewidth.png" | |
282 > | |
283 </a> | |
284 </div> | |
285 | |
286 <div class="button"> | |
287 <a | |
288 class="icon" | |
400 | 289 href="javascript:gotoPage('-1')" |
290 > | |
291 | |
292 <img | |
293 class="png" | |
294 id="back" | |
295 title="goto previous image" | |
296 src="back.png" | |
297 > | |
298 </a> | |
299 </div> | |
300 | |
301 <div class="button"> | |
302 <a | |
303 class="icon" | |
304 href="javascript:gotoPage('+1')" | |
305 > | |
306 | |
307 <img | |
308 class="png" | |
309 id="fwd" | |
310 title="goto next image" | |
311 src="fwd.png" | |
312 > | |
313 </a> | |
314 </div> | |
315 | |
316 <div class="button"> | |
317 <a | |
318 class="icon" | |
434 | 319 href="javascript:gotoPageWin()" |
320 > | |
321 | |
322 <img | |
323 class="png" | |
324 id="page" | |
325 title="specify image" | |
326 src="page.png" | |
327 > | |
328 </a> | |
329 </div> | |
330 | |
331 <div class="button"> | |
332 <a | |
333 class="icon" | |
440 | 334 href="javascript:toggleBirdDiv()" |
415 | 335 > |
336 | |
337 <img | |
338 class="png" | |
440 | 339 id="bird" |
340 title="show bird's eye view" | |
341 src="birds-eye.png" | |
415 | 342 > |
440 | 343 </a> |
415 | 344 </div> |
439 | 345 |
440 | 346 <div class="separator"> |
347 </div> | |
348 | |
415 | 349 <div class="button"> |
350 <a | |
351 class="icon" | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
352 href="javascript:toggleAboutDiv()" |
400 | 353 > |
354 | |
355 <img | |
356 class="png" | |
357 id="help" | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
358 title="about Digilib" |
400 | 359 src="help.png" |
360 > | |
361 </a> | |
362 </div> | |
363 | |
364 <div class="button"> | |
365 <a | |
366 class="icon" | |
367 href="javascript:toggleOptionDiv()" | |
368 > | |
369 | |
370 <img | |
371 class="png" | |
372 id="options" | |
373 title="more options" | |
374 src="options.png" | |
375 > | |
376 </a> | |
377 </div> | |
378 | |
440 | 379 <div class="separator"> |
380 </div> | |
400 | 381 </div> |
382 | |
383 <!-- options div --> | |
384 | |
385 <div id="dloptions"> | |
440 | 386 <div class="separator"> |
387 </div> | |
388 | |
400 | 389 <div class="button"> |
390 <a | |
391 class="icon" | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
392 href="javascript:setMark();" |
400 | 393 > |
394 | |
395 <img | |
396 class="png" | |
397 id="mark" | |
398 title="set a mark" | |
399 src="mark.png" | |
400 > | |
401 </a> | |
402 </div> | |
403 | |
404 <div class="button"> | |
405 <a | |
406 class="icon" | |
407 href="javascript:removeMark()" | |
408 > | |
409 | |
410 <img | |
411 class="png" | |
412 id="delmark" | |
413 title="delete the last mark" | |
414 src="delmark.png" | |
415 > | |
416 </a> | |
417 </div> | |
418 | |
419 <div class="button"> | |
420 <a | |
421 class="icon" | |
422 href="javascript:mirror('h')" | |
423 > | |
424 | |
425 <img | |
426 class="png" | |
415 | 427 id="hmir" |
400 | 428 title="mirror horizontally" |
429 src="mirror-horizontal.png" | |
430 > | |
431 </a> | |
432 </div> | |
433 | |
434 <div class="button"> | |
435 <a | |
436 class="icon" | |
437 href="javascript:mirror('v')" | |
438 > | |
439 | |
440 <img | |
441 class="png" | |
415 | 442 id="vmir" |
400 | 443 title="mirror vertically" |
444 src="mirror-vertical.png" | |
445 > | |
446 </a> | |
447 </div> | |
448 | |
449 <div class="button"> | |
450 <a | |
451 class="icon" | |
452 href="javascript:setParamWin('rot', 'Rotate (0..360) clockwise')" | |
453 > | |
454 | |
455 <img | |
456 class="png" | |
415 | 457 id="rot" |
400 | 458 title="rotate image" |
459 src="rotate.png" | |
460 > | |
461 </a> | |
462 </div> | |
463 | |
464 <div class="button"> | |
465 <a | |
466 class="icon" | |
467 href="javascript:setParamWin('brgt', 'Brightness (-255..255)')" | |
468 > | |
469 | |
470 <img | |
471 class="png" | |
415 | 472 id="brgt" |
400 | 473 title="set brightness" |
474 src="brightness.png" | |
475 > | |
476 </a> | |
477 </div> | |
478 | |
479 <div class="button"> | |
480 <a | |
481 class="icon" | |
482 href="javascript:setParamWin('cont', 'Contrast (0..8)')" | |
483 > | |
484 | |
485 <img | |
486 class="png" | |
415 | 487 id="cont" |
400 | 488 title="set contrast" |
489 src="contrast.png" | |
490 > | |
491 </a> | |
492 </div> | |
493 | |
494 <div class="button"> | |
495 <a | |
496 class="icon" | |
497 href="javascript:setParamWin('rgb', '...')" | |
498 > | |
499 | |
500 <img | |
501 class="png" | |
502 id="rgb" | |
503 title="set rgb values" | |
504 src="rgb.png" | |
505 > | |
506 </a> | |
507 </div> | |
508 | |
509 <div class="button"> | |
510 <a | |
511 class="icon" | |
512 href="javascript:setQualityWin('Quality (0..2)')" | |
513 > | |
514 | |
515 <img | |
516 class="png" | |
517 id="quality" | |
518 title="set image quality" | |
519 src="quality.png" | |
520 > | |
521 </a> | |
522 </div> | |
523 | |
455 | 524 <div class="button"> |
525 <a | |
526 class="icon" | |
527 href="javascript:toggleSizeMenu()" | |
528 > | |
529 | |
530 <img | |
531 class="png" | |
532 id="size" | |
533 title="set page size" | |
534 src="size.png" | |
535 > | |
536 </a> | |
537 </div> | |
538 | |
400 | 539 <div class="button"> |
540 <a | |
541 class="icon" | |
434 | 542 href="javascript:calibrate('x')" |
400 | 543 > |
544 | |
545 <img | |
546 class="png" | |
434 | 547 id="calibration-x" |
548 title="calibrate screen x-ratio" | |
549 src="calibration-x.png" | |
400 | 550 > |
434 | 551 </a> |
400 | 552 </div> |
455 | 553 |
434 | 554 <div class="button"> |
555 <a | |
556 class="icon" | |
455 | 557 href="javascript:toggleScaleMenu()" |
434 | 558 > |
559 | |
560 <img | |
561 class="png" | |
455 | 562 id="scale" |
563 title="change image scale" | |
400 | 564 src="original-size.png" |
565 > | |
566 </a> | |
567 </div> | |
568 | |
440 | 569 <div class="separator"> |
570 </div> | |
571 | |
400 | 572 <div class="button"> |
573 <a | |
574 class="icon" | |
575 href="javascript:toggleOptionDiv()" | |
576 > | |
577 | |
578 <img | |
579 class="png" | |
580 id="options-1" | |
581 title="hide options" | |
582 src="options.png" | |
583 > | |
584 </a> | |
585 </div> | |
440 | 586 |
587 <div class="separator"> | |
588 </div> | |
589 | |
400 | 590 </div> |
591 | |
410
395db075906d
removed mark divs and images, they are added programmatically now;
hertzhaft
parents:
401
diff
changeset
|
592 <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
|
593 |
400 | 594 </body> |
595 | |
596 </html> |