comparison client/digitallibrary/greyskin/diginew.jsp @ 400:be66c85821ff

simplyfications
author hertzhaft
date Thu, 08 Dec 2005 13:16:43 +0100
parents
children dbeb240fa170
comparison
equal deleted inserted replaced
399:d20d75e6f143 400:be66c85821ff
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
39 <style type="text/css">
40
41 body { background-color: #E0E0E0; color: black; font-size: 8pt }
42 code { font-family: monospace; color: blue; }
43 pre { color: #006060; }
44
45 a.icon { margin: 0px; padding: 0px; }
46
47 img.png { border: none; }
48 img.mark { border: none; }
49
50 div.button { padding: 0px; }
51 div.dot { position: absolute; left: -20; top: 100; visibility: hidden }
52 div#scaler-table { padding-right: 40px; }
53
54 div#buttons { position: absolute; right: 5px; top: 5px; background-color: #E0E0E0; }
55 div#dloptions { position: absolute; right: 5px; top: 5px; background-color: #E0E0E0; visibility: hidden; }
56 div#zoom { position: absolute; border: 2px solid #f0cccc; visibility: hidden; }
57
58 </style>
59
60 <script type="text/javascript" src="baselib.js"></script>
61
62 <script type="text/javascript" src="dllib.js"></script>
63
64 <script language="JavaScript">
65 var isOptionDivVisible = false;
66 var dlTarget = window.name;
67 var baseUrl = '<%= dlRequest.getAsString("base.url") %>';
68 var toolbarEnabledURL = window.location.href;
69
70 function resetParams() {
71 newParameter('fn', '', 1);
72 newParameter('pn', '1', 1);
73 newParameter('ws', '1.0', 1);
74 newParameter('mo', '', 1);
75 newParameter('mk', '', 3);
76 newParameter('wx', '0.0', 2);
77 newParameter('wy', '0.0', 2);
78 newParameter('ww', '1.0', 2);
79 newParameter('wh', '1.0', 2);
80 newParameter('pt', '<%= dlRequest.getAsString("pt") %>', 1);
81 newParameter('brgt', '0.0', 1);
82 newParameter('cont', '0.0', 1);
83 newParameter('rot', '0.0', 1);
84 newParameter('rgba', '', 1);
85 newParameter('rgbm', '', 1);
86 newParameter('ddpix', '', 1);
87 newParameter('ddpiy', '', 1);
88 document.id='digilib';
89 }
90
91
92 function toggleOptionDiv() {
93 isOptionDivVisible = !isOptionDivVisible;
94 showOptions(isOptionDivVisible);
95 }
96
97 function highlightPNG(id, on) {
98 var img = document.getElementById(id);
99 var a = img.parentNode
100 var div = a.parentNode;
101 var src = img.src;
102 // FIXME: IE - transparente PNGs offenbar nicht nachladbar
103
104 // if (browserType.isIE)
105 // img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "');"
106 div.style.backgroundImage = on
107 ? "url('corona.png')"
108 : "";
109 }
110
111 // initialize image; called by body.onload
112 function onBodyLoaded() {
113 var scaler = getElement('scaler');
114 var pic = getElement('pic');
115 var ps = bestPicSize(scaler, 50);
116 var src = "../servlet/Scaler?" + getQueryString() + "&dw=" + ps.width + "&dh=" + ps.height;
117 pic.src = src;
118 dl_init(); // dl_init braucht die endgültigen Maße des pic Elements
119 }
120
121 base_init(); // browser recognition
122 resetParams(); // default values
123 dl_param_init(); // parse parameter values
124
125 </script>
126 </head>
127
128 <body onload="onBodyLoaded();">
129
130 <!-- slot for the scaled image -->
131 <div id="scaler-table">
132 <div id="scaler" style="visibility:visible">
133 <img id="pic"></img>
134 </div>
135 </div>
136
137 <!-- slot for the zoom -->
138 <div id="zoom">
139 </div>
140
141 <!-- marks as dynamically created divs with numbers or text? -->
142 <div id="dot0" class="dot"><img class="mark" src="../img/mark1.gif" ></div>
143 <div id="dot1" class="dot"><img class="mark" src="../img/mark2.gif" ></div>
144 <div id="dot2" class="dot"><img class="mark" src="../img/mark3.gif" ></div>
145 <div id="dot3" class="dot"><img class="mark" src="../img/mark4.gif" ></div>
146 <div id="dot4" class="dot"><img class="mark" src="../img/mark5.gif" ></div>
147 <div id="dot5" class="dot"><img class="mark" src="../img/mark6.gif" ></div>
148 <div id="dot6" class="dot"><img class="mark" src="../img/mark7.gif" ></div>
149 <div id="dot7" class="dot"><img class="mark" src="../img/mark8.gif" ></div>
150
151 <div id="buttons">
152 <div class="button">
153 <a
154 class="icon"
155 href="javascript:getRefWin()"
156 >
157
158 <img
159 class="png"
160 id="reference"
161 onmouseover="highlightPNG('reference', 1)"
162 onmouseout="highlightPNG('reference', 0)"
163 title="get a reference URL"
164 src="reference.png"
165 >
166 </a>
167 </div>
168
169 <div class="button">
170 <a
171 class="icon"
172 href="javascript:zoomBy(1.4)"
173 >
174
175 <img
176 class="png"
177 id="zoom-in"
178 onmouseover="highlightPNG('zoom-in', 1)"
179 onmouseout="highlightPNG('zoom-in', 0)"
180 title="zoom in"
181 src="zoom-in.png"
182 >
183 </a>
184 </div>
185
186 <div class="button">
187 <a
188 class="icon"
189 href="javascript:zoomBy(0.7)"
190 >
191
192 <img
193 class="png"
194 id="zoom-out"
195 onmouseover="highlightPNG('zoom-out', 1)"
196 onmouseout="highlightPNG('zoom-out', 0)"
197 title="zoom out"
198 src="zoom-out.png"
199 >
200 </a>
201 </div>
202
203 <div class="button">
204 <a
205 class="icon"
206 href="javascript:showOptions(0);zoomArea()"
207 >
208
209 <img
210 class="png"
211 id="zoom-area"
212 onmouseover="highlightPNG('zoom-area', 1)"
213 onmouseout="highlightPNG('zoom-area', 0)"
214 title="zoom area"
215 src="zoom-area.png"
216 >
217 </a>
218 </div>
219
220 <div class="button">
221 <a
222 class="icon"
223 href="javascript:zoomFullpage()"
224 >
225
226 <img
227 class="png"
228 id="zoom-full"
229 onmouseover="highlightPNG('zoom-full', 1)"
230 onmouseout="highlightPNG('zoom-full', 0)"
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 onmouseover="highlightPNG('back', 1)"
247 onmouseout="highlightPNG('back', 0)"
248 title="goto previous image"
249 src="back.png"
250 >
251 </a>
252 </div>
253
254 <div class="button">
255 <a
256 class="icon"
257 href="javascript:gotoPage('+1')"
258 >
259
260 <img
261 class="png"
262 id="fwd"
263 onmouseover="highlightPNG('fwd', 1)"
264 onmouseout="highlightPNG('fwd', 0)"
265 title="goto next image"
266 src="fwd.png"
267 >
268 </a>
269 </div>
270
271 <div class="button">
272 <a
273 class="icon"
274 href="javascript:help()"
275 >
276
277 <img
278 class="png"
279 id="help"
280 onmouseover="highlightPNG('help', 1)"
281 onmouseout="highlightPNG('help', 0)"
282 title="help"
283 src="help.png"
284 >
285 </a>
286 </div>
287
288 <div class="button">
289 <a
290 class="icon"
291 href="javascript:toggleOptionDiv()"
292 >
293
294 <img
295 class="png"
296 id="options"
297 onmouseover="highlightPNG('options', 1)"
298 onmouseout="highlightPNG('options', 0)"
299 title="more options"
300 src="options.png"
301 >
302 </a>
303 </div>
304
305 </div>
306
307 <!-- options div -->
308
309 <div id="dloptions">
310 <div class="button">
311 <a
312 class="icon"
313 href="javascript:showOptions(0);setMark()"
314 >
315
316 <img
317 class="png"
318 id="mark"
319 onmouseover="highlightPNG('mark', 1)"
320 onmouseout="highlightPNG('mark', 0)"
321 title="set a mark"
322 src="mark.png"
323 >
324 </a>
325 </div>
326
327 <div class="button">
328 <a
329 class="icon"
330 href="javascript:removeMark()"
331 >
332
333 <img
334 class="png"
335 id="delmark"
336 onmouseover="highlightPNG('delmark', 1)"
337 onmouseout="highlightPNG('delmark', 0)"
338 title="delete the last mark"
339 src="delmark.png"
340 >
341 </a>
342 </div>
343
344 <div class="button">
345 <a
346 class="icon"
347 href="javascript:mirror('h')"
348 >
349
350 <img
351 class="png"
352 id="mirror-h"
353 onmouseover="highlightPNG('mirror-h', 1)"
354 onmouseout="highlightPNG('mirror-h', 0)"
355 title="mirror horizontally"
356 src="mirror-horizontal.png"
357 >
358 </a>
359 </div>
360
361 <div class="button">
362 <a
363 class="icon"
364 href="javascript:mirror('v')"
365 >
366
367 <img
368 class="png"
369 id="mirror-v"
370 onmouseover="highlightPNG('mirror-v', 1)"
371 onmouseout="highlightPNG('mirror-v', 0)"
372 title="mirror vertically"
373 src="mirror-vertical.png"
374 >
375 </a>
376 </div>
377
378 <div class="button">
379 <a
380 class="icon"
381 href="javascript:setParamWin('rot', 'Rotate (0..360) clockwise')"
382 >
383
384 <img
385 class="png"
386 id="rotate"
387 onmouseover="highlightPNG('rotate', 1)"
388 onmouseout="highlightPNG('rotate', 0)"
389 title="rotate image"
390 src="rotate.png"
391 >
392 </a>
393 </div>
394
395 <div class="button">
396 <a
397 class="icon"
398 href="javascript:setParamWin('brgt', 'Brightness (-255..255)')"
399 >
400
401 <img
402 class="png"
403 id="brightness"
404 onmouseover="highlightPNG('brightness', 1)"
405 onmouseout="highlightPNG('brightness', 0)"
406 title="set brightness"
407 src="brightness.png"
408 >
409 </a>
410 </div>
411
412 <div class="button">
413 <a
414 class="icon"
415 href="javascript:setParamWin('cont', 'Contrast (0..8)')"
416 >
417
418 <img
419 class="png"
420 id="contrast"
421 onmouseover="highlightPNG('contrast', 1)"
422 onmouseout="highlightPNG('contrast', 0)"
423 title="set contrast"
424 src="contrast.png"
425 >
426 </a>
427 </div>
428
429 <div class="button">
430 <a
431 class="icon"
432 href="javascript:setParamWin('rgb', '...')"
433 >
434
435 <img
436 class="png"
437 id="rgb"
438 onmouseover="highlightPNG('rgb', 1)"
439 onmouseout="highlightPNG('rgb', 0)"
440 title="set rgb values"
441 src="rgb.png"
442 >
443 </a>
444 </div>
445
446 <div class="button">
447 <a
448 class="icon"
449 href="javascript:setParamWin('size', '...')"
450 >
451
452 <img
453 class="png"
454 id="size"
455 onmouseover="highlightPNG('size', 1)"
456 onmouseout="highlightPNG('size', 0)"
457 title="resize page"
458 src="size.png"
459 >
460 </a>
461 </div>
462
463 <div class="button">
464 <a
465 class="icon"
466 href="javascript:setQualityWin('Quality (0..2)')"
467 >
468
469 <img
470 class="png"
471 id="quality"
472 onmouseover="highlightPNG('quality', 1)"
473 onmouseout="highlightPNG('quality', 0)"
474 title="set image quality"
475 src="quality.png"
476 >
477 </a>
478 </div>
479
480 <div class="button">
481 <a
482 class="icon"
483 href="javascript:gotoPageWin()"
484 >
485
486 <img
487 class="png"
488 id="page"
489 onmouseover="highlightPNG('page', 1)"
490 onmouseout="highlightPNG('page', 0)"
491 title="specify image"
492 src="page.png"
493 >
494 </a>
495 </div>
496
497 <div class="button">
498 <a
499 class="icon"
500 href="javascript:pixelByPixel()"
501 >
502
503 <img
504 class="png"
505 id="pixel-by-pixel"
506 onmouseover="highlightPNG('pixel-by-pixel', 1)"
507 onmouseout="highlightPNG('pixel-by-pixel', 0)"
508 title="view image pixel by pixel"
509 src="pixel-by-pixel.png"
510 >
511 </a>
512 </div>
513
514 <div class="button">
515 <a
516 class="icon"
517 href="javascript:originalSize()"
518 >
519
520 <img
521 class="png"
522 id="original-size"
523 onmouseover="highlightPNG('original-size', 1)"
524 onmouseout="highlightPNG('original-size', 0)"
525 title="view image in original size"
526 src="original-size.png"
527 >
528 </a>
529 </div>
530
531 <div class="button">
532 <a
533 class="icon"
534 href="javascript:toggleOptionDiv()"
535 >
536
537 <img
538 class="png"
539 id="options-1"
540 onmouseover="highlightPNG('options-1', 1)"
541 onmouseout="highlightPNG('options-1', 0)"
542 title="hide options"
543 src="options.png"
544 >
545 </a>
546 </div>
547 </div>
548
549 </body>
550
551 </html>