Mercurial > bins
comparison templates.joi/static/joi.js @ 0:a84c32f131df 1.1.29
Import vendor version
author | Peter Gervai <grin@grin.hu> |
---|---|
date | Wed, 15 Oct 2008 23:28:56 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a84c32f131df |
---|---|
1 var preview = null; | |
2 var inforows = 0; | |
3 | |
4 // Variables for mouseover-highlights | |
5 var hlobj = null; | |
6 var hlclass = null; | |
7 var addobj = null; | |
8 var addclass = null; | |
9 var linkobj = null; | |
10 var linkclass = null; | |
11 | |
12 | |
13 function getBrowser() { | |
14 return navigator.appName; | |
15 } | |
16 | |
17 | |
18 function makePreviewKonq(id, img, brdr) { | |
19 var out = ''; | |
20 var pre = ''; | |
21 var post = ''; | |
22 | |
23 if (brdr) { | |
24 pre = '<table class="konqBorder" cellpadding="3"><tr><td>'; | |
25 post = '</td></tr></table>'; | |
26 } | |
27 out = '<span id="' + id +'" ' | |
28 + 'class="previewNoBorder" ' | |
29 + 'style="left: 0px; top: 0px;">' | |
30 + pre | |
31 + '<img src="' + img + '" border="0" alt="preview">' | |
32 + post | |
33 + '</span>'; | |
34 | |
35 return out; | |
36 } | |
37 | |
38 | |
39 function makePreview(id, img, brdr) { | |
40 var out = ''; | |
41 var browser = getBrowser(); | |
42 | |
43 if (browser == "Konqueror") { | |
44 out = makePreviewKonq(id, img, brdr); | |
45 } else { | |
46 var c = 'previewNoBorder'; | |
47 | |
48 if (brdr) { | |
49 c = 'previewBorder'; | |
50 } | |
51 out = '<div id="' + id +'" ' | |
52 + 'class="' + c + '" style="left: 0px; top: 0px;">' | |
53 + '<img src="' + img + '" border="0" alt="preview">' | |
54 + '</div>'; | |
55 } | |
56 document.writeln(out); | |
57 } | |
58 | |
59 | |
60 | |
61 function infoStart(id) { | |
62 inforows = 0; | |
63 | |
64 document.writeln('<div id="' + id +'" ' | |
65 + 'class="previewNoBorder" style="left: 0px; top: 0px;">' | |
66 + '<table border="0" cellpadding="1" cellspacing="0" align="left">'); | |
67 } | |
68 | |
69 | |
70 function infoAdd(key, value) { | |
71 if (inforows != 0) { | |
72 document.writeln('<tr>' | |
73 + '<td colspan="2" height="1" class="contentBGSep"></td>' | |
74 + '</tr>'); | |
75 } | |
76 inforows = 1; | |
77 document.writeln('<tr class="contentBG"><td class="descrTitle">' | |
78 + key | |
79 + '</td><td class="contentBG">' | |
80 + value | |
81 + '</td></tr>'); | |
82 } | |
83 | |
84 | |
85 function infoEnd() { | |
86 document.writeln('</table></div>'); | |
87 } | |
88 | |
89 | |
90 | |
91 function showPreview(name, pos) { | |
92 if (getBrowser() == "Opera") { | |
93 return | |
94 } else if (document.getElementById) { | |
95 preview = document.getElementById(name); | |
96 if (preview) { | |
97 switch (pos) { | |
98 case 'nw': | |
99 preview.style.bottom = null; | |
100 preview.style.right = null; | |
101 preview.style.top = '0px'; | |
102 preview.style.left = '0px'; | |
103 break; | |
104 case 'ne': | |
105 preview.style.bottom = null; | |
106 preview.style.left = null; | |
107 preview.style.top = '0px'; | |
108 preview.style.right = '0px'; | |
109 break; | |
110 case 'sw': | |
111 preview.style.top = null; | |
112 preview.style.right = null; | |
113 preview.style.bottom = '0px'; | |
114 preview.style.left = '0px'; | |
115 break; | |
116 case 'se': | |
117 preview.style.top = null; | |
118 preview.style.left = null; | |
119 preview.style.bottom = '0px'; | |
120 preview.style.right = '0px'; | |
121 break; | |
122 case 'nc': | |
123 preview.style.bottom = null; | |
124 preview.style.right = null; | |
125 preview.style.top = '0px'; | |
126 preview.style.left = '50%'; | |
127 break; | |
128 case 'sc': | |
129 preview.style.top = null; | |
130 preview.style.right = null; | |
131 preview.style.bottom = '0px'; | |
132 preview.style.left = '50%'; | |
133 break; | |
134 default: | |
135 break; | |
136 } | |
137 preview.style.visibility = 'visible'; | |
138 } | |
139 } | |
140 } | |
141 | |
142 | |
143 function hidePreview() { | |
144 if (preview) { | |
145 preview.style.visibility = 'hidden'; | |
146 } | |
147 } | |
148 | |
149 | |
150 function showTree(name, pos) { | |
151 if (document.getElementById) { | |
152 preview = document.getElementById(name); | |
153 if (preview) { | |
154 preview.style.visibility = 'visible'; | |
155 } | |
156 } | |
157 } | |
158 | |
159 | |
160 function hideTree() { | |
161 if (preview) { | |
162 preview.style.visibility = 'hidden'; | |
163 } | |
164 } | |
165 | |
166 function PreloadNextImage(image) { | |
167 nextimg = new Image(); | |
168 nextimg.src = image; | |
169 } | |
170 | |
171 | |
172 function hlon(pObj, pAddid, pLinkid) { | |
173 hlobj = pObj; | |
174 hlclass = pObj.className; | |
175 pObj.className = 'hover'; | |
176 if (pAddid != null) { | |
177 if (document.getElementById) { | |
178 addobj = document.getElementById(pAddid); | |
179 addclass = addobj.className; | |
180 addobj.className = 'hover'; | |
181 } | |
182 } | |
183 if (pLinkid != null) { | |
184 if (document.getElementById) { | |
185 linkobj = document.getElementById(pLinkid); | |
186 linkclass = linkobj.className; | |
187 linkobj.className = 'hover'; | |
188 } | |
189 } | |
190 } | |
191 | |
192 function hloff() { | |
193 if (hlobj != null) { | |
194 hlobj.className = hlclass; | |
195 hlobj = null; | |
196 hlclass = null; | |
197 } | |
198 if (addobj != null) { | |
199 addobj.className = addclass; | |
200 addobj = null; | |
201 addclass = null; | |
202 } | |
203 if (linkobj != null) { | |
204 linkobj.className = linkclass; | |
205 linkobj = null; | |
206 linkclass = null; | |
207 } | |
208 } | |
209 | |
210 | |
211 function binsback() { | |
212 alert('referrer: ' + document.referrer + '\nURL: ' + document.URL); | |
213 // untersuche ob der referrer gesetzt ist | |
214 // wenn ja: | |
215 // vergleiche mit der URL | |
216 // Quelle ist im bins-tree: | |
217 // javascript.back(); | |
218 // Quelle ist wo ganz anders: | |
219 // gehe zu URL.IMG.MED | |
220 // wenn nein: | |
221 // gehe zu URL.IMG.MED | |
222 | |
223 } |