annotate client/digitallibrary/navigation_ie.js @ 31:84a481a388bb

first update of new client-version
author luginbue
date Thu, 21 Feb 2002 02:27:06 +0100
parents d407cb901df4
children 930413351738
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
1 // this global variable has to be initialised before the frist use of the functions below
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
2 // to fill in the attributes you can use the function init provided below
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
3 // - array with all attributes
d407cb901df4 Initial revision
robcast
parents:
diff changeset
4 var att = new Array();
d407cb901df4 Initial revision
robcast
parents:
diff changeset
5
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
6 // fill in the values of the "att"-array
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
7 function init(fn, pn, ws, mo, mk, wx, wy, ww, wh) {
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
8
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
9 // debug window to check the parameters passed
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
10 //alert ("DEBUG message (parameters in init):\n\npu = " + pu + "\npn = " + pn + "\nws = " + ws + "\nmo = " + mo + "\nmk = " + mk + "\nwx = " + wx + "\nwy = " + wy + "\nww = " + ww + "\nwh = " + wh);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
11
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
12 // attaching the values to the att-array
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
13 att[0] = fn;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
14 att[1] = parseInt(pn);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
15 att[2] = parseFloat(ws);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
16 att[3] = mo;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
17 att[4] = mk;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
18 att[5] = parseFloat(wx);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
19 att[6] = parseFloat(wy);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
20 att[7] = parseFloat(ww);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
21 att[8] = parseFloat(wh);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
22
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
23 // compatablility issue
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
24 if (att[3].indexOf("f") > -1) {
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
25 att[3] = "fit";
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
26 }
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
27
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
28 // converts the old mark format (0-1000) to new format(0.0 - 1.0)
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
29 // could even be useless now
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
30 if (att[4] != "0/0") {
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
31 var tmp = att[4].split(";");
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
32
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
33 att[4] = "";
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
34
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
35 for (i = 0; i < tmp.length; i++) {
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
36 tmp[i] = tmp[i].split("/");
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
37
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
38 if (tmp[i][0] > 1 && tmp[i][1] > 1) {
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
39 tmp[i][0] /= 1000;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
40 tmp[i][1] /= 1000;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
41 }
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
42
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
43 att[4] += tmp[i][0] + "/" + tmp[i][1] + ";";
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
44 }
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
45 att[4] = att[4].slice(0, -1);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
46 }
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
47
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
48 // initialisation stuff
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
49 // ====================
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
50
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
51 setMarks();
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
52
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
53 this.document.onkeypress = parseKeypress;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
54 focus();
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
55
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
56 // give a name to the window containing digilib - this way one can test if there is already a
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
57 // digilib-window open and replace the contents of it (ex. digicat)
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
58 top.window.name = "digilib";
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
59 }
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
60
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
61
d407cb901df4 Initial revision
robcast
parents:
diff changeset
62 // function that launches the ScaleServlet
d407cb901df4 Initial revision
robcast
parents:
diff changeset
63 // the different detailGrades:
d407cb901df4 Initial revision
robcast
parents:
diff changeset
64 // 0 -> back, next, page
d407cb901df4 Initial revision
robcast
parents:
diff changeset
65 // 1 -> zoomout
d407cb901df4 Initial revision
robcast
parents:
diff changeset
66 // 2 -> zoomarea, zoompoint, moveto, scaledef
d407cb901df4 Initial revision
robcast
parents:
diff changeset
67
d407cb901df4 Initial revision
robcast
parents:
diff changeset
68 function loadPicture(detailGrade, keepArea) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
69
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
70 var newURL = "dlImage.jsp?"
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
71 newURL += "fn=" + att[0] + "&pn=" + att[1] + "&ws=" + att[2] + "&mo=" + att[3];
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
72
d407cb901df4 Initial revision
robcast
parents:
diff changeset
73 if (detailGrade == 0) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
74 att[4] = "0/0";
d407cb901df4 Initial revision
robcast
parents:
diff changeset
75 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
76
d407cb901df4 Initial revision
robcast
parents:
diff changeset
77 if ((detailGrade == 1) || (detailGrade == 0 && !keepArea)) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
78 att[5] = 0;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
79 att[6] = 0;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
80 att[7] = 1;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
81 att[8] = 1;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
82 }
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
83
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
84 newURL += "&mk=" + att[4] + "&wx=" + att[5] + "&wy=" + att[6] + "&ww=" + att[7] + "&wh=" + att[8];
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
85 newURL += "&dw=" + (document.body.clientWidth-30) + "&dh=" + (document.body.clientHeight-30);
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
86
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
87 // debug window - checking the parameters passed to the next image
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
88 //alert ("DEBUG MESSAGE (complete URL in loadPicture):\n\n" + newURL);
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
89
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
90 location.href = newURL;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
91 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
92
d407cb901df4 Initial revision
robcast
parents:
diff changeset
93
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
94 function backPage(keepArea) {
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
95
d407cb901df4 Initial revision
robcast
parents:
diff changeset
96 att[1] = parseInt(att[1]) - 1;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
97
d407cb901df4 Initial revision
robcast
parents:
diff changeset
98 if (att[1] > 0) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
99 loadPicture(0, keepArea);
d407cb901df4 Initial revision
robcast
parents:
diff changeset
100 } else {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
101 att[1] = parseInt(att[1]) + 1;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
102 alert("You are already on the first page!");
d407cb901df4 Initial revision
robcast
parents:
diff changeset
103 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
104 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
105
d407cb901df4 Initial revision
robcast
parents:
diff changeset
106
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
107 function nextPage(keepArea) {
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
108
d407cb901df4 Initial revision
robcast
parents:
diff changeset
109 att[1] = parseInt(att[1]) + 1;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
110
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
111 loadPicture(0, keepArea);
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
112 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
113
d407cb901df4 Initial revision
robcast
parents:
diff changeset
114
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
115 function page(keepArea) {
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
116
d407cb901df4 Initial revision
robcast
parents:
diff changeset
117 do {
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
118 page = prompt("Goto Page:", 1);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
119 } while ((page != null) && (page < 1));
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
120
d407cb901df4 Initial revision
robcast
parents:
diff changeset
121 if (page != null && page != att[1]) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
122 att[1] = page;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
123 loadPicture(0, keepArea);
d407cb901df4 Initial revision
robcast
parents:
diff changeset
124 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
125 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
126
d407cb901df4 Initial revision
robcast
parents:
diff changeset
127
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
128 function digicat() {
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
129 var url = "http://" + location.host + "/docuserver/digitallibrary/digicat.html?" + att[0] + "+" + att[1];
d407cb901df4 Initial revision
robcast
parents:
diff changeset
130 win = window.open(url, "digicat");
d407cb901df4 Initial revision
robcast
parents:
diff changeset
131 win.focus();
d407cb901df4 Initial revision
robcast
parents:
diff changeset
132 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
133
d407cb901df4 Initial revision
robcast
parents:
diff changeset
134
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
135 function ref(refselect) {
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
136
d407cb901df4 Initial revision
robcast
parents:
diff changeset
137 var hyperlinkRef = "http://" + location.host + "/docuserver/digitallibrary/digilib.jsp?";
d407cb901df4 Initial revision
robcast
parents:
diff changeset
138 hyperlinkRef += att[0] + "+" + att[1] + "+" + att[2] + "+" + att[3] + "+" + att[4];
d407cb901df4 Initial revision
robcast
parents:
diff changeset
139
d407cb901df4 Initial revision
robcast
parents:
diff changeset
140 if ((att[5] != 0) || (att[6] != 0) || (att[7] != 1) || (att[8] != 1)) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
141 hyperlinkRef += "+" + att[5] + "+" + att[6] + "+" + att[7] + "+" + att[8];
d407cb901df4 Initial revision
robcast
parents:
diff changeset
142 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
143
d407cb901df4 Initial revision
robcast
parents:
diff changeset
144 if (refselect == 1) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
145 prompt("Link for HTML--documents", hyperlinkRef);
d407cb901df4 Initial revision
robcast
parents:
diff changeset
146 } else {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
147 prompt("Link for LaTeX--documents", "\\href{" + hyperlinkRef + "}{TEXT}");
d407cb901df4 Initial revision
robcast
parents:
diff changeset
148 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
149 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
150
d407cb901df4 Initial revision
robcast
parents:
diff changeset
151
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
152 function mark(refselect) {
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
153
d407cb901df4 Initial revision
robcast
parents:
diff changeset
154 if (att[4].split(";").length > 7) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
155 alert("Only 8 marks are possible at the moment!");
d407cb901df4 Initial revision
robcast
parents:
diff changeset
156 return;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
157 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
158
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
159 document.all.lay1.onmousedown = function() {
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
160 e = event;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
161
d407cb901df4 Initial revision
robcast
parents:
diff changeset
162 if ((att[4] != "") && (att[4] != "0/0")) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
163 att[4] += ";";
d407cb901df4 Initial revision
robcast
parents:
diff changeset
164 } else {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
165 att[4] = "";
d407cb901df4 Initial revision
robcast
parents:
diff changeset
166 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
167
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
168 markX = cropFloat(att[5]+att[7]*(document.body.scrollLeft+e.x-parseInt(document.all.lay1.style.left))/document.all.lay1.offsetWidth);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
169 markY = cropFloat(att[6]+att[8]*(document.body.scrollTop+e.y-parseInt(document.all.lay1.style.top))/document.all.lay1.offsetHeight);
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
170
d407cb901df4 Initial revision
robcast
parents:
diff changeset
171 att[4] += markX + "/" + markY;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
172
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
173 document.all.lay1.cancleBubble = true;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
174
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
175 setMarks();
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
176 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
177 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
178
d407cb901df4 Initial revision
robcast
parents:
diff changeset
179
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
180 function zoomArea() {
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
181 var state = 0;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
182 var x1, y1, x2, y2;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
183
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
184 function click() {
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
185 e = event;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
186
d407cb901df4 Initial revision
robcast
parents:
diff changeset
187 if (state == 0) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
188 state = 1;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
189
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
190 x1 = document.body.scrollLeft+e.x;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
191 y1 = document.body.scrollTop+e.y;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
192 x2 = x1;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
193 y2 = y1;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
194
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
195 document.all.eck1.style.left = x1;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
196 document.all.eck1.style.top = y1;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
197 document.all.eck2.style.left = x2-12;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
198 document.all.eck2.style.top = y1;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
199 document.all.eck3.style.left = x1;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
200 document.all.eck3.style.top = y2-12;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
201 document.all.eck4.style.left = x2-12;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
202 document.all.eck4.style.top = y2-12;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
203
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
204 document.all.eck1.style.visibility="visible";
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
205 document.all.eck2.style.visibility="visible";
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
206 document.all.eck3.style.visibility="visible";
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
207 document.all.eck4.style.visibility="visible";
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
208
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
209 document.all.lay1.onmousemove = move;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
210 document.all.eck4.onmousemove = move;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
211
d407cb901df4 Initial revision
robcast
parents:
diff changeset
212 } else {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
213
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
214 x1 -= parseInt(document.all.lay1.style.left);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
215 y1 -= parseInt(document.all.lay1.style.top);
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
216
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
217 x2 = document.body.scrollLeft+e.x-parseInt(document.all.lay1.style.left);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
218 y2 = document.body.scrollTop+e.y-parseInt(document.all.lay1.style.left);
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
219
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
220 document.all.eck1.visibility="hidden";
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
221 document.all.eck2.visibility="hidden";
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
222 document.all.eck3.visibility="hidden";
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
223 document.all.eck4.visibility="hidden";
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
224
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
225 document.all.lay1.cancleBubble = true;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
226 document.all.eck4.cancleBubble = true;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
227
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
228 att[5] = cropFloat(att[5]+att[7]*((x1 < x2) ? x1 : x2)/document.all.lay1.offsetWidth);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
229 att[6] = cropFloat(att[6]+att[8]*((y1 < y2) ? y1 : y2)/document.all.lay1.offsetHeight);
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
230
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
231 att[7] = cropFloat(att[7]*Math.abs(x1-x2)/document.all.lay1.offsetWidth);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
232 att[8] = cropFloat(att[8]*Math.abs(y1-y2)/document.all.lay1.offsetHeight);
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
233
d407cb901df4 Initial revision
robcast
parents:
diff changeset
234 if (att[7] != 0 && att[8] != 0) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
235 loadPicture(2);
d407cb901df4 Initial revision
robcast
parents:
diff changeset
236 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
237 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
238 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
239
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
240 function move() {
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
241 e = event;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
242
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
243 x2 = document.body.scrollLeft+e.x;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
244 y2 = document.body.scrollTop+e.y;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
245
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
246 document.all.eck1.style.left = ((x1 < x2) ? x1 : x2);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
247 document.all.eck1.style.top = ((y1 < y2) ? y1 : y2);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
248 document.all.eck2.style.left = ((x1 < x2) ? x2 : x1)-12;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
249 document.all.eck2.style.top = ((y1 < y2) ? y1 : y2);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
250 document.all.eck3.style.left = ((x1 < x2) ? x1 : x2);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
251 document.all.eck3.style.top = ((y1 < y2) ? y2 : y1)-12;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
252 document.all.eck4.style.left = ((x1 < x2) ? x2 : x1)-12;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
253 document.all.eck4.style.top = ((y1 < y2) ? y2 : y1)-12;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
254 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
255
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
256 document.all.lay1.onmousedown = click;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
257 document.all.eck4.onmousedown = click;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
258 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
259
d407cb901df4 Initial revision
robcast
parents:
diff changeset
260
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
261 function zoomPoint() {
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
262
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
263 document.all.lay1.onmousedown = function() {
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
264 e = event;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
265
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
266 att[5] = cropFloat(att[5]+att[7]*(document.body.scrollLeft+e.x-parseInt(document.all.lay1.style.left))/document.all.lay1.offsetWidth-0.5*att[7]*0.7);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
267 att[6] = cropFloat(att[6]+att[8]*(document.body.scrollTop+e.y-parseInt(document.all.lay1.style.top))/document.all.lay1.offsetHeight-0.5*att[8]*0.7);
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
268
d407cb901df4 Initial revision
robcast
parents:
diff changeset
269 att[7] = cropFloat(att[7]*0.7);
d407cb901df4 Initial revision
robcast
parents:
diff changeset
270 att[8] = cropFloat(att[8]*0.7);
d407cb901df4 Initial revision
robcast
parents:
diff changeset
271
d407cb901df4 Initial revision
robcast
parents:
diff changeset
272 if (att[5] < 0) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
273 att[5] = 0;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
274 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
275 if (att[6] < 0) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
276 att[6] = 0;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
277 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
278 if (att[5]+att[7] > 1) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
279 att[5] = 1-att[7];
d407cb901df4 Initial revision
robcast
parents:
diff changeset
280 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
281 if (att[6]+att[8] > 1) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
282 att[6] = 1-att[8];
d407cb901df4 Initial revision
robcast
parents:
diff changeset
283 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
284
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
285 document.all.lay1.cancleBubble = true;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
286
d407cb901df4 Initial revision
robcast
parents:
diff changeset
287 loadPicture(2);
d407cb901df4 Initial revision
robcast
parents:
diff changeset
288 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
289 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
290
d407cb901df4 Initial revision
robcast
parents:
diff changeset
291
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
292 function zoomOut() {
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
293 loadPicture(1);
d407cb901df4 Initial revision
robcast
parents:
diff changeset
294 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
295
d407cb901df4 Initial revision
robcast
parents:
diff changeset
296
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
297 function moveTo() {
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
298
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
299 document.all.lay1.onmousedown = function() {
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
300 e = event;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
301
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
302 att[5] = cropFloat(att[5]+att[7]*(document.body.scrollLeft+e.x-parseInt(document.all.lay1.style.left))/document.all.lay1.offsetWidth-0.5*att[7]);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
303 att[6] = cropFloat(att[6]+att[8]*(document.body.scrollTop+e.y-parseInt(document.all.lay1.style.top))/document.all.lay1.offsetHeight-0.5*att[8]);
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
304
d407cb901df4 Initial revision
robcast
parents:
diff changeset
305 if (att[5] < 0) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
306 att[5] = 0;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
307 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
308 if (att[6] < 0) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
309 att[6] = 0;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
310 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
311 if (att[5]+att[7] > 1) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
312 att[5] = 1-att[7];
d407cb901df4 Initial revision
robcast
parents:
diff changeset
313 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
314 if (att[6]+att[8] > 1) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
315 att[6] = 1-att[8];
d407cb901df4 Initial revision
robcast
parents:
diff changeset
316 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
317
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
318 document.all.lay1.cancleBubble = true;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
319
d407cb901df4 Initial revision
robcast
parents:
diff changeset
320 loadPicture(2);
d407cb901df4 Initial revision
robcast
parents:
diff changeset
321 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
322 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
323
d407cb901df4 Initial revision
robcast
parents:
diff changeset
324
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
325 function scale(scaledef) {
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
326
d407cb901df4 Initial revision
robcast
parents:
diff changeset
327 att[2] = scaledef;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
328 loadPicture(2);
d407cb901df4 Initial revision
robcast
parents:
diff changeset
329 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
330
d407cb901df4 Initial revision
robcast
parents:
diff changeset
331
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
332 function setMarks() {
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
333 if ((att[4] != "") && (att[4] != "0/0")) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
334 var mark = att[4].split(";");
d407cb901df4 Initial revision
robcast
parents:
diff changeset
335
d407cb901df4 Initial revision
robcast
parents:
diff changeset
336 var countMarks = mark.length;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
337
d407cb901df4 Initial revision
robcast
parents:
diff changeset
338 // maximum of marks is 8
d407cb901df4 Initial revision
robcast
parents:
diff changeset
339 // we do not report this error because this is already done in func. "Mark"
d407cb901df4 Initial revision
robcast
parents:
diff changeset
340 if (countMarks > 8) countMarks = 8;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
341
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
342 var picWidth = document.all.lay1.offsetWidth;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
343 var picHeight = document.all.lay1.offsetHeight;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
344
d407cb901df4 Initial revision
robcast
parents:
diff changeset
345 // catch the cases where the picture had not been loaded already and
d407cb901df4 Initial revision
robcast
parents:
diff changeset
346 // make a timeout so that the coordinates are calculated with the real dimensions
d407cb901df4 Initial revision
robcast
parents:
diff changeset
347 if (picWidth > 30) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
348
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
349 var xoffset = parseInt(document.all.lay1.style.left);
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
350 var yoffset = parseInt(document.all.lay1.style.top);
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
351
d407cb901df4 Initial revision
robcast
parents:
diff changeset
352 for (var i = 0; i < countMarks; i++) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
353 mark[i] = mark[i].split("/");
d407cb901df4 Initial revision
robcast
parents:
diff changeset
354
d407cb901df4 Initial revision
robcast
parents:
diff changeset
355 if ((mark[i][0] > att[5]) && (mark[i][1] > att[6]) && (mark[i][0] < (att[5]+att[7])) && (mark[i][1] < (att[6]+att[8]))) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
356
d407cb901df4 Initial revision
robcast
parents:
diff changeset
357 mark[i][0] = parseInt(xoffset+picWidth*(mark[i][0]-att[5])/att[7]);
d407cb901df4 Initial revision
robcast
parents:
diff changeset
358 mark[i][1] = parseInt(yoffset+picHeight*(mark[i][1]-att[6])/att[8]);
d407cb901df4 Initial revision
robcast
parents:
diff changeset
359
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
360 document.getElementById("dot" + i).style.left = mark[i][0]-5;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
361 document.getElementById("dot" + i).style.top = mark[i][1]-5;
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
362 document.getElementById("dot" + i).style.visibility = "visible";
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
363 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
364 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
365 } else {
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
366 setTimeout("setMarks()", 100);
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
367 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
368 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
369 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
370
d407cb901df4 Initial revision
robcast
parents:
diff changeset
371
d407cb901df4 Initial revision
robcast
parents:
diff changeset
372 // capturing keypresses for next and previous page
d407cb901df4 Initial revision
robcast
parents:
diff changeset
373 function parseKeypress() {
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
374 e = event;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
375
d407cb901df4 Initial revision
robcast
parents:
diff changeset
376 if (e.keyCode == 110) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
377 Nextpage();
d407cb901df4 Initial revision
robcast
parents:
diff changeset
378 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
379 if (e.keyCode == 98) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
380 Backpage();
d407cb901df4 Initial revision
robcast
parents:
diff changeset
381 }
31
84a481a388bb first update of new client-version
luginbue
parents: 17
diff changeset
382 document.cancleBubble = true;
17
d407cb901df4 Initial revision
robcast
parents:
diff changeset
383 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
384
d407cb901df4 Initial revision
robcast
parents:
diff changeset
385
d407cb901df4 Initial revision
robcast
parents:
diff changeset
386 // auxiliary function to crop senseless precicsion
d407cb901df4 Initial revision
robcast
parents:
diff changeset
387 function cropFloat(tmp) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
388 return parseInt(10000*tmp)/10000;
d407cb901df4 Initial revision
robcast
parents:
diff changeset
389 }