1 | |
---|
2 | |
---|
3 | Parent = "#theImage"; |
---|
4 | |
---|
5 | function Toggle_bp() { |
---|
6 | cl_visible = !cl_visible; |
---|
7 | if (cl_visible) src = src1; |
---|
8 | else src = src2; |
---|
9 | if (cl_visible) src_info = src3; |
---|
10 | else src_info = src4; |
---|
11 | |
---|
12 | jQuery('#bp_cla').attr('alt', src_info); |
---|
13 | jQuery('#bp_cla').attr('title', src_info); |
---|
14 | |
---|
15 | jQuery('#bp_img_cla').get(0).src = src; |
---|
16 | jQuery('#bp_img_cla').attr('alt', src_info); |
---|
17 | jQuery('#bp_img_cla').attr('title', src_info); |
---|
18 | jQuery('#bp_cla').attr('Stitle', src_info); |
---|
19 | jQuery('#bp_cla').attr('Stip', " "); |
---|
20 | jQuery().newResize(); |
---|
21 | |
---|
22 | } |
---|
23 | |
---|
24 | function Wait_pamoorama() { |
---|
25 | if (jQuery("#pamoorama").length) { |
---|
26 | mypanorama = window.myPamoorama; |
---|
27 | if (!mypanorama) { |
---|
28 | setTimeout("Wait_pamoorama()", 500); |
---|
29 | return false; |
---|
30 | } |
---|
31 | if (mypanorama.skipInit == false) { |
---|
32 | setTimeout("Wait_pamoorama()", 500); |
---|
33 | return false; |
---|
34 | } |
---|
35 | info_pamoorama = jQuery("#pamoorama").infos(); |
---|
36 | new_width = info_pamoorama.width - (info_pamoorama.borderwidth.left + info_pamoorama.borderwidth.right); |
---|
37 | if (Math.abs(new_width - myPamoorama.options.width) > 10) { |
---|
38 | setTimeout("Wait_pamoorama()", 500); |
---|
39 | return false; |
---|
40 | } |
---|
41 | |
---|
42 | nopano = true; |
---|
43 | old_window = { width: 0, height: 0 }; |
---|
44 | jQuery('#pamoorama').trigger('ON'); |
---|
45 | |
---|
46 | } |
---|
47 | } |
---|
48 | nu_img = 0; |
---|
49 | |
---|
50 | //========================================================================== |
---|
51 | function Wait_Affichage() { |
---|
52 | fade_in = parseInt(fade_in); |
---|
53 | if (!jQuery().newResize()) { |
---|
54 | setTimeout("Wait_Affichage()", 500); |
---|
55 | return |
---|
56 | } |
---|
57 | nu_img++; |
---|
58 | |
---|
59 | if (fade_in == 0) { |
---|
60 | jQuery(Parent).css({ opacity: "1" }); |
---|
61 | } else { |
---|
62 | jQuery(Parent).animate({ opacity: "1" }, |
---|
63 | fade_in, "swing", |
---|
64 | function (i) { |
---|
65 | jQuery(Parent).css({ opacity: "1" }); |
---|
66 | if (DEBUG == "true") { |
---|
67 | bp1 = jQuery('.debug').get(nu_img); |
---|
68 | if (!bp1) nu_img = 0; |
---|
69 | bp1 = jQuery('.debug').get(nu_img); |
---|
70 | jQuery(bp1).trigger('ON'); |
---|
71 | } |
---|
72 | } |
---|
73 | ); |
---|
74 | |
---|
75 | } |
---|
76 | // if (nu_img > 1) return; |
---|
77 | |
---|
78 | |
---|
79 | |
---|
80 | img_h = jQuery(TheImg).height(); |
---|
81 | img_w = jQuery(TheImg).width(); |
---|
82 | |
---|
83 | jQuery("#src_img_h").val(img_h); |
---|
84 | jQuery("#src_img_w").val(img_w); |
---|
85 | jQuery("#ret_autosize").val(src_img); |
---|
86 | jQuery("#window_height").val(Window_Affichage.height); |
---|
87 | jQuery("#window_width").val(Window_Affichage.width); |
---|
88 | jQuery("#ret_autosize").trigger('ON', { width: img_w, |
---|
89 | height: img_h, |
---|
90 | theImage: TheImg, |
---|
91 | src_img: src_img, |
---|
92 | window_height: Window_Affichage.height, |
---|
93 | window_width: Window_Affichage.width |
---|
94 | }); |
---|
95 | |
---|
96 | |
---|
97 | } |
---|
98 | |
---|
99 | //===================================================================== |
---|
100 | |
---|
101 | List_autosize = new Array(); |
---|
102 | function Autosize_resize(Obj) { |
---|
103 | if (typeof cl_visible != "undefined") return; |
---|
104 | |
---|
105 | |
---|
106 | conf = jQuery(Obj).get(0).conf; |
---|
107 | Obj = jQuery(Obj).get(0).obj; |
---|
108 | myWindow = jQuery("#" + conf.parent).infos(); |
---|
109 | |
---|
110 | if (myWindow.width == 0) myWindow = jQuery(window).infos(); |
---|
111 | marge_basse = 0; |
---|
112 | if (conf.MargeBasse) |
---|
113 | marge_basse = jQuery().Get_Val_int( |
---|
114 | conf.MargeBasse |
---|
115 | ); |
---|
116 | marge_top = 0; |
---|
117 | if (conf.MargeHaute) |
---|
118 | marge_top = jQuery().Get_Val_int( |
---|
119 | conf.MargeHaute |
---|
120 | ); |
---|
121 | |
---|
122 | info_Obj = jQuery(Obj).infos(); |
---|
123 | h1_left = jQuery(Obj).absoluteLeft(); |
---|
124 | h1_top = jQuery(Obj).absoluteTop(); |
---|
125 | |
---|
126 | if (h1_top < info_Obj.height) |
---|
127 | h1 = (myWindow.height - h1_top - marge_basse - marge_top); |
---|
128 | else |
---|
129 | h1 = (myWindow.height - marge_basse); |
---|
130 | |
---|
131 | |
---|
132 | rap = info_Obj.height / info_Obj.width; |
---|
133 | w2 = parseInt(h1 / rap); |
---|
134 | |
---|
135 | if (w2 < info_Obj.width) |
---|
136 | marginLeft = info_Obj.left + parseInt((info_Obj.width - w2) / 2) + "px"; |
---|
137 | else |
---|
138 | marginLeft = "auto"; |
---|
139 | |
---|
140 | jQuery(Obj).css({ width: "auto", marginTop: marge_top, |
---|
141 | marginLeft: "auto", marginBottom: 0 + "px", |
---|
142 | verticalAlign: "middle", textAlign: "center" |
---|
143 | }); |
---|
144 | jQuery(Obj).height(h1); |
---|
145 | |
---|
146 | //============================================================= |
---|
147 | if (conf.ResizePicture != "true") { |
---|
148 | |
---|
149 | } else |
---|
150 | imgs = jQuery(Obj).find("img"); |
---|
151 | Obj_w = jQuery(Obj).width(); |
---|
152 | Obj_h = jQuery(Obj).height(); |
---|
153 | |
---|
154 | jQuery(imgs).each(function (i) { |
---|
155 | img = jQuery(this); |
---|
156 | |
---|
157 | info_img = { width: conf.width[i], height: conf.height[i] }; |
---|
158 | img_rap = conf.rap[i]; |
---|
159 | |
---|
160 | if (info_img.width > Obj_w) h1 = parseInt(Obj_w / img_rap); |
---|
161 | else w2 = parseInt(Obj_h * img_rap); |
---|
162 | if (w2 > 0 && h1 > 0 && img.length > 0) { |
---|
163 | img.height(h1); |
---|
164 | img.width(w2); |
---|
165 | } |
---|
166 | |
---|
167 | }); |
---|
168 | |
---|
169 | |
---|
170 | |
---|
171 | |
---|
172 | } |
---|
173 | jQuery.extend(jQuery.expr[':'], { |
---|
174 | // Nom du sélecteur personnalisé |
---|
175 | Autosize: function (a) { |
---|
176 | n1 = a.className; |
---|
177 | // personal_block |
---|
178 | if (n1.match(RegExp("autosize", "gi"))) { |
---|
179 | // autoresize = "MargeBasse:30px; ResizePicture:false" |
---|
180 | infconf = jQuery(a).attr("autosize"); |
---|
181 | n1 = typeof infconf; |
---|
182 | conf = { MargeBasse: 0, NoPicture: false } |
---|
183 | if (n1 == "undefined") { |
---|
184 | |
---|
185 | } else { |
---|
186 | tableau = infconf.split(";"); |
---|
187 | for (var i = 0; i < tableau.length; i++) { |
---|
188 | tableau2 = tableau[i].split(":"); |
---|
189 | conf[jQuery.trim(tableau2[0])] = jQuery.trim(tableau2[1]); |
---|
190 | } |
---|
191 | imgs = jQuery(a).find("img"); |
---|
192 | rap = new Array(); |
---|
193 | width = new Array(); |
---|
194 | height = new Array(); |
---|
195 | jQuery(imgs).each(function (i) { |
---|
196 | img = jQuery(this); |
---|
197 | rap.push((img.width() / img.height())); |
---|
198 | width.push(img.width()); |
---|
199 | height.push(img.height()); |
---|
200 | }); |
---|
201 | |
---|
202 | conf['rap'] = rap; |
---|
203 | conf['width'] = width; |
---|
204 | conf['height'] = height; |
---|
205 | |
---|
206 | List_autosize.push({ obj: a, conf: conf }); |
---|
207 | jQuery(a).css({ opacity: 1 }); |
---|
208 | } |
---|
209 | } |
---|
210 | // Css = jQuery(a).getStyles(a); |
---|
211 | |
---|
212 | return false; |
---|
213 | |
---|
214 | } |
---|
215 | }); |
---|
216 | |
---|
217 | |
---|
218 | function List_autosize_resize(event, ui) { |
---|
219 | if (typeof wait_resize == "undefined") wait_resize = false; |
---|
220 | if (wait_resize == true) return; |
---|
221 | |
---|
222 | wait_resize = true; |
---|
223 | if (List_autosize.length == 0) return; |
---|
224 | for (i = 0; i < List_autosize.length; i++) { |
---|
225 | Autosize_resize(jQuery(List_autosize[i])); |
---|
226 | } |
---|
227 | wait_resize = false; |
---|
228 | |
---|
229 | } |
---|
230 | //============================================================== |
---|
231 | jQuery(document).ready( |
---|
232 | function (jQuery) { |
---|
233 | jQuery(':Autosize'); |
---|
234 | |
---|
235 | jQuery(window).unload(function () { |
---|
236 | try { |
---|
237 | if (TheImg) { |
---|
238 | jQuery.cookie('img', TheImg.src); // créer un cookie avec une valeur |
---|
239 | jQuery.cookie('img_h', jQuery(TheImg).height()); |
---|
240 | jQuery.cookie('img_w', jQuery(TheImg).width()); |
---|
241 | jQuery.cookie('window_height', Window_Affichage.height); |
---|
242 | jQuery.cookie('window_width', Window_Affichage.width); |
---|
243 | } |
---|
244 | } catch (r) { |
---|
245 | |
---|
246 | } |
---|
247 | |
---|
248 | }); |
---|
249 | |
---|
250 | jQuery(window).resize( |
---|
251 | function (event, ui) { |
---|
252 | List_autosize_resize(event, ui); |
---|
253 | |
---|
254 | }); |
---|
255 | |
---|
256 | jQuery(window).load(function () { |
---|
257 | if (typeof img_width == "undefined") { |
---|
258 | |
---|
259 | if (List_autosize.length == 0) return; |
---|
260 | for (i = 0; i < List_autosize.length; i++) { |
---|
261 | Autosize_resize(jQuery(List_autosize[i])); |
---|
262 | } |
---|
263 | |
---|
264 | return; |
---|
265 | } |
---|
266 | //========================================================= |
---|
267 | if (typeof (options) == "undefined") { |
---|
268 | options = { imageAutosizeMargin: 0, imageAutosize: false } |
---|
269 | } |
---|
270 | |
---|
271 | old_img = jQuery.cookie('img'); |
---|
272 | old_img_h = jQuery.cookie('img_h'); |
---|
273 | old_img_w = jQuery.cookie('img_w'); |
---|
274 | old_window_height = jQuery.cookie('window_height'); |
---|
275 | old_window_width = jQuery.cookie('window_width'); |
---|
276 | |
---|
277 | //============================================================ |
---|
278 | img_init = { height: img_height, width: img_width }; // taille initiale |
---|
279 | img_defaut = { height: scaled_height, width: scaled_width }; |
---|
280 | img_reelle = { height: img_height, width: img_width }; |
---|
281 | img_finale = { height: 0, width: 0 }; |
---|
282 | |
---|
283 | img_top = "0"; |
---|
284 | rapport = -1; |
---|
285 | marges_llgbo = 0; |
---|
286 | pos = 0; |
---|
287 | //============================================================= |
---|
288 | Type_Img = ""; |
---|
289 | TheImg = null; |
---|
290 | nopano = false; |
---|
291 | |
---|
292 | Zone_Affichage = { height: 0, width: 0 }; |
---|
293 | //============================================================ |
---|
294 | jQuery("#the_page").css({ top: "0px" }); |
---|
295 | Info_the_page = jQuery("#the_page").infos(); |
---|
296 | |
---|
297 | Parent = "#theImage"; |
---|
298 | |
---|
299 | Zone_Affichage = jQuery(Parent).infos(); |
---|
300 | // |
---|
301 | var old_window = { width: 0, height: 0 }; |
---|
302 | Bandeau_bas = Info_Description_f(Parent); |
---|
303 | if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top; |
---|
304 | else Bandeau = 0; |
---|
305 | if (typeof Bandeau_bas == "undefined") { } |
---|
306 | old_window = { width: 0, height: 0 }; |
---|
307 | jQuery("#theImage").trigger('ON'); |
---|
308 | |
---|
309 | old_window = { width: 0, height: 0 }; |
---|
310 | jQuery().newResize(); |
---|
311 | |
---|
312 | //=================================================================== |
---|
313 | /* |
---|
314 | * window .resize |
---|
315 | */ |
---|
316 | jQuery(window).resize( |
---|
317 | function (event, ui) { |
---|
318 | jQuery().newResize(); |
---|
319 | }); |
---|
320 | |
---|
321 | //============== initialisation =================== |
---|
322 | |
---|
323 | var pos; |
---|
324 | var set_p = false; |
---|
325 | |
---|
326 | |
---|
327 | }); // window.onload |
---|
328 | |
---|
329 | /* Extension |
---|
330 | * affiche_debug |
---|
331 | |
---|
332 | * resize |
---|
333 | * : |
---|
334 | */ |
---|
335 | //========================================================= |
---|
336 | old_window = { width: 0, height: 0 }; |
---|
337 | |
---|
338 | jQuery.fn.extend({ |
---|
339 | //========================================================== |
---|
340 | Info_description: function (e) { |
---|
341 | return Info_Description_f(e); |
---|
342 | |
---|
343 | }, |
---|
344 | //============================================================= |
---|
345 | onPropertyChange: function (e) { |
---|
346 | return; |
---|
347 | |
---|
348 | |
---|
349 | }, |
---|
350 | /* |
---|
351 | * recherche la plus grande image (hauteur ou largeur) |
---|
352 | */ |
---|
353 | Get_Img_Maxi: function (myobj) { |
---|
354 | return Get_Img_Maxi(myobj); |
---|
355 | }, |
---|
356 | //============================================================ |
---|
357 | affiche_debug: function (aff_infos) { |
---|
358 | affiche_debug(aff_infos); |
---|
359 | }, |
---|
360 | //==================================================== |
---|
361 | newResize: function () { |
---|
362 | // |
---|
363 | //if (options.imageAutosize) return true ;stripped |
---|
364 | if (DEBUG == "true") { |
---|
365 | nu_img += 1; |
---|
366 | |
---|
367 | bp1 = jQuery('.debug').get(nu_img); |
---|
368 | if (!bp1) nu_img = 0; |
---|
369 | bp1 = jQuery('.debug').get(nu_img); |
---|
370 | |
---|
371 | jQuery(bp1).trigger('ON'); |
---|
372 | } |
---|
373 | if (typeof cl_visible == "undefined") return; |
---|
374 | if (!cl_visible == true) { return true; } |
---|
375 | var chk = eval(user_status + "_enabled"); |
---|
376 | if (chk == "") { return true; } |
---|
377 | //================================================================= |
---|
378 | var winwidth = jQuery(window).width(); |
---|
379 | var winheight = jQuery(window).height(); |
---|
380 | n = winwidth - old_window.width; |
---|
381 | if (n == 0) { |
---|
382 | n = winheight - old_window.height; |
---|
383 | if (n == 0) |
---|
384 | return true; |
---|
385 | } |
---|
386 | old_window = jQuery(window).infos(); |
---|
387 | //=========================================================================== |
---|
388 | |
---|
389 | |
---|
390 | jQuery(Parent).width(winwidth); |
---|
391 | jQuery(Parent).height(winheight); |
---|
392 | |
---|
393 | var Cadre = jQuery(Parent).get(0); |
---|
394 | var info_theImage = jQuery(Cadre).infos(); |
---|
395 | //=============== Information cadre ====== |
---|
396 | var info_the_page = jQuery("#the_page").infos(); |
---|
397 | //============================================================================= |
---|
398 | var info_HeaderBar = jQuery("#imageHeaderBar").infos(); |
---|
399 | var info_content = jQuery("#content").infos(); |
---|
400 | var info_titrePage = jQuery("#titrePage").infos(); |
---|
401 | var info_imageInfoBar = jQuery("#imageInfoBar").infos(); |
---|
402 | var info_theHeader = jQuery("#theHeader").infos(); |
---|
403 | |
---|
404 | var Zone_Affichage = jQuery(Parent).infos(); |
---|
405 | var info_ToolBar = jQuery("#imageToolBar").infos(); |
---|
406 | var marge = 0; |
---|
407 | var marge_right = 0; |
---|
408 | var marge_left = 0; |
---|
409 | if (theme.match(RegExp("simple", "g"))) { |
---|
410 | if (info_ToolBar.width > 0) |
---|
411 | marge = (Zone_Affichage.width - info_ToolBar.width) / 2; |
---|
412 | else if (info_the_page.width > 0) |
---|
413 | marge = (Zone_Affichage.width - info_the_page.width) / 2; |
---|
414 | |
---|
415 | marge_right = marge; |
---|
416 | marge_left = marge; |
---|
417 | |
---|
418 | if (info_content.width > 100) { |
---|
419 | |
---|
420 | marge_left = (info_imageInfoBar.margin.left); |
---|
421 | marge_right = (info_imageInfoBar.margin.left + info_imageInfoBar.margin.right); |
---|
422 | winwidth = info_content.width; |
---|
423 | marge_right = info_imageInfoBar.width + marge_right; |
---|
424 | |
---|
425 | } |
---|
426 | } else { |
---|
427 | if (theme.match(RegExp("stripped", "gi"))) { |
---|
428 | |
---|
429 | marge = (info_the_page.width - info_HeaderBar.width) / 2; |
---|
430 | } else if (info_ToolBar.width > 0) |
---|
431 | marge = (info_the_page.width - info_ToolBar.width) / 2; |
---|
432 | |
---|
433 | marge_right = marge; |
---|
434 | marge_left = marge; |
---|
435 | winwidth = info_the_page.width; |
---|
436 | } |
---|
437 | |
---|
438 | |
---|
439 | |
---|
440 | marge_right += Zone_Affichage.borderwidth.right; |
---|
441 | marge_left += Zone_Affichage.borderwidth.left; |
---|
442 | winwidth -= (marge_right + marge_left); |
---|
443 | //--------------------------------------------- |
---|
444 | jQuery(Parent).width(winwidth); |
---|
445 | jQuery(Parent).css({ height: "auto" }); |
---|
446 | |
---|
447 | |
---|
448 | // jQuery(Parent).height(Zone_Affichage.height); |
---|
449 | //--------------------------------------------- |
---|
450 | |
---|
451 | if (Type_Img == "pamoorama") { |
---|
452 | |
---|
453 | mypanorama = window.myPamoorama; |
---|
454 | //============================================================ |
---|
455 | if (typeof (mypanorama) == "undefined") return false; |
---|
456 | var myPamoorama = mypanorama; |
---|
457 | if (typeof (myPamoorama.skipInit) == "undefined") return false; |
---|
458 | // |
---|
459 | |
---|
460 | if (myPamoorama.skipInit == false) { |
---|
461 | |
---|
462 | return false; |
---|
463 | } |
---|
464 | |
---|
465 | var info_pamoorama = jQuery("#pamoorama").infos(); |
---|
466 | var info_pamoorama_outter = jQuery("#pamoorama_outter").infos(); |
---|
467 | var info_pamoorama_inner = jQuery("#pamoorama_inner").infos(); |
---|
468 | var info_pamoorama_footer = jQuery("#pamoorama_footer").infos(); |
---|
469 | var info_pamoorama_frame = jQuery("#pamoorama_frame").infos(); |
---|
470 | TheImg = jQuery("#pamoorama"); |
---|
471 | obj = TheImg.get(0); |
---|
472 | |
---|
473 | } else { |
---|
474 | |
---|
475 | |
---|
476 | |
---|
477 | |
---|
478 | } |
---|
479 | //================================================================= |
---|
480 | |
---|
481 | |
---|
482 | switch (Type_Img) { |
---|
483 | case "map": |
---|
484 | img_reelle.height = info_img.height; |
---|
485 | info_map = jQuery("#mapPicture").infos(); |
---|
486 | jQuery("#map").css("left", info_map.width + "px"); |
---|
487 | Bandeau_bas.height = 10; |
---|
488 | |
---|
489 | if (theme.match(RegExp("simple", "g"))) { |
---|
490 | img_reelle.width = winwidth; //- info_map.width -marge_right; |
---|
491 | } else { |
---|
492 | img_reelle.width = winwidth - info_map.width - marge_right; |
---|
493 | } |
---|
494 | |
---|
495 | |
---|
496 | info_the_page = jQuery("#the_page").infos(); |
---|
497 | winwidth = img_reelle.width; |
---|
498 | |
---|
499 | ; |
---|
500 | |
---|
501 | break |
---|
502 | |
---|
503 | |
---|
504 | case "panorama": |
---|
505 | // return; |
---|
506 | |
---|
507 | |
---|
508 | TheImg = jQuery().Get_Img_Maxi("#Panorama img"); |
---|
509 | info_theImage = jQuery(TheImg).infos(); |
---|
510 | info_the_page = jQuery("#the_page").infos(); |
---|
511 | |
---|
512 | break |
---|
513 | case "img": |
---|
514 | |
---|
515 | if (!TheImg) return true; |
---|
516 | if (theme.match(RegExp("luciano", "g"))) { |
---|
517 | TheImg = jQuery("#the_page #theImg"); |
---|
518 | } |
---|
519 | info_theImage = jQuery(TheImg).infos(); |
---|
520 | info_the_page = jQuery("#the_page").infos(); |
---|
521 | |
---|
522 | |
---|
523 | break |
---|
524 | case "img_autre": |
---|
525 | if (!TheImg) { |
---|
526 | if (DEBUG == "true") alert("TheImg=null"); |
---|
527 | return true; |
---|
528 | |
---|
529 | } |
---|
530 | info_theImage = jQuery(TheImg).infos(); |
---|
531 | info_the_page = jQuery("#the_page").infos(); |
---|
532 | |
---|
533 | |
---|
534 | break |
---|
535 | case "embed": |
---|
536 | // |
---|
537 | |
---|
538 | info_theImage = info_img; |
---|
539 | info_the_page = jQuery("#the_page").infos(); |
---|
540 | |
---|
541 | if (rapport < 0) { |
---|
542 | img_height = info_img.height; |
---|
543 | img_width = info_img.width; |
---|
544 | |
---|
545 | img_reelle.height = img_height; |
---|
546 | img_reelle.width = img_width; |
---|
547 | |
---|
548 | } |
---|
549 | |
---|
550 | break |
---|
551 | case "charlie": |
---|
552 | |
---|
553 | |
---|
554 | info_theImage = info_img; |
---|
555 | info_the_page = jQuery("#the_page").infos(); |
---|
556 | if (rapport < 0) { |
---|
557 | img_height = parseInt(info_img.height); |
---|
558 | img_width = parseInt(info_img.width); |
---|
559 | |
---|
560 | img_reelle.height = parseInt(info_img.height); |
---|
561 | img_reelle.width = parseInt(info_img.width); |
---|
562 | } |
---|
563 | |
---|
564 | break |
---|
565 | case "pamoorama": |
---|
566 | |
---|
567 | img_reelle = { height: img_height, width: img_width }; |
---|
568 | |
---|
569 | //========================================================= |
---|
570 | img_reelle.height = img_height; |
---|
571 | img_reelle.width = Zone_Affichage.width; |
---|
572 | |
---|
573 | |
---|
574 | TheImg = myPamoorama.image; |
---|
575 | info_theImage = jQuery("#pamoorama").infos(); |
---|
576 | info_theImage.height = img_reelle.height; |
---|
577 | |
---|
578 | |
---|
579 | info_the_page = jQuery("#the_page").infos(); |
---|
580 | |
---|
581 | break |
---|
582 | |
---|
583 | |
---|
584 | } |
---|
585 | |
---|
586 | //=============== Vérification taille minimale autorizée ====================== |
---|
587 | var miniWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-width"), mini_width); |
---|
588 | var miniHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-height"), mini_height); |
---|
589 | |
---|
590 | var miniWidth2 = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-width"), mini_width2); |
---|
591 | var miniHeight2 = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-height"), mini_height2); |
---|
592 | |
---|
593 | var maxWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-width"), winwidth, "0"); |
---|
594 | maxHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-height"), winheight, "0"); |
---|
595 | |
---|
596 | |
---|
597 | mini_width = parseInt(miniWidth); |
---|
598 | mini_height = parseInt(miniHeight); |
---|
599 | |
---|
600 | img_reelle.width = parseInt(img_reelle.width); |
---|
601 | |
---|
602 | if (img_reelle.width < mini_width) return true; |
---|
603 | |
---|
604 | img_reelle.height = parseInt(img_reelle.height); |
---|
605 | if (img_reelle.height < parseInt(mini_height)) return true; |
---|
606 | //================================================================================== |
---|
607 | if (rapport < 0) { |
---|
608 | |
---|
609 | img_init.height = parseInt(img_height); |
---|
610 | img_init.width = parseInt(img_width); |
---|
611 | |
---|
612 | rapport = img_width / img_height; |
---|
613 | |
---|
614 | if (Type_Img != "map") |
---|
615 | rapport = (img_init.width / img_init.height); |
---|
616 | else |
---|
617 | rapport = 0; |
---|
618 | |
---|
619 | } |
---|
620 | |
---|
621 | |
---|
622 | //=============== Zone d'affichage ============================ |
---|
623 | |
---|
624 | borderW = Zone_Affichage.borderwidth.left; |
---|
625 | borderW += Zone_Affichage.borderwidth.right; |
---|
626 | |
---|
627 | |
---|
628 | Zone_Affichage.width = winwidth - borderW; |
---|
629 | |
---|
630 | |
---|
631 | |
---|
632 | var Licence = jQuery(".licencetag"); |
---|
633 | info_Licence = jQuery(".licencetag").infos(); |
---|
634 | |
---|
635 | jQuery(Parent + " #theImg IMG").css("marginTop", "0px") |
---|
636 | //========== Correction en fonction du thème ============================= |
---|
637 | var correction = 0; |
---|
638 | if (theme.match(RegExp("sobre", "g"))) { |
---|
639 | |
---|
640 | // correction = -info_Licence.padding.top; |
---|
641 | if (Type_Img == 'img') { |
---|
642 | if (msie == true) correction = 0; |
---|
643 | else correction = 0; |
---|
644 | correction = 10; |
---|
645 | } |
---|
646 | |
---|
647 | } else if (theme.match(RegExp("Pure", "g"))) { |
---|
648 | correction += 0; //?? |
---|
649 | } else if (theme.match(RegExp("luciano", "g"))) { |
---|
650 | correction = 0; //?? |
---|
651 | |
---|
652 | } else if (theme.match(RegExp("simple", "g"))) { |
---|
653 | correction += 0; //?? |
---|
654 | } else if (theme.match(RegExp("gally", "g"))) { |
---|
655 | correction += 0; //?? |
---|
656 | |
---|
657 | } |
---|
658 | |
---|
659 | //==================================================== |
---|
660 | if (options.imageAutosizeMargin > 0) Marge_Basse = options.imageAutosizeMargin; |
---|
661 | else Marge_Basse = parseInt(marge_basse || 0); // hors bandeau |
---|
662 | //========================================================================== |
---|
663 | h = 0; |
---|
664 | |
---|
665 | h = (Zone_Affichage.padding.bottom + Zone_Affichage.padding.top + Zone_Affichage.margin.top + Zone_Affichage.margin.bottom); |
---|
666 | Bandeau = Bandeau_t.img_top; |
---|
667 | Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction - h; |
---|
668 | //========================================================================= |
---|
669 | if (Zone_Affichage.height < mini_height2) |
---|
670 | Zone_Affichage.height = mini_height2; |
---|
671 | if (Zone_Affichage.width < mini_width2) |
---|
672 | Zone_Affichage.width = mini_width2; |
---|
673 | //========================================================================= |
---|
674 | if (typeof (Bandeau_bas) != "undefined") { |
---|
675 | Zone_Affichage.height -= (Bandeau_bas.height + Bandeau_bas.marge.top + Bandeau_bas.marge.bottom); |
---|
676 | |
---|
677 | |
---|
678 | } else { |
---|
679 | |
---|
680 | } |
---|
681 | |
---|
682 | var Image_height = Zone_Affichage.height; |
---|
683 | |
---|
684 | //============================================================= |
---|
685 | var height_user = eval(user_status + "_height"); |
---|
686 | var reg1 = new RegExp("%", "g"); |
---|
687 | if (height_user.match(reg1)) |
---|
688 | Image_height = Image_height * parseInt(height_user) / 100; |
---|
689 | else |
---|
690 | Image_height = parseInt(height_user); |
---|
691 | |
---|
692 | echelle_max = parseFloat(echelle_max, '3'); |
---|
693 | var echelle = parseFloat(Image_height / img_reelle.height, 3); |
---|
694 | |
---|
695 | if (echelle > echelle_max) { echelle = echelle_max; } |
---|
696 | Image_height = parseInt(img_reelle.height * echelle); |
---|
697 | //============================================================ |
---|
698 | |
---|
699 | var Image_width; |
---|
700 | if (rapport > 0) |
---|
701 | Image_width = parseInt(Image_height * rapport); |
---|
702 | else if (Type_Img == "map") { |
---|
703 | Image_width = Zone_Affichage.width - marge_left - marge_right; |
---|
704 | } else { |
---|
705 | Image_width = Zone_Affichage.width; |
---|
706 | } |
---|
707 | |
---|
708 | //=============================================================== |
---|
709 | align_auto = "center"; |
---|
710 | if (jQuery("#theImg").css("textAlign")) |
---|
711 | align_auto = jQuery("#theImg").css("textAlign"); |
---|
712 | var widthmin = winwidth; |
---|
713 | |
---|
714 | if (check_auto_w == 'checked="checked"') { |
---|
715 | // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) { |
---|
716 | //==== largeur à atteindre === |
---|
717 | var width_user = eval(user_status + "_width"); |
---|
718 | // Largeur maximale en fonction du statut |
---|
719 | if (width_user.match(reg1)) |
---|
720 | // pourcentage |
---|
721 | widthmin = widthmin * parseInt(width_user) / 100; |
---|
722 | else |
---|
723 | widthmin = parseInt(width_user); |
---|
724 | |
---|
725 | var marges = 0; |
---|
726 | |
---|
727 | if (typeof (info_img) != "undefined") { |
---|
728 | widthmin -= info_img.borderwidth.left || 0; |
---|
729 | widthmin -= info_img.borderwidth.right || 0; |
---|
730 | } |
---|
731 | widthmin -= marges; |
---|
732 | widthmin -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left); |
---|
733 | Image_width -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left); |
---|
734 | if (Image_width > widthmin) { |
---|
735 | // Image_width largeur à atteindre |
---|
736 | // Calcul du rapport d'agrandissement |
---|
737 | var echelle_w = parseFloat((widthmin) / img_reelle.width, 3); |
---|
738 | if (echelle_w > echelle_max) { echelle_w = echelle_max; } |
---|
739 | Image_width = parseInt(img_reelle.width * echelle_w); |
---|
740 | if (rapport > 0) |
---|
741 | Image_height = parseInt(Image_width / rapport); |
---|
742 | } |
---|
743 | |
---|
744 | |
---|
745 | |
---|
746 | } |
---|
747 | |
---|
748 | |
---|
749 | // } |
---|
750 | //=================================================== |
---|
751 | |
---|
752 | img_finale.height = Image_height; |
---|
753 | img_finale.width = Image_width; |
---|
754 | if (theme.match(RegExp("stripped", "gi"))) { |
---|
755 | img_finale.width -= (llgboframe.top * 2); |
---|
756 | if (rapport > 0) img_finale.height = (img_finale.width / rapport); |
---|
757 | else img_finale.height -= (llgboframe.top * 2); |
---|
758 | } |
---|
759 | zoom = echelle; |
---|
760 | if (llgboframe.height > 0) { |
---|
761 | //=============LLGBO2 =========================== |
---|
762 | t1 = llgboframe; |
---|
763 | if (!TheImg.src) { |
---|
764 | TheImg = jQuery(TheImg).find("img").get(0) |
---|
765 | if (!TheImg.src) { |
---|
766 | TheImg = jQuery(Parent).find("div").get(0) |
---|
767 | } |
---|
768 | } |
---|
769 | if (TheImg.src) { |
---|
770 | |
---|
771 | |
---|
772 | wingbo = img_finale.width; |
---|
773 | heightgbo = img_finale.height; |
---|
774 | img_finale.width -= marges_llgbo; |
---|
775 | if (jQuery("#slideshow").infos().width > 0) { |
---|
776 | img_finale.height -= (marges_llgbo * 1.5); |
---|
777 | } else { |
---|
778 | img_finale.height -= marges_llgbo |
---|
779 | } |
---|
780 | |
---|
781 | |
---|
782 | if (wingbo > winwidth) { |
---|
783 | jQuery("#gbo").width(winwidth); |
---|
784 | jQuery("#gbo").height(winheight); |
---|
785 | jQuery("#gbo").css("width", winwidth + "px"); |
---|
786 | jQuery("#gbo").css("height", winheight + "px"); |
---|
787 | } |
---|
788 | else { |
---|
789 | jQuery("#gbo").width(wingbo); |
---|
790 | jQuery("#gbo").height(heightgbo); |
---|
791 | jQuery("#gbo").css("width", wingbo + "px"); |
---|
792 | jQuery("#gbo").css("height", heightgbo + "px"); |
---|
793 | } |
---|
794 | |
---|
795 | a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]"); |
---|
796 | a1 = jQuery("area[rel=prev]"); |
---|
797 | a2 = jQuery("area[rel=next]"); |
---|
798 | a3 = jQuery("area[rel=up]"); |
---|
799 | nb_zone = 3; |
---|
800 | if (a1.length == 0) { |
---|
801 | nb_zone -= 1; |
---|
802 | } |
---|
803 | if (a2.length == 0) { |
---|
804 | nb_zone -= 1; |
---|
805 | } |
---|
806 | |
---|
807 | |
---|
808 | var Largeur_zone = (img_finale.width / nb_zone); |
---|
809 | var Hauteur_zone = (img_finale.height); |
---|
810 | var init_zone = 0; |
---|
811 | |
---|
812 | if (a1.length > 0) { |
---|
813 | coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone }; |
---|
814 | |
---|
815 | jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" }); |
---|
816 | init_zone += Largeur_zone; |
---|
817 | } |
---|
818 | |
---|
819 | coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height }; |
---|
820 | |
---|
821 | if (a0.length > 0) { |
---|
822 | jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" }); |
---|
823 | jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" }); |
---|
824 | } else { |
---|
825 | jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" }); |
---|
826 | } |
---|
827 | init_zone += Largeur_zone; |
---|
828 | |
---|
829 | if (a2.length > 0) { |
---|
830 | coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height }; |
---|
831 | jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" }); |
---|
832 | } |
---|
833 | } |
---|
834 | } |
---|
835 | |
---|
836 | //================ Zone affichage ========================= |
---|
837 | |
---|
838 | |
---|
839 | // jQuery(Cadre).css("top", "0px"); |
---|
840 | jQuery("#standard").css("top", 0 + "px"); |
---|
841 | jQuery("#comments").css("top", 0 + "px"); |
---|
842 | //========== Image Remise à l'échelle ======================= |
---|
843 | |
---|
844 | Image_height = img_finale.height; |
---|
845 | Image_width = img_finale.width; |
---|
846 | //========================================================================= |
---|
847 | if (jQuery("#slideshow").infos().width > 0) { |
---|
848 | |
---|
849 | jQuery(Cadre).css({ marginLeft: "auto" |
---|
850 | }); |
---|
851 | } |
---|
852 | else |
---|
853 | jQuery(Cadre).css({ marginLeft: marge_left + "px" |
---|
854 | }); |
---|
855 | jQuery(Cadre).width(Zone_Affichage.width); |
---|
856 | // jQuery(Cadre).height(Zone_Affichage.height); |
---|
857 | |
---|
858 | if (typeof (gmaps) != "undefined") { |
---|
859 | Gmap_ = gmaps.maps[0]; |
---|
860 | if (Gmap_.sizeMode == 'A') { |
---|
861 | jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" }); |
---|
862 | |
---|
863 | } |
---|
864 | } |
---|
865 | //============= flv,mov,mpg ok |
---|
866 | /* wmv nok |
---|
867 | * avi nok |
---|
868 | //=========================================== |
---|
869 | */ |
---|
870 | if (Type_Img == "charlie") { |
---|
871 | t1 = jQuery("#charlie").infos(); |
---|
872 | |
---|
873 | /**/ |
---|
874 | |
---|
875 | pdf = 0; |
---|
876 | jQuery("#charlie div").each(function (i) { |
---|
877 | |
---|
878 | |
---|
879 | p1 = jQuery(this).infos(); |
---|
880 | pdf += p1.padding.right + p1.padding.left; |
---|
881 | }); |
---|
882 | img_finale.width -= pdf; |
---|
883 | |
---|
884 | jQuery("#charlie").css({ |
---|
885 | width: img_finale.width + pdf, |
---|
886 | height: img_finale.height, |
---|
887 | margin: "auto" |
---|
888 | }); |
---|
889 | |
---|
890 | |
---|
891 | |
---|
892 | jQuery("#player").css("width", img_finale.width + "px"); |
---|
893 | jQuery("#player").css("height", img_finale.height); |
---|
894 | |
---|
895 | jQuery("#embedplayer").css("width", img_finale.width); |
---|
896 | jQuery("#embedplayer").css("height", img_finale.height); |
---|
897 | |
---|
898 | |
---|
899 | jQuery("object").width(img_finale.width); |
---|
900 | jQuery("object").height(img_finale.height); |
---|
901 | |
---|
902 | |
---|
903 | } else if (Type_Img == "panorama") { |
---|
904 | |
---|
905 | // ----- jQuery(TheImg).panorama2(img_finale.height, img_finale.width); |
---|
906 | // jQuery(TheImg).height(img_finale.height); |
---|
907 | // jQuery(TheImg).width(img_finale.width); |
---|
908 | jQuery("#Panorama div").height(img_finale.height); |
---|
909 | // class=simple_panorama |
---|
910 | |
---|
911 | jQuery(".panorama-viewport").css("left", "2px"); |
---|
912 | jQuery(".panorama-viewport").css("width", "auto"); |
---|
913 | |
---|
914 | |
---|
915 | } else if (Type_Img == "pamoorama") { |
---|
916 | info_theImage.height = Zone_Affichage.height; |
---|
917 | img_height = myPamoorama.imageHeight |
---|
918 | if (theme.match(RegExp("simple", "g"))) { |
---|
919 | // marge_right = 2; |
---|
920 | } |
---|
921 | new_width = Zone_Affichage.width - marge_right - marge_left; |
---|
922 | new_width = Zone_Affichage.width - (info_theImage.borderwidth.right + info_theImage.borderwidth.left); |
---|
923 | |
---|
924 | |
---|
925 | |
---|
926 | Zone_Affichage.height += info_pamoorama_footer.height; |
---|
927 | zoom = info_theImage.height / img_height; |
---|
928 | myPamoorama.options.width = new_width * zoom; |
---|
929 | // if(msie || safari) jQuery("#pamoorama_inner ").css({ zoom: zoom }); |
---|
930 | //==================================================== |
---|
931 | jQuery("#pamoorama").css({ |
---|
932 | marginLeft: "auto", |
---|
933 | marginRight: "auto", |
---|
934 | //height: Zone_Affichage.height + "px", sinon déclenchement panorama sur la hauteur; |
---|
935 | width: new_width + "px" |
---|
936 | }); |
---|
937 | jQuery("#pamoorama").width(new_width); |
---|
938 | |
---|
939 | //==================================================== |
---|
940 | info_pamoorama = jQuery("#pamoorama").infos(); |
---|
941 | img_finale.height = info_pamoorama.height - info_pamoorama_footer.height; |
---|
942 | img_finale.width = new_width; |
---|
943 | |
---|
944 | jQuery("#pamoorama_outter").width(new_width); |
---|
945 | |
---|
946 | |
---|
947 | // commenter sinon outter augmente à chaque resize |
---|
948 | // jQuery("#pamoorama_outter").height(info_pamoorama.height - info_pamoorama_footer.height); |
---|
949 | |
---|
950 | |
---|
951 | |
---|
952 | jQuery("#pamoorama_outter").css({ width: new_width + "px" }); |
---|
953 | jQuery("#pamoorama_footer").css({ width: new_width + "px" }); |
---|
954 | // |
---|
955 | //==================================================== |
---|
956 | info_pamoorama = jQuery("#pamoorama").infos(); |
---|
957 | info_pamoorama_outter = jQuery("#pamoorama_outter").infos(); |
---|
958 | info_pamoorama_inner = jQuery("#pamoorama_inner").infos(); |
---|
959 | info_pamoorama_footer = jQuery("#pamoorama_footer").infos(); |
---|
960 | info_pamoorama_frame = jQuery("#pamoorama_frame").infos(); |
---|
961 | |
---|
962 | info_frame = jQuery(myPamoorama.frame).infos(); |
---|
963 | |
---|
964 | zoom = img_finale.height / img_height; |
---|
965 | |
---|
966 | |
---|
967 | } else if (TheImg.src) { |
---|
968 | //--- background ?? --- |
---|
969 | jQuery(TheImg).height(img_finale.height); |
---|
970 | jQuery(TheImg).width(img_finale.width); |
---|
971 | jQuery(TheImg).css({ height: img_finale.height + "px ", |
---|
972 | width: img_finale.width + "px " |
---|
973 | }); |
---|
974 | |
---|
975 | |
---|
976 | } else { |
---|
977 | //===map ? === |
---|
978 | jQuery(TheImg).height(img_finale.height); |
---|
979 | jQuery(TheImg).width(img_finale.width); |
---|
980 | jQuery(TheImg).css({ height: img_finale.height + "px ", |
---|
981 | width: img_finale.width + "px " |
---|
982 | }); |
---|
983 | |
---|
984 | } |
---|
985 | |
---|
986 | jQuery("#navThumbPrev").css({ overflow: "hidden" }); |
---|
987 | jQuery("#navThumbNext").css({ overflow: "hidden" }); |
---|
988 | n = typeof inittoolbar; |
---|
989 | if (Type_Img == "map") { |
---|
990 | jQuery("#navThumbNext").css({ display: 'none' }); |
---|
991 | jQuery("#navThumbPrev").css({ display: 'none' }); |
---|
992 | } |
---|
993 | try { |
---|
994 | if (theme.match(RegExp("gally", "gi"))) { |
---|
995 | if (typeof inittoolbar == "function") { |
---|
996 | if (typeof (currentTab) == "undefined") inittoolbar(); |
---|
997 | else initializeImageMode("resize"); |
---|
998 | } |
---|
999 | //=========================================================================== |
---|
1000 | |
---|
1001 | if (jQuery("#navThumbPrev").length > 0) { |
---|
1002 | jQuery("#navThumbPrev").css({ height: info_img.height + "px", |
---|
1003 | overflow: "hidden" |
---|
1004 | }); |
---|
1005 | |
---|
1006 | } |
---|
1007 | if (jQuery("#navThumbNext").length > 0) { |
---|
1008 | jQuery("#navThumbNext").css({ height: info_img.height + "px", |
---|
1009 | overflow: "hidden" |
---|
1010 | }); |
---|
1011 | |
---|
1012 | } |
---|
1013 | |
---|
1014 | |
---|
1015 | if (!theme.match(RegExp("lapis", "gi"))) { |
---|
1016 | if (typeof initializeImageMode == "function") { |
---|
1017 | initializeImageMode("resize"); |
---|
1018 | } |
---|
1019 | |
---|
1020 | } |
---|
1021 | |
---|
1022 | } else if (theme.match(RegExp("simple", "g"))) { |
---|
1023 | |
---|
1024 | jQuery("#imageToolBar").css({ position: "static" }); |
---|
1025 | |
---|
1026 | info_imageInfoBar = jQuery("#imageInfoBar").infos(); |
---|
1027 | if (info_imageInfoBar.bottom < info_img.bottom) { |
---|
1028 | // jQuery("#imageInfoBar").height(info_img.bottom); |
---|
1029 | } |
---|
1030 | |
---|
1031 | } else { |
---|
1032 | |
---|
1033 | // jQuery("#imageToolBar").css("position", "static"); |
---|
1034 | } |
---|
1035 | } catch (e) { |
---|
1036 | |
---|
1037 | } |
---|
1038 | // --- rglage de la hauteur de page en fonction du copyright----------- |
---|
1039 | if (typeof (pos) == "undefined") pos = jQuery("#copyright").infos(); |
---|
1040 | if (pos != jQuery("#copyright").infos()) |
---|
1041 | pos = jQuery("#copyright").infos(); |
---|
1042 | if (theme.match(RegExp("stripped", "gi"))) { |
---|
1043 | var TitleBox = jQuery("#imageTitleContainer"); |
---|
1044 | if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px"); |
---|
1045 | } else { |
---|
1046 | if (pos.top > 100) |
---|
1047 | jQuery("#the_page").height(pos.top); |
---|
1048 | |
---|
1049 | } |
---|
1050 | |
---|
1051 | if (!theme.match(RegExp("luciano", "gi"))) { |
---|
1052 | jQuery("#linkNext").css({ height: "80px", width: "200px", overflow: "hidden" }); |
---|
1053 | jQuery("#linkPrev").css({ height: "80px", width: "200px", overflow: "hidden" }); |
---|
1054 | jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" }); |
---|
1055 | } |
---|
1056 | info_frame = jQuery(Cadre).infos(); |
---|
1057 | if (theme.match(RegExp("stripped", "gi"))) { |
---|
1058 | pos = "absolute"; |
---|
1059 | info_theImageBox = jQuery("#theImageAndTitle").infos(); |
---|
1060 | t1 = info_theImageBox.top; |
---|
1061 | l1 = info_theImageBox.left; |
---|
1062 | info_theImageBox = jQuery(Parent).infos(); |
---|
1063 | |
---|
1064 | } else { |
---|
1065 | pos = "absolute"; |
---|
1066 | t1 = info_frame.top; |
---|
1067 | l1 = info_frame.left; |
---|
1068 | info_theImageBox = jQuery(Parent).infos(); |
---|
1069 | } |
---|
1070 | |
---|
1071 | info_theImageBox.margin.margin = info_frame.margin.margin; |
---|
1072 | info_theImageBox.top = t1; |
---|
1073 | info_theImageBox.left = l1; |
---|
1074 | info_theImageBox.pos = "absolute"; |
---|
1075 | Window_Affichage = info_theImageBox; |
---|
1076 | if (DEBUG == "true") { |
---|
1077 | // jQuery(Cadre).css("border", "solid green"); |
---|
1078 | |
---|
1079 | jQuery("#Debug5").css({ background: "transparent", |
---|
1080 | position: pos, |
---|
1081 | border: "green solid 2px", |
---|
1082 | textAlign: align_auto, |
---|
1083 | margin: Window_Affichage.margin.margin, |
---|
1084 | top: Window_Affichage.top + "px", |
---|
1085 | left: Window_Affichage.left + "px", |
---|
1086 | width: Window_Affichage.width + "px", |
---|
1087 | height: Window_Affichage.height + "px" |
---|
1088 | }); //red |
---|
1089 | jQuery("#Debug4").css({ top: info_frame.bottom - info_description.height + "px" }); //green |
---|
1090 | } |
---|
1091 | |
---|
1092 | Wait_Affichage(); |
---|
1093 | |
---|
1094 | return true; |
---|
1095 | |
---|
1096 | |
---|
1097 | |
---|
1098 | |
---|
1099 | |
---|
1100 | //_____________________________________________________ |
---|
1101 | } // Resize(); |
---|
1102 | |
---|
1103 | |
---|
1104 | //====================================================================== |
---|
1105 | |
---|
1106 | |
---|
1107 | }); // fin extend |
---|
1108 | |
---|
1109 | |
---|
1110 | |
---|
1111 | } // function |
---|
1112 | ); |
---|
1113 | |
---|
1114 | |
---|
1115 | /* |
---|
1116 | * recherche la plus grande image (hauteur ou largeur) |
---|
1117 | */ |
---|
1118 | function Get_Img_Maxi(myobj) { |
---|
1119 | var w00 = 0; |
---|
1120 | var myImg = null; |
---|
1121 | jQuery(myobj).each(function (i) { |
---|
1122 | w0 = img_reelle.width; |
---|
1123 | h0 = img_reelle.height; |
---|
1124 | if (h0 > w0) w0 = h0; |
---|
1125 | if (w0 > w00) { |
---|
1126 | if (!this.src.match(RegExp(".png", "g"))) |
---|
1127 | if (!this.src.match(RegExp(thumbnail, "g"))) { |
---|
1128 | myImg = this; |
---|
1129 | w00 = w0; |
---|
1130 | } |
---|
1131 | |
---|
1132 | } |
---|
1133 | }); |
---|
1134 | return myImg; |
---|
1135 | } |
---|
1136 | |
---|
1137 | //============================================================ |
---|
1138 | /* |
---|
1139 | * |
---|
1140 | */ |
---|
1141 | |
---|
1142 | function Info_entete(Parent) { |
---|
1143 | if (typeof (marge_top) != "undefined") return result; |
---|
1144 | info_imageToolBar = jQuery("#imageToolBar").infos(); |
---|
1145 | if (info_imageToolBar.position == "absolute") { |
---|
1146 | jQuery("#imageToolBar").css("position", "relative"); |
---|
1147 | jQuery("#imageToolBar").css("top", 0 + "px"); |
---|
1148 | } |
---|
1149 | optiontop = 0; |
---|
1150 | |
---|
1151 | info_imageInfoBar = jQuery("#imageInfoBar").infos(); |
---|
1152 | |
---|
1153 | jQuery("#" + "theImgContainer").css("marginTop", "0px"); |
---|
1154 | info_theImage = jQuery(Parent).infos(); |
---|
1155 | info_thePicturePage = jQuery("#thePicturePage").infos(); |
---|
1156 | |
---|
1157 | |
---|
1158 | if (theme.match(RegExp("stripped", "gi"))) { |
---|
1159 | |
---|
1160 | info_theImageAndTitle = jQuery("#theImageAndTitle").infos(); |
---|
1161 | info_theImageBox = jQuery("#theImageBox").infos(); |
---|
1162 | |
---|
1163 | optiontop = (marges_llgbo / 2) + info_theImageAndTitle.margin.top; |
---|
1164 | |
---|
1165 | } |
---|
1166 | |
---|
1167 | if (info_theImage.position == "relative") { |
---|
1168 | //--- passage relative ==> static ===/ |
---|
1169 | jQuery(Parent).css("position", "static"); |
---|
1170 | info_theImage = jQuery(Parent).infos(); |
---|
1171 | |
---|
1172 | } else { |
---|
1173 | |
---|
1174 | } |
---|
1175 | if (info_theImage.position == "absolute") { |
---|
1176 | //--- passage absolute ==> static ===/ |
---|
1177 | jQuery(Parent).css("position", "static"); |
---|
1178 | info_theImage = jQuery(Parent).infos(); |
---|
1179 | |
---|
1180 | } |
---|
1181 | |
---|
1182 | marge_top = Math.ceil(Info_the_page.top + |
---|
1183 | Info_the_page.borderwidth.top + |
---|
1184 | info_theImage.borderwidth.top + |
---|
1185 | info_thePicturePage.margin.top |
---|
1186 | ); |
---|
1187 | |
---|
1188 | img_top = Math.ceil(info_theImage.top + |
---|
1189 | info_theImage.borderwidth.top + |
---|
1190 | info_thePicturePage.margin.top + optiontop); |
---|
1191 | result = info_imageToolBar; |
---|
1192 | result.width = "20%"; |
---|
1193 | result.left = "40%"; |
---|
1194 | result.marge_top = marge_top; |
---|
1195 | result.img_top = img_top; |
---|
1196 | //=== Afficher le titre de l'image sur le cadre === |
---|
1197 | llgboh2 = jQuery("#gboh2").infos(); |
---|
1198 | result.img_top += llgboh2.height; |
---|
1199 | return result; |
---|
1200 | |
---|
1201 | } |
---|
1202 | |
---|
1203 | /* Récupère les informations sur la description. |
---|
1204 | * |
---|
1205 | */ |
---|
1206 | |
---|
1207 | //==================================================== |
---|
1208 | function Info_Description_f(Parent) { |
---|
1209 | |
---|
1210 | |
---|
1211 | jQuery(Parent).css({ display: "block" }); |
---|
1212 | //====== détection du type d'images ====== |
---|
1213 | if (jQuery("#charlie").length > 0) { |
---|
1214 | Type_Img = "charlie"; |
---|
1215 | } else if (jQuery("#pamoorama").length) { |
---|
1216 | Type_Img = "pamoorama"; |
---|
1217 | } else if (jQuery(Parent + " embed").length > 0) { |
---|
1218 | Type_Img = "embed"; |
---|
1219 | } else if (jQuery("#map").length) { |
---|
1220 | Type_Img = "map"; |
---|
1221 | |
---|
1222 | } else if (jQuery("#Panorama").length) { |
---|
1223 | Type_Img = "panorama"; |
---|
1224 | } else if (jQuery(Parent).find("img").length > 0) { |
---|
1225 | Type_Img = "img"; |
---|
1226 | } else if (jQuery(Parent + "Box").find("img").length > 0) { |
---|
1227 | Type_Img = "img"; |
---|
1228 | Parent = Parent + "Box"; |
---|
1229 | } else if (jQuery("img").length > 0) { |
---|
1230 | Type_Img = "img_autre"; |
---|
1231 | return; |
---|
1232 | } else { |
---|
1233 | return; |
---|
1234 | } |
---|
1235 | // jQuery(Parent + " p:not(:contains(' ')) ").remove(); |
---|
1236 | // jQuery(Parent + " p:(:contains('')) ").remove(); |
---|
1237 | llgboframe = jQuery("#gbo").infos(); |
---|
1238 | marges_llgbo = 0; |
---|
1239 | |
---|
1240 | if (llgboframe.height > 0) { |
---|
1241 | |
---|
1242 | ll1 = jQuery("#gbo div:first").infos(); |
---|
1243 | ll2 = jQuery("#gbo div:last").infos(); ; |
---|
1244 | ll1 = ll1.width; |
---|
1245 | ll2 = ll2.width - ll2.borderwidth.left - ll2.borderwidth.right; |
---|
1246 | marges_llgbo = (ll1 - ll2); |
---|
1247 | |
---|
1248 | } |
---|
1249 | |
---|
1250 | Bandeau_t = Info_entete(Parent) |
---|
1251 | Bandeau = Bandeau_t.img_top; |
---|
1252 | |
---|
1253 | info_theImgContainer = jQuery("#" + "theImgContainer").infos(); |
---|
1254 | info_description = jQuery("#" + "description").infos(); |
---|
1255 | //============================================================================= |
---|
1256 | // jQuery(Parent + " p").css({ padding: "0px", margin: "0px " }); |
---|
1257 | if (theme.match(RegExp("simple", "gi"))) { |
---|
1258 | jQuery(Parent).css({ padding: "0px", |
---|
1259 | marginLeft: "0px", |
---|
1260 | marginRight: "auto", |
---|
1261 | marginTop: "0px", |
---|
1262 | marginBottom: "0px" |
---|
1263 | |
---|
1264 | }); |
---|
1265 | } |
---|
1266 | |
---|
1267 | |
---|
1268 | if (theme.match(RegExp("luciano", "g"))) { |
---|
1269 | jQuery("#imageContainer").css({ height: "auto" }); |
---|
1270 | TheImg = jQuery(Parent + " #theImg img"); |
---|
1271 | info_img = jQuery(TheImg).infos(); |
---|
1272 | |
---|
1273 | |
---|
1274 | } else if (Type_Img == "map") { |
---|
1275 | |
---|
1276 | info_map = jQuery("#mapPicture").infos(); |
---|
1277 | marge_left = info_map.width; |
---|
1278 | |
---|
1279 | jQuery("#map").css({ left: marge_left + "px", padding: "0px", |
---|
1280 | marginLeft: "0px", |
---|
1281 | marginRight: "4px", |
---|
1282 | marginTop: "0px", |
---|
1283 | marginBottom: "0px", position: "relative" |
---|
1284 | }); |
---|
1285 | |
---|
1286 | TheImg = jQuery("#map"); |
---|
1287 | info_img = jQuery(TheImg).infos(); |
---|
1288 | |
---|
1289 | |
---|
1290 | } else if (jQuery("#charlie").length > 0) { |
---|
1291 | |
---|
1292 | jQuery("#charlie").css({ padding: "0px" |
---|
1293 | |
---|
1294 | }); |
---|
1295 | TheImg = jQuery("#charlie") |
---|
1296 | info_img = jQuery(TheImg).infos(); |
---|
1297 | |
---|
1298 | |
---|
1299 | |
---|
1300 | } else if (jQuery(Parent + " embed").length > 0) { |
---|
1301 | |
---|
1302 | TheImg = jQuery(Parent + " embed"); |
---|
1303 | info_img = jQuery(TheImg).infos(); |
---|
1304 | |
---|
1305 | |
---|
1306 | |
---|
1307 | } else if (Type_Img == "pamoorama") { |
---|
1308 | if (!nopano) { |
---|
1309 | Wait_pamoorama(); |
---|
1310 | return |
---|
1311 | } |
---|
1312 | TheImg = jQuery("#pamoorama"); |
---|
1313 | info_img = jQuery(TheImg).infos(); |
---|
1314 | info_footer = jQuery("#pamoorama_footer").infos(); |
---|
1315 | info_img.height = parseInt(img_reelle.height) + parseInt(info_footer.height); |
---|
1316 | |
---|
1317 | } else { |
---|
1318 | TheImg = jQuery(Parent + " img"); |
---|
1319 | |
---|
1320 | TheImg = Get_Img_Maxi(TheImg); |
---|
1321 | if (!TheImg) TheImg = jQuery(Parent); // sans img ?? |
---|
1322 | info_img = jQuery(TheImg).infos(); |
---|
1323 | } |
---|
1324 | //===================================================================================== |
---|
1325 | |
---|
1326 | switch (info_img.position) { |
---|
1327 | case "relative": |
---|
1328 | break; |
---|
1329 | case "static": |
---|
1330 | break; |
---|
1331 | case "absolute": |
---|
1332 | break; |
---|
1333 | case "": |
---|
1334 | break; |
---|
1335 | default: |
---|
1336 | break; |
---|
1337 | } |
---|
1338 | |
---|
1339 | info_description.marge = { |
---|
1340 | bottom: info_img.padding.bottom + info_img.margin.bottom + info_img.borderwidth.bottom, |
---|
1341 | top: info_img.padding.top + info_img.borderwidth.top + info_img.margin.top |
---|
1342 | } |
---|
1343 | |
---|
1344 | |
---|
1345 | if (llgboframe.height > 0) info_img = llgboframe; // format de l'image+largeur du cadre |
---|
1346 | |
---|
1347 | if (theme.match(RegExp("luciano", "g"))) { |
---|
1348 | |
---|
1349 | info_theImgContainer = jQuery("#imageContainer").infos(); |
---|
1350 | info_description.bottom = jQuery("#imageInfo").infos().top; |
---|
1351 | info_description.top = info_theImgContainer.bottom; |
---|
1352 | Info_slidshowToolBar = jQuery("#slidshowToolBar").infos(); |
---|
1353 | |
---|
1354 | if (Info_slidshowToolBar.height > 0) { |
---|
1355 | correction = (Info_slidshowToolBar.height); |
---|
1356 | info_description.top = info_img.bottom; |
---|
1357 | info_description.bottom = jQuery("#copyright").infos().top; |
---|
1358 | } |
---|
1359 | |
---|
1360 | //========================================================= |
---|
1361 | } else if (theme.match(RegExp("stripped", "gi"))) { |
---|
1362 | |
---|
1363 | if (options.imageAutosizeTitle == false) { |
---|
1364 | info_description.top = info_theImageAndTitle.bottom + |
---|
1365 | info_theImageAndTitle.margin.bottom + |
---|
1366 | info_theImageAndTitle.margin.top; |
---|
1367 | |
---|
1368 | info_description.bottom = info_theImageAndTitle.bottom + |
---|
1369 | info_description.borderwidth.top + |
---|
1370 | info_description.borderwidth.bottom + |
---|
1371 | (marges_llgbo / 2); |
---|
1372 | |
---|
1373 | } else { |
---|
1374 | info_description.top = info_theImageBox.bottom + |
---|
1375 | info_theImageAndTitle.margin.bottom + |
---|
1376 | info_theImageAndTitle.margin.top; |
---|
1377 | info_description.bottom = info_theImageAndTitle.bottom + |
---|
1378 | info_description.borderwidth.top + |
---|
1379 | info_description.borderwidth.bottom ; |
---|
1380 | |
---|
1381 | }; |
---|
1382 | check_desc_v = true; |
---|
1383 | |
---|
1384 | } else { |
---|
1385 | info_description.bottom = info_theImage.bottom; |
---|
1386 | info_description.top = info_img.height + info_theImage.top; |
---|
1387 | // info_description.bottom -= info_img.top; |
---|
1388 | } |
---|
1389 | // if (msie == true) info_description.bottom -= 4; |
---|
1390 | |
---|
1391 | info_description.height = info_description.bottom - info_description.top; |
---|
1392 | |
---|
1393 | if (check_desc_v == false) { |
---|
1394 | info_description.height = 0; |
---|
1395 | } |
---|
1396 | |
---|
1397 | Debug_pos(); |
---|
1398 | |
---|
1399 | // cl_visible=false ; |
---|
1400 | return info_description; |
---|
1401 | } |
---|
1402 | |
---|
1403 | //==================================================== |
---|
1404 | function Debug_info(index, infos, nom) { |
---|
1405 | |
---|
1406 | if (infos.height > 0) { |
---|
1407 | |
---|
1408 | message = browser.browser + " -- > Info : " + nom + " " + infos.id + "\n" + |
---|
1409 | "Info nodeName: " + infos.nodeName + "\n" + |
---|
1410 | "Info width: " + infos.width + "\n" + |
---|
1411 | "Info height: " + infos.height + "\n" + |
---|
1412 | "Info top: " + infos.top + "\n" + |
---|
1413 | "Info left: " + infos.left + "\n" + |
---|
1414 | "Info position: " + infos.position + "\n"; |
---|
1415 | |
---|
1416 | myDebug = { id: "Debug" + index, texte: message, |
---|
1417 | css: { |
---|
1418 | color: "black", |
---|
1419 | opacity: "0.5", |
---|
1420 | position: "absolute", |
---|
1421 | height: infos.height || 100 + "px", |
---|
1422 | width: infos.width || 300 + "px", |
---|
1423 | left: infos.left || 0 + "px", |
---|
1424 | border: "solid 1px green", |
---|
1425 | top: infos.top + "px" |
---|
1426 | |
---|
1427 | } |
---|
1428 | } |
---|
1429 | return myDebug; |
---|
1430 | } else { |
---|
1431 | return null; |
---|
1432 | } |
---|
1433 | |
---|
1434 | |
---|
1435 | } |
---|
1436 | //==================================================== |
---|
1437 | function Debug_pos() { |
---|
1438 | if (DEBUG == "true") { |
---|
1439 | |
---|
1440 | jQuery("[id ^='Debug']").show(); |
---|
1441 | /* |
---|
1442 | Debug2 background-color:yellow |
---|
1443 | Debug3 background-color:blue |
---|
1444 | Debug4 background-color:green |
---|
1445 | Debug5 background-color:red |
---|
1446 | |
---|
1447 | */ |
---|
1448 | |
---|
1449 | affiche_debug({ |
---|
1450 | Debug1: Debug_info(1, Bandeau_t, "Bandeau_t"), |
---|
1451 | Debug4: Debug_info(4, info_description, "info_description"), |
---|
1452 | Debug5: Debug_info(5, info_img, "info_img") |
---|
1453 | }); |
---|
1454 | } |
---|
1455 | } |
---|
1456 | |
---|
1457 | function affiche_debug(aff_infos) { |
---|
1458 | jQuery(jQuery("[id ^='Debug']")).each(function (i) { |
---|
1459 | if (aff_infos[this.id]) { |
---|
1460 | if (aff_infos[this.id].css) { |
---|
1461 | jQuery("#" + this.id).css(aff_infos[this.id].css); |
---|
1462 | jQuery("#" + this.id).text(aff_infos[this.id].texte); |
---|
1463 | } |
---|
1464 | } |
---|
1465 | }); |
---|
1466 | return; |
---|
1467 | |
---|
1468 | } |
---|
1469 | |
---|
1470 | |
---|
1471 | jQuery(function () { |
---|
1472 | jQuery('#pamoorama').live('ON', function (e) { |
---|
1473 | jQuery(jQuery('.debug').get(1)).trigger('ON'); |
---|
1474 | Bandeau_bas = Info_Description_f(Parent); |
---|
1475 | Bandeau = Bandeau_bas.top; |
---|
1476 | old_window = { width: 0, height: 0 }; |
---|
1477 | Wait_Affichage(); |
---|
1478 | }); |
---|
1479 | |
---|
1480 | jQuery(Parent).live('ON', function (e) { |
---|
1481 | jQuery(jQuery('.debug').get(1)).trigger('ON'); |
---|
1482 | Wait_Affichage(); |
---|
1483 | }); |
---|
1484 | |
---|
1485 | // Custom Event, ON to turn on a debug. |
---|
1486 | jQuery('.debug').live('ON', function (e) { |
---|
1487 | |
---|
1488 | jQuery('.debug').trigger('OFF'); |
---|
1489 | jQuery(this).addClass('debugOn'); |
---|
1490 | }); |
---|
1491 | |
---|
1492 | // On Click = debugs On |
---|
1493 | jQuery('.debug').live('click', function (e) { |
---|
1494 | |
---|
1495 | jQuery(this).trigger('ON'); |
---|
1496 | }); |
---|
1497 | |
---|
1498 | // Custom Event, Turn off a debug |
---|
1499 | jQuery('.debug').live('OFF', function (e) { |
---|
1500 | |
---|
1501 | jQuery(this).removeClass('debugOn'); |
---|
1502 | }); |
---|
1503 | |
---|
1504 | // on Double Click, remove the debug from the DOM |
---|
1505 | jQuery('.debug').live('dblclick', function () { |
---|
1506 | |
---|
1507 | jQuery(this).fadeOut(function () { $(this).remove() }); |
---|
1508 | }); |
---|
1509 | |
---|
1510 | // Add another debug to the DOM |
---|
1511 | jQuery('#adddebugs').click(function () { |
---|
1512 | jQuery('<div></div>') |
---|
1513 | .addClass('debug') |
---|
1514 | .appendTo('#debugsContainer'); |
---|
1515 | }); |
---|
1516 | |
---|
1517 | // Add 10 testing debugs to start with |
---|
1518 | jQuery(window).load(function () { |
---|
1519 | DEBUG = (typeof DEBUG != "undefined") ? DEBUG : "false"; |
---|
1520 | if (DEBUG == "true") { |
---|
1521 | for (var i = 0; i < 10; i++) { |
---|
1522 | jQuery('#adddebugs').click(); |
---|
1523 | } |
---|
1524 | jQuery(jQuery('.debug').get(8)).click(); |
---|
1525 | |
---|
1526 | } |
---|
1527 | }); //on load |
---|
1528 | }); |
---|