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

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

[Autosize][beta] Add option Fade in

File size: 46.7 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'
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
51             function wait_Timer() {
52
53                 Resize();
54
55             }
56             //=============================================================
57             function cl_Timer() {
58                 //   if (!jQuery.browser.msie) { jQuery(function () { alert(jQuery.browser.version); }); }
59                 if (jQuery.browser.msie && parseInt(jQuery.browser.version) < 8)
60                     alert(jQuery.browser.version);
61                 panoramaContainer = jQuery(".panorama-container");
62                 n = document.scripts[6]; //12--14affiche_script ;
63                 t = n.src;
64                 currentPosition = 0 - parseInt(jQuery(panoramaContainer).css('margin-left'));
65                 if (currentPosition == NaN) return;
66                 if (currentPosition > 1000)
67                     jQuery(panoramaContainer).css('margin-left', "0px")
68                 setTimeout("cl_Timer()", 500);
69             }
70             //=============================================================
71             function onPropertyChange(e) {
72                 var el = e.srcElement;
73                 var new_class = el.className;
74                 ID = el.id;
75                 Prop = e.propertyName.split(".");
76                 Property = Prop[1];
77                 if (Property == "display") {
78                     Valeur = parseInt(el.currentStyle[Property]);
79                     if (Valeur == "block") {
80
81
82                     }
83                 }
84                 return;
85             }
86             //============================================================
87             /*
88             *
89             */
90             function Info_entete(Parent) {
91
92                 var info_imageToolBar = jQuery("#imageToolBar").infos();
93                 if (info_imageToolBar.position == "absolute") {
94                     jQuery("#imageToolBar").css("position", "relative");
95                     jQuery("#imageToolBar").css("top", 0 + "px");
96                 }
97
98                 var info_theImage = jQuery("#theImage").infos();
99
100                 if (info_theImage.position == "relative") {
101                     //--- passage relative ==> static ===/
102                     jQuery("#theImage").css("position", "static");
103                     info_theImage = jQuery("#theImage").infos();
104
105                 }
106                 if (info_theImage.position == "absolute") {
107                     //--- passage absolute ==> static ===/
108                     jQuery("#theImage").css("position", "static");
109                     info_theImage = jQuery("#theImage").infos();
110
111                 }
112
113                 marge_top = Info_the_page.top +
114                                     Info_the_page.borderwidth.top +
115                                     info_theImage.borderwidth.top;
116
117                 img_top = info_theImage.top + info_theImage.borderwidth.top;
118                 return { marge_top: marge_top, img_top: img_top };
119
120             }
121
122             /* Récupère les informations sur la description.
123             *
124             */
125             function Info_description(Parent) {
126                 //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
127                 //=============================================================================
128                 var info_description = { top: 0, bottom: 0, height: 0 };
129                 if (theme.match(RegExp("simple", "gi"))) {
130                     jQuery("#" + Parent).css({ padding: "0px",
131                         marginLeft: "0px",
132                         marginRight: "auto",
133                         marginTop: "0px",
134                         marginBottom: "0px", position: "absolute", top: Bandeau + "px"
135                     });
136                 } else {
137
138                     jQuery("#" + Parent).css({ padding: "0px",
139                         marginLeft: "auto",
140                         marginRight: "auto",
141                         marginTop: "0px",
142                         marginBottom: "0px"
143                     });
144
145
146                 }
147                 //   jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px "    });
148                 if (theme.match(RegExp("luciano", "g"))) {
149                     info_img = jQuery("#" + Parent + " #theImg img").infos();
150
151                 } else {
152
153                     info_img = jQuery("#" + Parent + " img").infos();
154                 }
155
156                 info_description.marge = { bottom: info_img.padding.bottom + info_img.margin.bottom + info_img.borderwidth.bottom,
157                     top: info_img.padding.top + info_img.borderwidth.top
158                 }
159
160                 info_description.top = info_img.bottom + info_img.margin.bottom + info_img.borderwidth.bottom;
161                 //=============================================================================
162                 info_gbo = jQuery("#gbo").infos();
163                 if (info_description.top < info_gbo.bottom)
164                     info_description.top = info_gbo.bottom;
165                 //=============================================================================
166                 info_desc = jQuery("#" + Parent + " p:first").infos();
167                 if (info_desc.bottom < info_img.bottom)
168                     info_desc.bottom = info_img.bottom;
169
170                 //  if (info_desc.top > info_img.bottom)
171                 //     info_description.top = info_desc.top;
172
173                 if (jQuery("#Panorama").length) {
174                     Type_Img = "panorama";
175                     //  cl_visible = false;
176
177                 }
178                 info_table = jQuery(".infoTable").infos();
179
180                 if (info_table.top > info_description.bottom)
181                     info_description.bottom = info_table.top;
182                 //===========================================================================
183
184                 info_licencetag = jQuery(".licencetag").infos();
185
186
187                 if (info_licencetag.bottom > 0) {
188                     jQuery(".licencetag").css("border", "solid 5px transparent");
189                     if (info_licencetag.bottom > info_description.bottom) {
190                         info_description.bottom = info_licencetag.bottom;
191                     }
192                     else
193                         info_description.bottom += info_table.margin.top + info_table.padding.top;
194
195                 }
196                 //=============================================================================
197                 if (theme.match(RegExp("gally", "gi"))) {
198                     if (!theme.match(RegExp("lapis", "gi"))) {
199                         info_description.bottom = info_description.bottom
200                     }
201                 }
202
203
204
205
206
207                 if (info_description.top < 1)
208                     info_description.top = info_description.bottom;
209
210
211                 if (info_description.bottom < info_description.top) {
212                     info_description.bottom = info_description.top;
213
214                     info_desc = jQuery("#" + Parent + " p:last").infos();
215
216                     if (info_desc.bottom > info_img.bottom)
217                         info_description.bottom = info_desc.bottom;
218                 }
219
220
221                 if (theme.match(RegExp("gally", "g"))) {
222                     if (!theme.match(RegExp("lapis", "gi"))) {
223                         info_copyright = jQuery("#copyright").infos();
224                         info_description.bottom += info_copyright.height;
225                     }
226                 }
227
228                 if (theme.match(RegExp("luciano", "g"))) { info_description.bottom -= 30 }
229
230                 info_description.height = info_description.bottom - info_description.top;
231
232
233                 if (DEBUG == "true") {
234
235                     /*  jQuery("#Debug").text(jQuery("#Debug").text() + user_status);   
236       
237
238                     info_description.width = "800";
239                     */
240                     jQuery("#Debug").css('display', 'block');
241                     jQuery("#Debug1").show();
242                     jQuery("#Debug2").show();
243                     Bandeau_bas = info_description;
244
245                     jQuery("#Debug").css({
246                         filter: 'alpha(opacity:50)',
247                         position: "absolute",
248                         width: "800px",
249                         border: "solid 1px green",
250                         top: Bandeau + "px"
251                     });
252                     jQuery("#Debug").text("Debug:Bandeau : " + Bandeau);
253
254                     jQuery("#Debug1").css({
255                         filter: 'alpha(opacity:50)',
256                         position: "absolute",
257                         border: "solid 1px green",
258                         top: Bandeau_bas.top + "px",
259                         width: (200) + "px",
260                         height: Bandeau_bas.height + "px"
261                     });
262                     jQuery("#Debug1").text("Debug1:Bandeau_bas top : " + Bandeau_bas.top + " height:" + Bandeau_bas.height);
263
264                     jQuery("#Debug2").css({
265                         filter: 'alpha(opacity:50)',
266                         position: "absolute",
267                         left: '50px',
268                         width: (300) + "px",
269                         border: "solid 1px green", top: Bandeau_bas.bottom + "px"
270                     });
271                     jQuery("#Debug2").text("Debug2:Bandeau_bas bottom :" + Bandeau_bas.bottom);
272
273                 }
274
275                 if (check_desc_v != 'checked="checked"') {
276                     info_description.height = 0;
277                 }
278
279
280
281
282                 return info_description;
283
284             }
285
286             /*
287             *
288             */
289
290             //============================================================//==
291             jQuery("#pamoorama_outter").bind('resize', function () {
292                 //   setTimeout("wait_Timer()", 200);
293
294             })
295
296
297
298             //============================================================
299             jQuery("#iGMapsIcon").bind('resize', function () {
300                 jQuery().recentrage_widget();
301             })
302             jQuery("#icon_gmaps").bind('click', function () {
303                 jQuery().recentrage_widget();
304             })
305
306
307
308
309
310
311             /* jQuery */
312             var img_init = { height: img_height, width: img_width };  // taille initiale
313             var img_defaut = { height: scaled_height, width: scaled_width };
314             var img_reelle = { height: img_height, width: img_width };
315             var img_finale = { height: 0, width: 0 };
316             var Zone_Affichage = { height: 0, width: 0 };
317
318             //============================================================
319
320             var Info_the_page = jQuery("#the_page").infos();
321             var Zone_Affichage = jQuery("#theImage").infos();
322
323             var Bandeau = 0;
324             var Bandeau_t = Info_entete("theImage")
325             Bandeau = Bandeau_t.img_top;
326             var Bandeau_bas = 0;
327             Bandeau_bas = Info_description("theImage");
328             var old_window = { width: 0, height: 0 };
329
330
331             //===================================================================     
332             /*
333             * window .resize
334             */
335
336
337             jQuery(window).resize(
338               function (event, ui) {
339                   if (event.type == "resize")
340
341
342                       myevent = arguments[0] = jQuery.event.fix(event || window.event);
343                   myevent.currentTarget = this;
344
345                   // Namespaced event handlers
346                   var namespaces = myevent.type.split(".");
347                   myevent.type = namespaces.shift();
348                   if (typeof (init_resize) == "undefined") init_resize = false;
349                   if (init_resize == false)
350                       init_resize = Resize();
351                   if (init_resize) {
352                       new_window = jQuery(window).infos();
353                       init_resize = (new_window.width == old_window.width);
354                       if (init_resize) init_resize = (new_window.height == old_window.height)
355                   }
356
357
358               });
359
360             var chk = eval(user_status + "_enabled");
361             function Resize(Force) {
362
363                 if (!cl_visible == true) return;
364                 if (Force)
365                     old_window = { width: 0, height: 0 };
366
367
368                 if (chk == "") return;
369                 //=================================================================
370                 //var retour = (getStackTrace());
371                 //   alert(retour);
372                 //jQuery("#debug").text(retour);
373                 //  return
374                 //=================================================================
375
376                 var winwidth = jQuery(window).width();
377                 var winheight = jQuery(window).height();
378
379                 old_window = jQuery(window).infos();
380                 //===========================================================================
381
382
383                 var Type_Img = "";
384                 //====== détection du type d'images ======
385                 if (jQuery("#charlie").length > 0) {
386                     Type_Img = "charlie";
387                 } else if (jQuery("#pamoorama").length) {
388                     Type_Img = "pamoorama";
389                 } else if (jQuery("#theImage embed").length > 0) {
390                     Type_Img = "embed";
391                 } else if (jQuery("#map").length) {
392                     Type_Img = "map";
393                 } else if (jQuery("#Panorama").length) {
394                     Type_Img = "panorama";
395                 } else if (jQuery("#theImage").find("img").length > 0) {
396                     Type_Img = "img";
397                 } else if (jQuery("img").length > 0) {
398                     Type_Img = "img_autre";
399                     return;
400                 } else {
401                     return;
402                 }
403
404
405
406                 var Cadre = jQuery("#theImage").get(0);
407                 var info_Cadre = jQuery(Cadre).infos();
408                 //===============  Information cadre ======
409                 var info_the_page = jQuery("#the_page").infos();
410
411                 //=============================================================================
412                 var info_HeaderBar = jQuery("#imageHeaderBar").infos();
413
414                 var info_content = jQuery("#content").infos();
415
416
417                 var info_titrePage = jQuery("#titrePage").infos();
418
419
420                 var Zone_Affichage = jQuery("#theImage").infos();
421
422                 var info_ToolBar = jQuery("#imageToolBar").infos();
423                 var info_imageInfoBar = jQuery("#imageInfoBar").infos();
424                 var info_theHeader = jQuery("#theHeader").infos();
425
426
427                 var marge = 0;
428                 if (info_ToolBar.width > 0)
429                     marge = (Zone_Affichage.width - info_ToolBar.width) / 2;
430
431                 var marge_right = marge;
432                 var marge_left = marge;
433
434                 if (info_content.width > 100) {
435                     marge_left = 0;
436                     marge_right = info_imageInfoBar.margin.left + info_imageInfoBar.margin.right;
437                     winwidth = info_content.width;
438                     marge_right = info_imageInfoBar.width + marge_right;
439
440                 }
441                 else
442                     winwidth = Zone_Affichage.width;
443
444                 winwidth -= (marge_right + marge_left);
445
446
447
448
449                 if (Type_Img == "pamoorama") {
450                     var info_pamoorama = jQuery("#pamoorama").infos();
451                     var info_pamoorama_outter = jQuery("#pamoorama_outter").infos();
452                     var info_pamoorama_inner = jQuery("#pamoorama_inner").infos();
453                     var info_pamoorama_footer = jQuery("#pamoorama_footer").infos();
454                     TheImg = jQuery("#pamoorama");
455
456                     /*
457                     myPamoorama = new pamoorama('pamoorama',{ activateSlider:  {$PANO_ACTIVATESLIDER},
458                     width:             {$PANO_WIDTH},
459                     footercolor:               '{$PANO_FOOTERCOLOR}',
460                     captioncolor:      '{$PANO_CAPTIONCOLOR}',
461                     caption:           '{$ALT_IMG}',
462                     enableAutoscroll:  {$PANO_ENABLEAUTOSCROLL},
463                     autoscrollSpeed:   {$PANO_AUTOSCROLLSPEED},
464                     autoscrollOnLoad:  {$PANO_AUTOSCROLLONLOAD},
465                     startAutoscroll:   '{'pamooramics_startAutoscroll'|@translate}',
466                     stopAutoscroll:            '{'pamooramics_stopAutoscroll'|@translate}',
467                     loadingMessage: '{'pamooramics_loading'|@translate}',
468                     clickMessage:              '{'pamooramics_clickMessage'|@translate}',
469                     dragMessage:               '{'pamooramics_dragMessage'|@translate}'
470                     });
471                     */
472                     /*
473                     pamoorama_outter
474                     pamoorama_inner
475                     pamoorama_footer
476                     pamoorama_caption
477                     pamoorama_thumb
478                     pamoorama_frame
479                     */
480                 } else {
481                     //==== récupère Img la plus grande  =====
482                     if (jQuery("#theImg")) IMG = "#theImg";
483                     else IMG = Cadre;
484
485                     TheImg2 = Get_Img_Maxi(IMG + " img");
486                     //=================================================================
487                     if (TheImg2 == null) {
488                         if (jQuery(Cadre).find("img").length > 0) {
489                             IMG = Cadre;
490
491
492                             TheImg = Get_Img_Maxi("#theImage img");
493                         }
494                     } else {
495                         TheImg = TheImg2  //luciano ?
496
497                     }
498                 }
499                 //=================================================================
500
501
502                 switch (Type_Img) {
503                     case "map":
504                         var info_image = jQuery("#map").infos();
505
506                         var info_map = jQuery("#mapPicture").infos();
507
508                         marge_left = info_map.width;
509                         jQuery("#map").css("left", marge_left);
510
511                         var TheImg = jQuery("#map").get(0);
512                         img_reelle.height = info_image.height;
513                         img_reelle.width = winwidth - marge_right - marge_right;
514                         Bandeau_bas.height = 10;
515                         marge_right = 10;
516
517                         info_the_page = jQuery("#the_page").infos();
518                         ;
519
520                         break
521
522
523                     case "panorama":
524                         // return;
525
526
527                         TheImg = Get_Img_Maxi("#Panorama img");
528                         info_theImage = jQuery(TheImg).infos();
529                         info_the_page = jQuery("#the_page").infos();
530
531                         break
532                     case "img":
533
534                         if (!TheImg) return;
535                         if (theme.match(RegExp("luciano", "g"))) {
536                             TheImg = jQuery("#the_page #theImg");
537                         }
538                         info_theImage = jQuery(TheImg).infos();
539                         info_the_page = jQuery("#the_page").infos();
540
541
542                         break
543                     case "img_autre":
544                         if (!TheImg) return;
545                         info_theImage = jQuery(TheImg).infos();
546                         info_the_page = jQuery("#the_page").infos();
547
548
549                         break
550                     case "embed":
551                         //
552
553                         TheImg = jQuery(Cadre).find("embed");
554
555                         info_theImage = jQuery(Cadre).infos();
556                         info_the_page = jQuery("#the_page").infos();
557                         if (rapport < 0) {
558                             img_height = parseInt(jQuery(TheImg).outerHeight());
559                             img_width = parseInt(jQuery(TheImg).outerWidth());
560
561                             img_reelle.height = img_height;
562                             img_reelle.width = img_width;
563
564                         }
565
566                         break
567                     case "charlie":
568
569                         TheImg = jQuery('#charlie object').get(0);
570                         info_theImage = jQuery(Cadre).infos();
571                         info_the_page = jQuery("#the_page").infos();
572                         if (rapport < 0) {
573                             img_height = parseInt(TheImg.height);
574                             img_width = parseInt(TheImg.width);
575
576                             img_reelle.height = parseInt(TheImg.height);
577                             img_reelle.width = parseInt(TheImg.width);
578                         }
579
580                         break
581                     case "pamoorama":
582                         //=========================================================
583                         if (typeof (myPamoorama) == "undefined") return
584                         if (typeof (myPamoorama.skipInit) == "undefined") return
585                         if (myPamoorama.skipInit == false) return
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 - 20;
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                 jQuery("#theImage").animate(
1049               { opacity: 1 }
1050             , fade_in, "swing"
1051             );
1052                 return true;
1053
1054             };  // Resize();
1055             //======================================================================
1056             var pos;
1057             var set_p = false;
1058             fade_in = parseInt(fade_in);
1059
1060             jQuery("#theImage").animate(
1061                { opacity: 0 }
1062             , 500, "swing", function () {
1063                if (Resize()==true)  return ;
1064                 jQuery("#theImage").animate(
1065                { opacity: 0.0 }
1066             , fade_in, "swing", function () {
1067                 if (Resize()) return
1068                 opacite = set_opacite(1);
1069                 jQuery("#theImage").animate(
1070                opacite
1071             , fade_in, "swing", function () {
1072                 Resize();
1073             });
1074             });
1075             });
1076
1077
1078
1079             /*
1080             * recherche la plus grande image (hauteur ou largeur)
1081             */
1082
1083
1084             function Get_Img_Maxi(myobj) {
1085                 var w00 = 0;
1086                 var TheImg = null;
1087                 jQuery(myobj).each(function (i) {
1088                     w0 = img_reelle.width;
1089                     h0 = img_reelle.height;
1090                     if (h0 > w0) w0 = h0;
1091                     if (w0 > w00) {
1092                         if (!this.src.match(RegExp(".png", "g")))
1093                             if (!this.src.match(RegExp(thumbnail, "g"))) {
1094                                 TheImg = this;
1095                                 w00 = w0;
1096                             }
1097
1098                     }
1099                 });
1100                 return TheImg;
1101             }
1102         }); // window.onload
1103         /* Extension
1104         * recentrage_widget:
1105         * :
1106         */
1107         //=========================================================
1108         jQuery.fn.extend({
1109             recentrage_widget: function () {
1110                 jQuery('html,body').stop().scrollTop(0);
1111                 jQuery('html,body').stop().scrollLeft(0);
1112                 jQuery(".ui-widget-overlay").css("opacity", "0.75");
1113
1114                 l1 = (jQuery(window).width() - (jQuery(".gmapsPopup").width())) / 2;
1115                 h1 = (jQuery(window).height() - (jQuery(".gmapsPopup").height())) / 2;
1116
1117                 jQuery(".gmapsPopup").css("left", l1 + "px");
1118                 jQuery(".gmapsPopup").css("top", h1 + "px");
1119
1120             }
1121             //=========================================================
1122         });            // fin extend
1123
1124     } // function
1125);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     // ready
1126    /*
1127*
1128*/
1129    jQuery.extend(jQuery.expr[':'], {
1130        // Nom du sélecteur personnalisé
1131        Description: function (a) {
1132            n = jQuery(a).infos();
1133            return a;
1134
1135        }
1136    });
1137
1138    function set_opacite(opac) {
1139        if (jQuery.browser.safari) {
1140
1141            return { opacity: opac };
1142
1143
1144        } else if (jQuery.browser.msie) {
1145            return { opacity: opac };
1146            Opacite = 'alpha(opacity=' + opac * 100 + ')';
1147            return { filter: Opacite };
1148
1149        } else if (jQuery.browser.opera) {
1150            return { opacity: opac };
1151
1152
1153        } else if (jQuery.browser.mozilla) {
1154
1155            return { opacity: opac };
1156
1157        }
1158
1159         
1160          }
Note: See TracBrowser for help on using the repository browser.