1 | /* |
---|
2 | var thumbnail= '{$thumbnail}'; |
---|
3 | var theme = '{$theme}'; |
---|
4 | var version = '{$version}'; |
---|
5 | var scaled_width = '{$SCALED_WIDTH}'; // valeur par defaut |
---|
6 | var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut |
---|
7 | var img_width = '{$IMG_WIDTH }'; |
---|
8 | var img_height = '{ $IMG_HEIGHT }';$picture['current']['height'] |
---|
9 | |
---|
10 | var marge_basse = '{ $MARGE_BASSE }'; |
---|
11 | var echelle_max = '{ $ECHELLE_MAX }'; |
---|
12 | var mini_width = '{ $MINI_WIDTH }'; |
---|
13 | var mini_height = '{ $MINI_HEIGHT }'; |
---|
14 | |
---|
15 | var webmaster_width = '{$webmaster_width }'; |
---|
16 | var webmaster_height = '{ $webmaster_height }'; |
---|
17 | var admin_width = '{ $admin_width }'; |
---|
18 | var admin_height = '{ $admin_height }'; |
---|
19 | var generic_width = '{ $generic_width }'; |
---|
20 | var generic_height = '{ $generic_height }'; |
---|
21 | var guest_width = '{ $guest_width }'; |
---|
22 | var guest_height = '{$guest_height}'; |
---|
23 | var normal_width = '{$normal_width}'; |
---|
24 | var normal_height = '{$normal_height}'; |
---|
25 | var user_status = '{$user_status}'; |
---|
26 | var user_status = '{$user_status}'; |
---|
27 | var check_auto_w = '{$check_auto_w}'; |
---|
28 | var check_desc_v = '{$check_desc_v}'; |
---|
29 | */ |
---|
30 | |
---|
31 | |
---|
32 | var img_top = "0"; |
---|
33 | var cl_visible = true; |
---|
34 | |
---|
35 | function Toggle_bp() |
---|
36 | { |
---|
37 | cl_visible = !cl_visible ; |
---|
38 | if (cl_visible) src=src1 ; |
---|
39 | else src=src2 ; |
---|
40 | if (cl_visible) src_info=src3 ; |
---|
41 | else src_info=src4 ; |
---|
42 | |
---|
43 | jQuery('#bp_cla').attr('alt',src_info); |
---|
44 | jQuery('#bp_cla').attr('title', src_info); |
---|
45 | |
---|
46 | jQuery('#bp_img_cla').get(0).src=src ; |
---|
47 | jQuery('#bp_img_cla').attr('alt',src_info); |
---|
48 | jQuery('#bp_img_cla').attr('title',src_info); |
---|
49 | jQuery('#bp_cla').attr('Stitle', src_info); |
---|
50 | jQuery('#bp_cla').attr('Stip'," "); |
---|
51 | old_w = 0; |
---|
52 | jQuery(window).resize(); |
---|
53 | } |
---|
54 | //========================================================= |
---|
55 | var old_w = 0; |
---|
56 | function wait_Timer() { |
---|
57 | old_w = 0 |
---|
58 | jQuery(window).resize(); |
---|
59 | info_pamoorama_outter = jQuery("#pamoorama_outter").info(); |
---|
60 | if (info_pamoorama_outter.width == 0) |
---|
61 | setTimeout("wait_Timer()", 100); |
---|
62 | |
---|
63 | } |
---|
64 | |
---|
65 | |
---|
66 | |
---|
67 | function cl_Timer() { |
---|
68 | // if (!jQuery.browser.msie) { jQuery(function () { alert(jQuery.browser.version); }); } |
---|
69 | if (jQuery.browser.msie && parseInt(jQuery.browser.version) < 8) |
---|
70 | alert(jQuery.browser.version); |
---|
71 | panoramaContainer = jQuery(".panorama-container"); |
---|
72 | n = document.scripts[6];//12--14affiche_script ; |
---|
73 | t = n.src; |
---|
74 | |
---|
75 | currentPosition = 0 - parseInt(jQuery(panoramaContainer).css('margin-left')); |
---|
76 | if ( currentPosition == NaN) return; |
---|
77 | |
---|
78 | |
---|
79 | if (currentPosition > 1000) |
---|
80 | jQuery(panoramaContainer).css('margin-left',"0px") |
---|
81 | setTimeout("cl_Timer()", 500); |
---|
82 | } |
---|
83 | function onPropertyChange(e) { |
---|
84 | var el = e.srcElement; |
---|
85 | var new_class=el.className ; |
---|
86 | ID = el.id; |
---|
87 | Prop = e.propertyName.split("."); |
---|
88 | Property = Prop[1]; |
---|
89 | if (Property == "display") { |
---|
90 | Valeur = parseInt(el.currentStyle[Property]); |
---|
91 | if (Valeur=="block"){ |
---|
92 | |
---|
93 | |
---|
94 | } |
---|
95 | } |
---|
96 | return; |
---|
97 | } |
---|
98 | |
---|
99 | /* ready |
---|
100 | * |
---|
101 | * |
---|
102 | */ |
---|
103 | //============================================================ |
---|
104 | /* |
---|
105 | * |
---|
106 | */ |
---|
107 | function Info_entete(Parent) { |
---|
108 | |
---|
109 | var Info_the_page = jQuery("#the_page").info(); |
---|
110 | var Zone_Affichage = jQuery("#theImage").info(); |
---|
111 | var info_theHeader = jQuery("#theHeader").info(); |
---|
112 | // image top gallycuise :165 |
---|
113 | var info_imageToolBar = jQuery("#imageToolBar").info(); |
---|
114 | |
---|
115 | if (Zone_Affichage.position =="absolute") { |
---|
116 | var Bandeau = Zone_Affichage.top - |
---|
117 | (Info_the_page.top + |
---|
118 | Get_Val_int(Info_the_page.borderwidth.top) + |
---|
119 | Get_Val_int(Zone_Affichage.borderwidth.top)); |
---|
120 | |
---|
121 | Bandeau = Zone_Affichage.top; |
---|
122 | } else { |
---|
123 | var Bandeau = Zone_Affichage.top + |
---|
124 | Get_Val_int(info_imageToolBar.margin.bottom) + |
---|
125 | Get_Val_int(info_imageToolBar.margin.top) + |
---|
126 | Info_the_page.top + |
---|
127 | Get_Val_int(Info_the_page.borderwidth.top) + |
---|
128 | Get_Val_int(Zone_Affichage.borderwidth.top); |
---|
129 | } |
---|
130 | |
---|
131 | if (Info_the_page.top == 0) |
---|
132 | if (theme.match(RegExp('lazuli','g'))) |
---|
133 | Bandeau += info_imageToolBar.bottom; |
---|
134 | else |
---|
135 | Bandeau = info_imageToolBar.bottom + |
---|
136 | Get_Val_int(Info_the_page.borderwidth.top) + |
---|
137 | Get_Val_int(Zone_Affichage.borderwidth.top); |
---|
138 | var Bandeau_t = Info_the_page.top + |
---|
139 | Get_Val_int(Info_the_page.borderwidth.top) + |
---|
140 | Get_Val_int(Zone_Affichage.borderwidth.top) |
---|
141 | ; |
---|
142 | |
---|
143 | return { marge_top: Bandeau_t, img_top: Bandeau }; |
---|
144 | |
---|
145 | } |
---|
146 | |
---|
147 | /* Récupère les informations sur la description. |
---|
148 | * |
---|
149 | */ |
---|
150 | function Info_description(Parent) { |
---|
151 | |
---|
152 | // jQuery("#theImage br").remove(); |
---|
153 | // jQuery("#theImage br").css("lineHeight", "2px"); |
---|
154 | var inter_ligne = Get_Val_int(jQuery("#" + Parent + " p").css("lineHeight")); |
---|
155 | var info_description = jQuery("#" + Parent + " ").info(); |
---|
156 | jQuery("#" + Parent).css({ marginLeft: "auto", marginRight: "auto" }); |
---|
157 | |
---|
158 | var info_container = jQuery("#theImgContainer").info(); |
---|
159 | jQuery("#theImgContainer").css("margin", "auto"); |
---|
160 | |
---|
161 | |
---|
162 | jQuery("#" + Parent + " p:not(:contains(' ')) ").remove(); |
---|
163 | |
---|
164 | jQuery("#" + Parent).css({ border: "solid 15px yellow" }); |
---|
165 | jQuery("#" + Parent + " p:not(:contains(' ')) ").css("backgroundColor", "red"); |
---|
166 | jQuery("#" + Parent + " table:contains('claude')").css("backgroundColor", "green"); |
---|
167 | |
---|
168 | var Description = jQuery("#" + Parent + " >*"); |
---|
169 | jQuery(Description).each( |
---|
170 | |
---|
171 | function (i) { |
---|
172 | |
---|
173 | |
---|
174 | t = jQuery(this).text(); |
---|
175 | t = jQuery.trim(t); |
---|
176 | pr = jQuery(this).parent().get(0).id; |
---|
177 | n = this.nodeName; |
---|
178 | infos = jQuery(this).info(); |
---|
179 | |
---|
180 | if (t == "") { |
---|
181 | if (this.nodeName == "IMG") { |
---|
182 | info_description.top = infos.bottom - Get_Val_int(infos.margin.top) + inter_ligne; |
---|
183 | info_description.bottom = infos.bottom + Get_Val_int(infos.margin.bottom); |
---|
184 | } |
---|
185 | else if (this.nodeName == "P" || this.nodeName == "BR") { |
---|
186 | jQuery(this).remove(); |
---|
187 | } else { |
---|
188 | jQuery(this).css("border", "solid 3px GREEN"); |
---|
189 | info_description.top = infos.bottom - Get_Val_int(infos.margin.top); |
---|
190 | info_description.bottom = infos.bottom + Get_Val_int(infos.margin.bottom); |
---|
191 | } |
---|
192 | } else { |
---|
193 | if (this.nodeName == "TABLE") { |
---|
194 | jQuery(this).css("border", "solid 10px transparent"); |
---|
195 | info_description.bottom = infos.bottom + Get_Val_int(infos.margin.bottom); |
---|
196 | } else { |
---|
197 | jQuery(this).css("border", "solid 2px transparent"); |
---|
198 | info_description.bottom = infos.bottom + Get_Val_int(infos.margin.bottom); |
---|
199 | } |
---|
200 | } |
---|
201 | |
---|
202 | |
---|
203 | |
---|
204 | |
---|
205 | }); |
---|
206 | |
---|
207 | |
---|
208 | info_licencetag = jQuery(".licencetag").info(); |
---|
209 | if (info_licencetag.bottom > info_description.bottom) { |
---|
210 | jQuery(".licencetag").css("border", "solid 2px blue"); |
---|
211 | info_description.bottom = info_licencetag.bottom ; |
---|
212 | |
---|
213 | } |
---|
214 | |
---|
215 | if (info_description.top < 1) |
---|
216 | info_description.top = info_description.bottom; |
---|
217 | |
---|
218 | |
---|
219 | var Info_the_page = jQuery("#the_page").info(); |
---|
220 | var Bandeau_t = Info_entete(Parent); |
---|
221 | |
---|
222 | if (info_description.bottom < info_description.top) |
---|
223 | info_description.bottom = info_description.top = 1; |
---|
224 | |
---|
225 | info_description.top += Bandeau_t.marge_top ; |
---|
226 | info_description.bottom += Info_the_page.top; |
---|
227 | |
---|
228 | info_theImg = jQuery("#" + Parent).info(); |
---|
229 | info_description.bottom += Get_Val_int(info_theImg.borderwidth.bottom); |
---|
230 | info_description.bottom += Get_Val_int(info_theImg.borderwidth.top); |
---|
231 | |
---|
232 | info_description.height = info_description.bottom - info_description.top ; |
---|
233 | |
---|
234 | if (check_desc_v != 'checked="checked"') { |
---|
235 | info_description.height = 0; |
---|
236 | } |
---|
237 | |
---|
238 | return info_description; |
---|
239 | |
---|
240 | } |
---|
241 | /* |
---|
242 | * Get_val_int |
---|
243 | * params: element,valeur maxi |
---|
244 | * return: valeur entiere |
---|
245 | */ |
---|
246 | function Get_Val_int(myObj, Maxi_val, Obj) { |
---|
247 | var val = 0; |
---|
248 | var reg1 = new RegExp("%", "g") |
---|
249 | Maxi_val = parseInt(Maxi_val || "0"); |
---|
250 | |
---|
251 | /* |
---|
252 | - numérique suivie de px ou % ou pt ou em, |
---|
253 | - thin, bordure mince, |
---|
254 | - medium, bordure moyenne (valeur par défaut), |
---|
255 | - thick, bordure épaisse, |
---|
256 | - inherit, hérite de son parent (css2). |
---|
257 | */ |
---|
258 | |
---|
259 | if (!myObj) { |
---|
260 | return Maxi_val; |
---|
261 | } |
---|
262 | if (typeof (myObj) == "string") { |
---|
263 | switch (myObj) { |
---|
264 | case 'thin': |
---|
265 | return 1; |
---|
266 | break; |
---|
267 | case 'medium': |
---|
268 | return 2; |
---|
269 | break; |
---|
270 | case 'thick': |
---|
271 | return 4; |
---|
272 | break; |
---|
273 | case 'inherit': |
---|
274 | |
---|
275 | |
---|
276 | break; |
---|
277 | |
---|
278 | default: |
---|
279 | |
---|
280 | |
---|
281 | break; |
---|
282 | } |
---|
283 | |
---|
284 | |
---|
285 | |
---|
286 | if (myObj == "none") return Maxi_val; |
---|
287 | if (myObj == "auto") return Maxi_val; |
---|
288 | |
---|
289 | if (myObj.match(reg1)) val = myObj * Maxi_val / 100; |
---|
290 | val = parseInt(myObj); |
---|
291 | |
---|
292 | } else |
---|
293 | val = parseInt(myObj); |
---|
294 | |
---|
295 | |
---|
296 | if (typeof (val) == "NaN") return Maxi_val; |
---|
297 | return val; |
---|
298 | } |
---|
299 | |
---|
300 | /* |
---|
301 | * |
---|
302 | */ |
---|
303 | jQuery("#pamoorama_iner").bind('resize', function () { |
---|
304 | wait_Timer(); |
---|
305 | }) |
---|
306 | //============================================================//== |
---|
307 | jQuery("#pamoorama_outter").bind('resize', function () { |
---|
308 | wait_Timer(); |
---|
309 | }) |
---|
310 | |
---|
311 | |
---|
312 | |
---|
313 | //============================================================ |
---|
314 | jQuery("#iGMapsIcon").bind('resize', function () { |
---|
315 | jQuery().recentrage_widget(); |
---|
316 | }) |
---|
317 | |
---|
318 | |
---|
319 | jQuery(document).ready( |
---|
320 | function (jQuery) { |
---|
321 | /* jQuery */ |
---|
322 | var img_init = { height: img_height, width: img_width }; // taille initiale |
---|
323 | var img_defaut = { height: scaled_height, width: scaled_width }; |
---|
324 | var img_reelle = { height: img_height, width: img_width }; |
---|
325 | var img_finale = { height: 0, width: 0 }; |
---|
326 | var zone_affichage = { height: 0, width: 0 }; |
---|
327 | |
---|
328 | //============================================================ |
---|
329 | |
---|
330 | var Info_the_page = jQuery("#the_page").info(); |
---|
331 | var Zone_Affichage = jQuery("#theImage").info(); |
---|
332 | |
---|
333 | |
---|
334 | |
---|
335 | var Bandeau_bas = Info_description("theImage"); |
---|
336 | var Bandeau = Info_entete("theImage").img_top; |
---|
337 | |
---|
338 | var init_taille_thumblink = { height: 0, width: 0 }; |
---|
339 | if (init_taille_thumblink.height == 0) |
---|
340 | init_taille_thumblink = { |
---|
341 | height: jQuery(".thumbLink").height(), |
---|
342 | width: jQuery(".thumbLink").width() |
---|
343 | }; |
---|
344 | //=================================================================== |
---|
345 | |
---|
346 | var old_h = 0; |
---|
347 | var rapport = -1; |
---|
348 | |
---|
349 | |
---|
350 | /* |
---|
351 | * window .resize |
---|
352 | */ |
---|
353 | jQuery(window).resize(function (event, ui) { |
---|
354 | if (typeof (event) == 'undefined') return; |
---|
355 | if (!cl_visible) return; |
---|
356 | |
---|
357 | //========================================================================== |
---|
358 | var winwidth = jQuery(window).width(); |
---|
359 | var winheight = jQuery(window).height(); |
---|
360 | if (old_w == winwidth && old_h == winheight) return; |
---|
361 | |
---|
362 | /* |
---|
363 | * recherche la plus grande image (hauteur ou largeur) |
---|
364 | */ |
---|
365 | |
---|
366 | |
---|
367 | function Get_Img_Maxi(myobj) { |
---|
368 | var w00 = 0; |
---|
369 | var TheImg = null; |
---|
370 | jQuery(myobj).each(function (i) { |
---|
371 | w0 = img_reelle.width; |
---|
372 | h0 = img_reelle.height; |
---|
373 | if (h0 > w0) w0 = h0; |
---|
374 | if (w0 > w00) { |
---|
375 | if (!this.src.match(RegExp(".png", "g"))) |
---|
376 | if (!this.src.match(RegExp(thumbnail, "g"))) { |
---|
377 | TheImg = this; |
---|
378 | w00 = w0; |
---|
379 | } |
---|
380 | |
---|
381 | } |
---|
382 | }); |
---|
383 | return TheImg; |
---|
384 | } |
---|
385 | |
---|
386 | if (old_w != winwidth) |
---|
387 | { old_w = winwidth; } |
---|
388 | else |
---|
389 | { if (old_h != winheight) old_h = winheight; } |
---|
390 | //=========================================================================== |
---|
391 | |
---|
392 | |
---|
393 | Cadre = jQuery("#theImage").get(0); |
---|
394 | |
---|
395 | //=============== Information cadre ====== |
---|
396 | var info_the_page = jQuery("#the_page").info(); |
---|
397 | |
---|
398 | //============================================================================= |
---|
399 | var info_HeaderBar = jQuery("#imageHeaderBar").info(); |
---|
400 | var info_imageInfoBar = jQuery("#imageInfoBar").info(); |
---|
401 | var info_content = jQuery("#content").info(); |
---|
402 | var info_ToolBar = jQuery("#imageToolBar").info(); |
---|
403 | |
---|
404 | var info_titrePage = jQuery("#titrePage").info(); |
---|
405 | |
---|
406 | var info_the_page = jQuery("#the_page").info(); |
---|
407 | var zone_affichage = jQuery("#theImage").info(); |
---|
408 | |
---|
409 | |
---|
410 | var Type_Img = ""; |
---|
411 | //====== détection du type d'images ====== |
---|
412 | if (jQuery("#charlie").length > 0) { |
---|
413 | Type_Img = "charlie"; |
---|
414 | } else if (jQuery("#pamoorama").length) { |
---|
415 | Type_Img = "pamoorama"; |
---|
416 | } else if (jQuery("#theImage embed").length > 0) { |
---|
417 | Type_Img = "embed"; |
---|
418 | } else if (jQuery("#map").length) { |
---|
419 | Type_Img = "map"; |
---|
420 | } else if (jQuery("#Panorama").length) { |
---|
421 | Type_Img = "panorama"; |
---|
422 | } else if (jQuery(Cadre).find("img").length > 0) { |
---|
423 | Type_Img = "img"; |
---|
424 | } else if (jQuery("img").length > 0) { |
---|
425 | Type_Img = "img_autre"; |
---|
426 | return; |
---|
427 | } else { |
---|
428 | return; |
---|
429 | } |
---|
430 | |
---|
431 | |
---|
432 | |
---|
433 | var info_Cadre = jQuery(Cadre).info(); |
---|
434 | |
---|
435 | |
---|
436 | if (info_Cadre.position != "static") { |
---|
437 | /* Si LLGBO met le cadre en relative */ |
---|
438 | if (theme.match(RegExp("gally", "g"))) { |
---|
439 | //--- passage absolute ==> static ===/ |
---|
440 | jQuery(Cadre).css("position", "static"); |
---|
441 | info_Cadre = jQuery(Cadre).info(); |
---|
442 | |
---|
443 | } |
---|
444 | } |
---|
445 | |
---|
446 | jQuery("#imageToolBar").css("position", "relative"); |
---|
447 | jQuery("#imageHeaderBar").css("position", "relative"); |
---|
448 | jQuery("#imageToolBar").css("top", 0 + "px"); |
---|
449 | jQuery("#imageHeaderBar").css("top", "0px"); |
---|
450 | |
---|
451 | |
---|
452 | var marge_right = 0; |
---|
453 | var marge_left = 0; |
---|
454 | if (info_content.width > 100) { |
---|
455 | marge_right = Get_Val_int(info_imageInfoBar.margin.left) + Get_Val_int(info_imageInfoBar.margin.right); |
---|
456 | winwidth = info_content.width; |
---|
457 | marge_right = info_imageInfoBar.width + marge_right; |
---|
458 | } |
---|
459 | else |
---|
460 | winwidth = info_ToolBar.width - 2; |
---|
461 | |
---|
462 | winwidth -= Get_Val_int(info_Cadre.borderwidth.right); |
---|
463 | winwidth -= Get_Val_int(info_Cadre.borderwidth.left); |
---|
464 | |
---|
465 | // var marge_top = info_ToolBar.top + info_ToolBar.height; |
---|
466 | |
---|
467 | //====================================================================== |
---|
468 | info_theHeader = jQuery("#theHeader").info(); |
---|
469 | // var marge_top =info_theHeader.bottom + info_HeaderBar.height+ info_ToolBar.height; //145 |
---|
470 | var marge_top = info_HeaderBar.bottom + info_ToolBar.height; //145 |
---|
471 | if (Type_Img == "pamoorama") { |
---|
472 | var info_pamoorama = jQuery("#pamoorama").info(); |
---|
473 | var info_pamoorama_outter = jQuery("#pamoorama_outter").info(); |
---|
474 | var info_pamoorama_inner = jQuery("#pamoorama_inner").info(); |
---|
475 | var info_pamoorama_footer = jQuery("#pamoorama_footer").info(); |
---|
476 | TheImg = jQuery("#pamoorama"); |
---|
477 | |
---|
478 | /* |
---|
479 | pamoorama_outter |
---|
480 | pamoorama_inner |
---|
481 | pamoorama_footer |
---|
482 | pamoorama_caption |
---|
483 | pamoorama_thumb |
---|
484 | pamoorama_frame |
---|
485 | */ |
---|
486 | } else { |
---|
487 | //==== récupère Img la plus grande ===== |
---|
488 | if (jQuery("#theImg")) IMG = "#theImg"; |
---|
489 | else IMG = Cadre; |
---|
490 | |
---|
491 | TheImg2 = Get_Img_Maxi(IMG + " img"); |
---|
492 | //================================================================= |
---|
493 | if (TheImg2 == null) { |
---|
494 | if (jQuery(Cadre).find("img").length > 0) { |
---|
495 | IMG = Cadre; |
---|
496 | TheImg = Get_Img_Maxi("#theImage img"); |
---|
497 | } |
---|
498 | } else { |
---|
499 | TheImg = TheImg2 //luciano ? |
---|
500 | |
---|
501 | } |
---|
502 | } |
---|
503 | //================================================================= |
---|
504 | |
---|
505 | |
---|
506 | switch (Type_Img) { |
---|
507 | case "map": |
---|
508 | var info_image = jQuery("#map").info(); |
---|
509 | |
---|
510 | var info_map = jQuery("#mapPicture").info(); |
---|
511 | |
---|
512 | marge_left = info_map.width; |
---|
513 | jQuery("#map").css("left", marge_left); |
---|
514 | |
---|
515 | var TheImg = jQuery("#map").get(0); |
---|
516 | info_image = jQuery("#map").info(); |
---|
517 | |
---|
518 | |
---|
519 | pos_page = jQuery("#the_page").info(); |
---|
520 | ; |
---|
521 | |
---|
522 | break |
---|
523 | |
---|
524 | |
---|
525 | case "panorama": |
---|
526 | |
---|
527 | var w00 = 0; |
---|
528 | jQuery("#Panorama img").each(function (i) { |
---|
529 | w0 = this.width; |
---|
530 | if (w0 > w00) { |
---|
531 | TheImg = this; |
---|
532 | n = TheImg.nameProp; |
---|
533 | w00 = w0; |
---|
534 | } |
---|
535 | }); |
---|
536 | |
---|
537 | pos_image = jQuery(TheImg).info(); |
---|
538 | pos_page = jQuery("#the_page").info(); |
---|
539 | |
---|
540 | break |
---|
541 | case "img": |
---|
542 | |
---|
543 | if (!TheImg) return; |
---|
544 | pos_image = jQuery(TheImg).info(); |
---|
545 | pos_page = jQuery("#the_page").info(); |
---|
546 | |
---|
547 | |
---|
548 | break |
---|
549 | case "img_autre": |
---|
550 | if (!TheImg) return; |
---|
551 | pos_image = jQuery(TheImg).position(); |
---|
552 | pos_page = jQuery("#the_page").position(); |
---|
553 | |
---|
554 | |
---|
555 | break |
---|
556 | case "embed": |
---|
557 | // |
---|
558 | |
---|
559 | TheImg = jQuery(Cadre).find("embed"); |
---|
560 | |
---|
561 | pos_image = jQuery(Cadre).position(); |
---|
562 | pos_page = jQuery("#the_page").position(); |
---|
563 | if (rapport < 0) { |
---|
564 | img_height = parseInt(jQuery(TheImg).outerHeight()); |
---|
565 | img_width = parseInt(jQuery(TheImg).outerWidth()); |
---|
566 | |
---|
567 | img_reelle.height = img_height; |
---|
568 | img_reelle.width = img_width; |
---|
569 | |
---|
570 | } |
---|
571 | |
---|
572 | break |
---|
573 | case "charlie": |
---|
574 | |
---|
575 | TheImg = jQuery('#charlie object').get(0); |
---|
576 | pos_image = jQuery(Cadre).position(); |
---|
577 | pos_page = jQuery("#the_page").position(); |
---|
578 | if (rapport < 0) { |
---|
579 | img_height = parseInt(TheImg.height); |
---|
580 | img_width = parseInt(TheImg.width); |
---|
581 | |
---|
582 | img_reelle.height = parseInt(TheImg.height); |
---|
583 | img_reelle.width = parseInt(TheImg.width); |
---|
584 | } |
---|
585 | |
---|
586 | break |
---|
587 | case "pamoorama": |
---|
588 | //========================================================= |
---|
589 | var Images = jQuery("#pamoorama img"); |
---|
590 | var Image = jQuery("#pamoorama").find("img"); |
---|
591 | |
---|
592 | pos_image = jQuery("#pamoorama").info(); |
---|
593 | pos_page = jQuery("#the_page").info(); |
---|
594 | break |
---|
595 | |
---|
596 | |
---|
597 | } |
---|
598 | |
---|
599 | //=============== Vérification taille minimale autorizée ====================== |
---|
600 | miniWidth = Get_Val_int(jQuery(TheImg).css("min-width"), mini_width); |
---|
601 | miniHeight = Get_Val_int(jQuery(TheImg).css("min-height"), mini_height); |
---|
602 | |
---|
603 | |
---|
604 | maxWidth = Get_Val_int(jQuery(TheImg).css("max-width"), winwidth); |
---|
605 | maxHeight = Get_Val_int(jQuery(TheImg).css("max-height"), winheight); |
---|
606 | |
---|
607 | mini_width = parseInt(miniWidth); |
---|
608 | mini_height = parseInt(miniHeight); |
---|
609 | |
---|
610 | img_reelle.width = parseInt(img_reelle.width); |
---|
611 | |
---|
612 | |
---|
613 | if (img_reelle.width < mini_width) return; |
---|
614 | |
---|
615 | img_reelle.height = parseInt(img_reelle.height); |
---|
616 | if (img_reelle.height < parseInt(mini_height)) return; |
---|
617 | //================================================================================== |
---|
618 | if (rapport < 0) { |
---|
619 | |
---|
620 | img_init.height = parseInt(img_height); |
---|
621 | img_init.width = parseInt(img_width); |
---|
622 | |
---|
623 | rapport = img_width / img_height; |
---|
624 | |
---|
625 | if (Type_Img != "map") |
---|
626 | rapport = (img_init.width / img_init.height); |
---|
627 | else |
---|
628 | rapport = 0; |
---|
629 | |
---|
630 | } |
---|
631 | |
---|
632 | |
---|
633 | //=============== Zone d'affichage ============================ |
---|
634 | |
---|
635 | borderW = Get_Val_int(zone_affichage.borderwidth.left, 2); |
---|
636 | borderW += Get_Val_int(zone_affichage.borderwidth.right, 2); |
---|
637 | |
---|
638 | |
---|
639 | zone_affichage.width = winwidth - borderW; |
---|
640 | zone_affichage.height = winheight - marge_top; |
---|
641 | |
---|
642 | |
---|
643 | |
---|
644 | //=========================================================================== |
---|
645 | var sel0 = { top: 0 }; |
---|
646 | |
---|
647 | |
---|
648 | |
---|
649 | |
---|
650 | |
---|
651 | //================================================================================== |
---|
652 | jQuery("#theImage #theImg IMG").css("marginTop", "0px") |
---|
653 | |
---|
654 | var h = 15; |
---|
655 | if (theme.match(RegExp("sobre", "g"))) { |
---|
656 | h += 0; //?? |
---|
657 | } else if (theme.match(RegExp("Pure", "g"))) { |
---|
658 | h += 0; //?? |
---|
659 | } else if (theme.match(RegExp("luciano", "g"))) { |
---|
660 | h += 0; //?? |
---|
661 | } else if (theme.match(RegExp("simple", "g"))) { |
---|
662 | h += 0; //?? |
---|
663 | } else if (theme.match(RegExp("gally", "g"))) { |
---|
664 | h += 0; //?? |
---|
665 | |
---|
666 | } |
---|
667 | //================ Licence ======================== |
---|
668 | var Licence = jQuery(".licencetag"); |
---|
669 | if (Licence.length > 0) { |
---|
670 | jQuery(".licencetag").css("padding", "0px"); |
---|
671 | |
---|
672 | } |
---|
673 | //==================================================== |
---|
674 | info_img = jQuery(TheImg).info(); |
---|
675 | |
---|
676 | |
---|
677 | //========================================================================= |
---|
678 | img_top = Bandeau; |
---|
679 | //============ Padding image ? =============== |
---|
680 | |
---|
681 | img_padding_top = Get_Val_int(info_img.padding.top); |
---|
682 | img_padding_top += Get_Val_int(info_img.padding.bottom); |
---|
683 | img_padding_top += Get_Val_int(info_img.borderwidth.top); |
---|
684 | img_padding_top += Get_Val_int(info_img.borderwidth.bottom); |
---|
685 | |
---|
686 | margin_top = Get_Val_int(info_Cadre.margin.top); |
---|
687 | padding_top = Get_Val_int(info_Cadre.padding.top); |
---|
688 | padding_top += Get_Val_int(info_Cadre.padding.bottom); |
---|
689 | |
---|
690 | Marge_Basse = parseInt(marge_basse || 0); // hors bandeau |
---|
691 | //========================================================================== |
---|
692 | h = 0; |
---|
693 | zone_affichage.height = winheight - Bandeau - Marge_Basse - h - margin_top - padding_top; |
---|
694 | var Image_height = zone_affichage.height - Bandeau_bas.height - img_padding_top; |
---|
695 | var Delta = zone_affichage.height - Image_height; |
---|
696 | |
---|
697 | //============================================================= |
---|
698 | var height_user = eval(user_status + "_height"); |
---|
699 | |
---|
700 | |
---|
701 | var reg1 = new RegExp("%", "g"); |
---|
702 | if (height_user.match(reg1)) |
---|
703 | Image_height = Image_height * parseInt(height_user) / 100; |
---|
704 | else |
---|
705 | Image_height = parseInt(height_user); |
---|
706 | |
---|
707 | //============================================================ |
---|
708 | echelle_max = parseFloat(echelle_max, '3'); |
---|
709 | var echelle = parseFloat(Image_height / img_reelle.height, 3); |
---|
710 | |
---|
711 | if (echelle > echelle_max) { echelle = echelle_max; } |
---|
712 | Image_height = parseInt(img_reelle.height * echelle); |
---|
713 | |
---|
714 | var Image_width; |
---|
715 | if (rapport > 0) |
---|
716 | Image_width = parseInt(Image_height * rapport); |
---|
717 | |
---|
718 | else if (Type_Img == "map") { |
---|
719 | Image_width = zone_affichage.width - marge_left - marge_right; |
---|
720 | |
---|
721 | if (theme.match(RegExp("gally", "g"))) { |
---|
722 | // Image_height -= "30"; |
---|
723 | } |
---|
724 | |
---|
725 | } else { |
---|
726 | Image_width = zone_affichage.width; |
---|
727 | } |
---|
728 | |
---|
729 | //=============================================================== |
---|
730 | align_auto = "center"; |
---|
731 | if (jQuery("#theImg").css("textAlign")) |
---|
732 | align_auto = jQuery("#theImg").css("textAlign"); |
---|
733 | |
---|
734 | if (check_auto_w == 'checked="checked"') { |
---|
735 | // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) { |
---|
736 | //==== largeur à atteindre === |
---|
737 | var width_user = eval(user_status + "_width"); |
---|
738 | // Largeur maximale en fonction du statut |
---|
739 | if (width_user.match(reg1)) |
---|
740 | // pourcentage |
---|
741 | widthmin = maxWidth * parseInt(width_user) / 100; |
---|
742 | else |
---|
743 | widthmin = parseInt(width_user); |
---|
744 | |
---|
745 | if (Image_width > widthmin) { |
---|
746 | // Image_width largeur à atteindre |
---|
747 | // Calcul du rapport d'agrandissement |
---|
748 | var echelle_w = parseFloat(widthmin / img_reelle.width, 3); |
---|
749 | if (echelle_w > echelle_max) { echelle_w = echelle_max; } |
---|
750 | Image_width = parseInt(img_reelle.width * echelle_w); |
---|
751 | if (rapport > 0) |
---|
752 | Image_height = parseInt(Image_width / rapport); |
---|
753 | } |
---|
754 | |
---|
755 | |
---|
756 | |
---|
757 | } |
---|
758 | |
---|
759 | |
---|
760 | // } |
---|
761 | |
---|
762 | // zone_affichage.height = Image_height + Delta + info_pamoorama_footer.height; |
---|
763 | |
---|
764 | zoom = echelle; |
---|
765 | |
---|
766 | // zone_affichage.height *= zoom; |
---|
767 | // zone_affichage.width *= zoom; |
---|
768 | //=============LLGBO2 =========================== |
---|
769 | marges = 0; |
---|
770 | t1 = { top: 0 }; |
---|
771 | if (jQuery("#gbo") && jQuery("#gbo div:first").length > 0) { |
---|
772 | llgboframe = jQuery("#gbo div:first"); |
---|
773 | marges = jQuery(llgboframe).outerWidth() - jQuery("#gbo div:last").outerWidth(); |
---|
774 | |
---|
775 | m1 = jQuery(llgboframe).outerHeight(); |
---|
776 | t1 = jQuery(llgboframe).position(); |
---|
777 | |
---|
778 | |
---|
779 | if (TheImg.src) { |
---|
780 | marge_top = t1.top - img_top; |
---|
781 | Image_height -= marge_top; |
---|
782 | Image_width = Image_height * rapport; |
---|
783 | if ((winwidth) < Image_width) { |
---|
784 | _width = maxWidth; |
---|
785 | } else { |
---|
786 | _width = Image_width; |
---|
787 | } |
---|
788 | |
---|
789 | |
---|
790 | jQuery("#gbo").outerWidth(_width); |
---|
791 | jQuery("#gbo").outerHeight(Image_height); |
---|
792 | jQuery("#gbo").css("width", (_width) + "px"); |
---|
793 | jQuery("#gbo").css("height", (Image_height) + "px"); |
---|
794 | |
---|
795 | Image_height -= marges; |
---|
796 | Image_width -= marges; |
---|
797 | |
---|
798 | } else { |
---|
799 | |
---|
800 | jQuery("#gbo").width(zone_affichage.width - marges); |
---|
801 | jQuery("#gbo").height(Image_height + marges) |
---|
802 | jQuery("#gbo").css("width", zone_affichage.width - marges + "px"); |
---|
803 | jQuery("#gbo").css("height", Image_height - marges + "px") |
---|
804 | |
---|
805 | } |
---|
806 | |
---|
807 | |
---|
808 | |
---|
809 | if (jQuery("area").length > 0) { |
---|
810 | jQuery("area").each(function (i) { |
---|
811 | |
---|
812 | obj1 = this.rel; |
---|
813 | obj2 = this.coords; |
---|
814 | if (obj1 == "up") |
---|
815 | this.coords = (Image_width / 3) + "," + 0 + "," + (Image_width * 2 / 3) + "," + Image_height; |
---|
816 | else if (obj1 == "prev") |
---|
817 | this.coords = 0 + "," + 0 + "," + (Image_width / 3) + "," + Image_height; |
---|
818 | else if (obj1 == "next") |
---|
819 | this.coords = (Image_width * 2) / 3 + "," + 0 + "," + (Image_width * 3 / 3) + "," + Image_height; |
---|
820 | |
---|
821 | }); |
---|
822 | |
---|
823 | |
---|
824 | |
---|
825 | |
---|
826 | |
---|
827 | |
---|
828 | } |
---|
829 | |
---|
830 | |
---|
831 | } |
---|
832 | |
---|
833 | //========================================================= |
---|
834 | // jQuery(Cadre).css("position", "relative"); |
---|
835 | |
---|
836 | jQuery(Cadre).css("top", "0px"); |
---|
837 | jQuery("#standard").css("top", 0 + "px"); |
---|
838 | jQuery("#comments").css("top", 0 + "px"); |
---|
839 | |
---|
840 | |
---|
841 | //jQuery("#copyright").css("top", 0 + "px"); |
---|
842 | |
---|
843 | |
---|
844 | jQuery("#linkNext").height(Image_height); |
---|
845 | jQuery("#linkPrev").height(Image_height); |
---|
846 | //================ Zone affichage ========================= |
---|
847 | // Image_height, Image_width = valeur a atteindre. |
---|
848 | if (theme.match(RegExp("luciano", "g"))) { |
---|
849 | zone_affichage.height -= Bandeau_bas; |
---|
850 | } |
---|
851 | |
---|
852 | // jQuery(Cadre).height(zone_affichage.height); |
---|
853 | // jQuery(Cadre).height(mb-zone_affichage.top); |
---|
854 | jQuery(Cadre).width(zone_affichage.width); |
---|
855 | //============================================================== |
---|
856 | |
---|
857 | img_finale.height = Image_height; |
---|
858 | img_finale.width = Image_width; |
---|
859 | //============================================================== |
---|
860 | |
---|
861 | if (typeof (gmaps) != "undefined") { |
---|
862 | Gmap_ = gmaps.maps[0]; |
---|
863 | if (Gmap_.sizeMode == 'A'); |
---|
864 | { |
---|
865 | jQuery("#iGMapsIcon").css({ width: old_w * 0.8 + "px", height: old_h * 0.8 + "px" }); |
---|
866 | |
---|
867 | } |
---|
868 | } |
---|
869 | //============================================================== |
---|
870 | if (Type_Img == "charlie") { |
---|
871 | t1 = jQuery("#charlie").position(); |
---|
872 | /**/ |
---|
873 | pdf = 2 * parseInt(jQuery(".none_2").css("paddingRight")); |
---|
874 | jQuery("#charlie").css({ |
---|
875 | width: Image_width + pdf, |
---|
876 | height: Image_height, |
---|
877 | margin: "auto" |
---|
878 | }); |
---|
879 | |
---|
880 | |
---|
881 | jQuery("#player").css("width", Image_width + 100 + "px"); |
---|
882 | jQuery("#player").css("height", Image_height); |
---|
883 | |
---|
884 | jQuery("#embedplayer").css("width", Image_width); |
---|
885 | jQuery("#embedplayer").css("height", Image_height); |
---|
886 | |
---|
887 | |
---|
888 | jQuery("object").width(Image_width); |
---|
889 | jQuery("object").height(Image_height); |
---|
890 | } else if (Type_Img == "panorama") { |
---|
891 | |
---|
892 | // jQuery(TheImg).panorama2(img_finale.height, img_finale.width); |
---|
893 | jQuery(TheImg).height(img_finale.height); |
---|
894 | jQuery(TheImg).width(img_finale.width); |
---|
895 | jQuery("#Panorama div").height(Image_height); |
---|
896 | // class=simple_panorama |
---|
897 | |
---|
898 | jQuery(".panorama-viewport").css("left", "2px"); |
---|
899 | jQuery(".panorama-viewport").css("width", "auto"); |
---|
900 | // setTimeout("cl_Timer()", 500); |
---|
901 | |
---|
902 | } else if (Type_Img == "pamoorama") { |
---|
903 | return; |
---|
904 | marge_left += 0; |
---|
905 | new_width = zone_affichage.width - marge_right - marge_left; |
---|
906 | jQuery("#pamoorama").css({ margin: 0 + "px", |
---|
907 | left: marge_left + "px", |
---|
908 | height: Image_height + info_pamoorama_footer.height + "px", |
---|
909 | width: new_width + "px" |
---|
910 | }); |
---|
911 | |
---|
912 | jQuery("#pamoorama").width(new_width); |
---|
913 | |
---|
914 | |
---|
915 | jQuery("#pamoorama_outter").css({ |
---|
916 | left: marge_left + "px", |
---|
917 | height: Image_height + "px", |
---|
918 | width: (new_width) + "px" |
---|
919 | }); |
---|
920 | jQuery("#pamoorama_outter").width(new_width); |
---|
921 | |
---|
922 | |
---|
923 | jQuery("#pamoorama_footer").width((zone_affichage.width - marge_right - marge_left)); |
---|
924 | jQuery("#pamoorama_footer").css('width', (zone_affichage.width - marge_right - marge_left) + "px"); |
---|
925 | zoom = Image_height / img_height; |
---|
926 | info_pamoorama_outter = jQuery("#pamoorama_outter").info(); |
---|
927 | |
---|
928 | h_frame = jQuery("#pamoorama").width(); |
---|
929 | if (old_w == jQuery(window).width() && old_h == jQuery(window).height()) { |
---|
930 | |
---|
931 | /* if (info_pamoorama_outter.width == 0) |
---|
932 | setTimeout("wait_Timer()", 100); |
---|
933 | */ |
---|
934 | // jQuery(TheImg).css("zoom", zoom); |
---|
935 | } |
---|
936 | |
---|
937 | |
---|
938 | } else if (TheImg.src) { |
---|
939 | //--- background ?? --- |
---|
940 | jQuery(TheImg).height(img_finale.height); |
---|
941 | jQuery(TheImg).width(img_finale.width); |
---|
942 | jQuery(TheImg).css("height", img_finale.height + "px"); |
---|
943 | jQuery(TheImg).css("width", img_finale.width + "px"); |
---|
944 | |
---|
945 | } else { |
---|
946 | //===map ? === |
---|
947 | jQuery(TheImg).height(img_finale.height); |
---|
948 | jQuery(TheImg).width(img_finale.width); |
---|
949 | jQuery(TheImg).css("height", img_finale.height + "px"); |
---|
950 | jQuery(TheImg).css("width", img_finale.width + "px"); |
---|
951 | } |
---|
952 | |
---|
953 | |
---|
954 | try { |
---|
955 | if (theme.match(RegExp("gally", "g"))) { |
---|
956 | |
---|
957 | jQuery("#navThumbNext").height(init_taille_thumblink.height * 2); |
---|
958 | jQuery("#navThumbPrev").height(init_taille_thumblink.height * 2); |
---|
959 | |
---|
960 | jQuery(".thumbLink").css("height", init_taille_thumblink.height + "px"); |
---|
961 | jQuery(".thumbLink").css("width", init_taille_thumblink.width + "px"); |
---|
962 | |
---|
963 | jQuery(Cadre).height(zone_affichage.height); |
---|
964 | |
---|
965 | } else { |
---|
966 | |
---|
967 | jQuery("#imageToolBar").css("position", "static"); |
---|
968 | } |
---|
969 | } catch (e) { |
---|
970 | |
---|
971 | } |
---|
972 | // |
---|
973 | if (!pos) pos = jQuery("#copyright").position(); |
---|
974 | if (pos != jQuery("#copyright").position()) |
---|
975 | pos = jQuery("#copyright").position(); |
---|
976 | if (pos.top > 100) jQuery("#the_page").height(pos.top); |
---|
977 | |
---|
978 | if (old_w == jQuery(window).width() && old_h == jQuery(window).height()) return; |
---|
979 | jQuery(window).resize(); |
---|
980 | return; |
---|
981 | }); |
---|
982 | var pos; |
---|
983 | //=================================================================== |
---|
984 | jQuery(window).resize(); |
---|
985 | |
---|
986 | |
---|
987 | } // function |
---|
988 | ); // ready |
---|
989 | /* |
---|
990 | * |
---|
991 | */ |
---|
992 | jQuery.extend(jQuery.expr[':'], { |
---|
993 | // Nom du sélecteur personnalisé |
---|
994 | Description: function (a) { |
---|
995 | n = jQuery(a).info(); |
---|
996 | return a; |
---|
997 | |
---|
998 | } |
---|
999 | }); |
---|
1000 | |
---|
1001 | /* Extension |
---|
1002 | * absolutize: |
---|
1003 | * relativize: |
---|
1004 | */ |
---|
1005 | //========================================================= |
---|
1006 | jQuery.fn.extend({ |
---|
1007 | recentrage_widget: function () { |
---|
1008 | jQuery('html,body').stop().scrollTop(0); |
---|
1009 | jQuery('html,body').stop().scrollLeft(0); |
---|
1010 | jQuery(".ui-widget-overlay").css("opacity", "0.75"); |
---|
1011 | |
---|
1012 | l1 = (jQuery(window).width() - (jQuery(".gmapsPopup").width()))/2; |
---|
1013 | h1 = (jQuery(window).height() - (jQuery(".gmapsPopup").height()))/2; |
---|
1014 | |
---|
1015 | jQuery(".gmapsPopup").css("left", l1 + "px"); |
---|
1016 | jQuery(".gmapsPopup").css("top", h1 + "px"); |
---|
1017 | |
---|
1018 | }, |
---|
1019 | //------------------------------------------------------- |
---|
1020 | absolutize: function (element) { |
---|
1021 | element = jQuery(element).get(0); |
---|
1022 | if (element.getStyle('position') == 'absolute') return; |
---|
1023 | // Position.prepare(); // To be done manually by Scripty when it needs it. |
---|
1024 | |
---|
1025 | var offsets = element.positionedOffset(); |
---|
1026 | var top = offsets[1]; |
---|
1027 | var left = offsets[0]; |
---|
1028 | var width = element.clientWidth; |
---|
1029 | var height = element.clientHeight; |
---|
1030 | |
---|
1031 | element._originalLeft = left - parseFloat(element.style.left || 0); |
---|
1032 | element._originalTop = top - parseFloat(element.style.top || 0); |
---|
1033 | element._originalWidth = element.style.width; |
---|
1034 | element._originalHeight = element.style.height; |
---|
1035 | |
---|
1036 | element.style.position = 'absolute'; |
---|
1037 | element.style.top = top + 'px'; |
---|
1038 | element.style.left = left + 'px'; |
---|
1039 | element.style.width = width + 'px'; |
---|
1040 | element.style.height = height + 'px'; |
---|
1041 | return element; |
---|
1042 | }, |
---|
1043 | |
---|
1044 | relativize: function (element) { |
---|
1045 | element = jQuery(element).get(0); ; |
---|
1046 | if (jQuery(element).css('position') == 'relative') return; |
---|
1047 | // Position.prepare(); // To be done manually by Scripty when it needs it. |
---|
1048 | element._originalLeft = parseFloat(element.style.left || 0); |
---|
1049 | element._originalTop = parseFloat(element.style.top || 0); |
---|
1050 | element._originalWidth = element.style.width; |
---|
1051 | element._originalHeight = element.style.height; |
---|
1052 | |
---|
1053 | element.style.position = 'relative'; |
---|
1054 | var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); |
---|
1055 | var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); |
---|
1056 | |
---|
1057 | element.style.top = top + 'px'; |
---|
1058 | element.style.left = left + 'px'; |
---|
1059 | // element.style.height = element._originalHeight; |
---|
1060 | // element.style.width = element._originalWidth; |
---|
1061 | return element; |
---|
1062 | } |
---|
1063 | //========================================================= |
---|
1064 | }); // fin extend |
---|