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