source: extensions/Autosize/js/Affiche_script.js @ 7705

Last change on this file since 7705 was 7705, checked in by cljosse, 13 years ago

[Autosize][beta] fix display time()

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