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