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

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

[Autosize][beta] fix bugs.

File size: 47.5 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
21function wait_Timer() {
22
23    jQuery(window).resize();
24
25}
26
27jQuery(document).ready(
28
29     function (jQuery) {
30
31
32
33         jQuery(window).load(function () {
34             jQuery("#theImage").css({
35                 opacity: '0.0'
36             });
37             //======= cl_conflit ======
38             if (DEBUG == "false") {
39                 jQuery("#Debug").hide();
40                 jQuery("#Debug1").hide();
41                 jQuery("#Debug2").hide();
42             }
43             var img_top = "0";
44
45             var rapport = -1;
46
47             var llgboframe = jQuery("#gbo div:first");
48             var marges_llgbo = 0;
49             if (llgboframe.length > 0) {
50                 ll1 = jQuery(llgboframe).infos();
51                 ll2 = jQuery("#gbo div:last").infos();
52                 marges_llgbo = (ll1.width - ll2.width) + ll2.borderwidth.left + ll2.borderwidth.right;
53             }
54             //=========================================================
55
56
57             //=============================================================
58             function cl_Timer() {
59                 //   if (!jQuery.browser.msie) { jQuery(function () { alert(jQuery.browser.version); }); }
60                 if (jQuery.browser.msie && parseInt(jQuery.browser.version) < 8)
61                     alert(jQuery.browser.version);
62                 panoramaContainer = jQuery(".panorama-container");
63                 n = document.scripts[6]; //12--14affiche_script ;
64                 t = n.src;
65                 currentPosition = 0 - parseInt(jQuery(panoramaContainer).css('margin-left'));
66                 if (currentPosition == NaN) return;
67                 if (currentPosition > 1000)
68                     jQuery(panoramaContainer).css('margin-left', "0px")
69                 setTimeout("cl_Timer()", 500);
70             }
71             //=============================================================
72             function onPropertyChange(e) {
73                 var el = e.srcElement;
74                 var new_class = el.className;
75                 ID = el.id;
76                 Prop = e.propertyName.split(".");
77                 Property = Prop[1];
78                 if (Property == "display") {
79                     Valeur = parseInt(el.currentStyle[Property]);
80                     if (Valeur == "block") {
81
82
83                     }
84                 }
85                 return;
86             }
87             //============================================================
88             /*
89             *
90             */
91             function Info_entete(Parent) {
92
93                 var info_imageToolBar = jQuery("#imageToolBar").infos();
94                 if (info_imageToolBar.position == "absolute") {
95                     jQuery("#imageToolBar").css("position", "relative");
96                     jQuery("#imageToolBar").css("top", 0 + "px");
97                 }
98
99                 var info_theImage = jQuery("#theImage").infos();
100
101                 if (info_theImage.position == "relative") {
102                     //--- passage relative ==> static ===/
103                     jQuery("#theImage").css("position", "static");
104                     info_theImage = jQuery("#theImage").infos();
105
106                 }
107                 if (info_theImage.position == "absolute") {
108                     //--- passage absolute ==> static ===/
109                     jQuery("#theImage").css("position", "static");
110                     info_theImage = jQuery("#theImage").infos();
111
112                 }
113
114                 marge_top = Info_the_page.top +
115                                     Info_the_page.borderwidth.top +
116                                     info_theImage.borderwidth.top;
117
118                 img_top = info_theImage.top + info_theImage.borderwidth.top;
119                 return { marge_top: marge_top, img_top: img_top };
120
121             }
122
123             /* Récupère les informations sur la description.
124             *
125             */
126             function Info_description(Parent) {
127                 //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
128                 //=============================================================================
129                 var info_description = { top: 0, bottom: 0, height: 0 };
130                 if (theme.match(RegExp("simple", "gi"))) {
131                     jQuery("#" + Parent).css({ padding: "0px",
132                         marginLeft: "0px",
133                         marginRight: "auto",
134                         marginTop: "0px",
135                         marginBottom: "0px", position: "absolute", top: Bandeau + "px"
136                     });
137                 } else {
138
139                     jQuery("#" + Parent).css({ padding: "0px",
140                         marginLeft: "auto",
141                         marginRight: "auto",
142                         marginTop: "0px",
143                         marginBottom: "0px"
144                     });
145
146
147                 }
148                 //   jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px "    });
149                 if (theme.match(RegExp("luciano", "g"))) {
150                     info_img = jQuery("#" + Parent + " #theImg img").infos();
151
152                 } else {
153
154                     info_img = jQuery("#" + Parent + " img").infos();
155                 }
156
157                 info_description.marge = { bottom: info_img.padding.bottom + info_img.margin.bottom + info_img.borderwidth.bottom,
158                     top: info_img.padding.top + info_img.borderwidth.top
159                 }
160
161                 info_description.top = info_img.bottom + info_img.margin.bottom + info_img.borderwidth.bottom;
162                 //=============================================================================
163                 info_gbo = jQuery("#gbo").infos();
164                 if (info_description.top < info_gbo.bottom)
165                     info_description.top = info_gbo.bottom;
166                 //=============================================================================
167                 info_desc = jQuery("#" + Parent + " p:first").infos();
168                 if (info_desc.bottom < info_img.bottom)
169                     info_desc.bottom = info_img.bottom;
170
171                 //  if (info_desc.top > info_img.bottom)
172                 //     info_description.top = info_desc.top;
173
174                 if (jQuery("#Panorama").length) {
175                     Type_Img = "panorama";
176                     //  cl_visible = false;
177
178                 }
179                 info_table = jQuery(".infoTable").infos();
180
181                 if (info_table.top > info_description.bottom)
182                     info_description.bottom = info_table.top;
183                 //===========================================================================
184
185                 info_licencetag = jQuery(".licencetag").infos();
186
187
188                 if (info_licencetag.bottom > 0) {
189                     jQuery(".licencetag").css("border", "solid 5px transparent");
190                     if (info_licencetag.bottom > info_description.bottom) {
191                         info_description.bottom = info_licencetag.bottom;
192                     }
193                     else
194                         info_description.bottom += info_table.margin.top + info_table.padding.top;
195
196                 }
197                 //=============================================================================
198                 if (theme.match(RegExp("gally", "gi"))) {
199                     if (!theme.match(RegExp("lapis", "gi"))) {
200                         info_description.bottom = info_description.bottom
201                     }
202                 }
203
204
205
206
207
208                 if (info_description.top < 1)
209                     info_description.top = info_description.bottom;
210
211
212                 if (info_description.bottom < info_description.top) {
213                     info_description.bottom = info_description.top;
214
215                     info_desc = jQuery("#" + Parent + " p:last").infos();
216
217                     if (info_desc.bottom > info_img.bottom)
218                         info_description.bottom = info_desc.bottom;
219                 }
220
221
222                 if (theme.match(RegExp("gally", "g"))) {
223                     if (!theme.match(RegExp("lapis", "gi"))) {
224                         info_copyright = jQuery("#copyright").infos();
225                         info_description.bottom += info_copyright.height;
226                     }
227                 }
228
229                 if (theme.match(RegExp("luciano", "g"))) { info_description.bottom -= 30 }
230
231                 info_description.height = info_description.bottom - info_description.top;
232
233
234                 if (DEBUG == "true") {
235
236                     /*  jQuery("#Debug").text(jQuery("#Debug").text() + user_status);   
237       
238
239                     info_description.width = "800";
240                     */
241                     jQuery("#Debug").css('display', 'block');
242                     jQuery("#Debug1").show();
243                     jQuery("#Debug2").show();
244                     Bandeau_bas = info_description;
245
246                     jQuery("#Debug").css({
247                         filter: 'alpha(opacity:50)',
248                         position: "absolute",
249                         width: "800px",
250                         border: "solid 1px green",
251                         top: Bandeau + "px"
252                     });
253                     jQuery("#Debug").text("Debug:Bandeau : " + Bandeau);
254
255                     jQuery("#Debug1").css({
256                         filter: 'alpha(opacity:50)',
257                         position: "absolute",
258                         border: "solid 1px green",
259                         top: Bandeau_bas.top + "px",
260                         width: (200) + "px",
261                         height: Bandeau_bas.height + "px"
262                     });
263                     jQuery("#Debug1").text("Debug1:Bandeau_bas top : " + Bandeau_bas.top + " height:" + Bandeau_bas.height);
264
265                     jQuery("#Debug2").css({
266                         filter: 'alpha(opacity:50)',
267                         position: "absolute",
268                         left: '50px',
269                         width: (300) + "px",
270                         border: "solid 1px green", top: Bandeau_bas.bottom + "px"
271                     });
272                     jQuery("#Debug2").text("Debug2:Bandeau_bas bottom :" + Bandeau_bas.bottom);
273
274                 }
275
276                 if (check_desc_v != 'checked="checked"') {
277                     info_description.height = 0;
278                 }
279
280
281
282
283                 return info_description;
284
285             }
286
287             /*
288             *
289             */
290
291             //============================================================//==
292             jQuery("#pamoorama_outter").bind('resize', function () {
293                 //   setTimeout("wait_Timer()", 200);
294
295             })
296
297
298
299             //============================================================
300             jQuery("#iGMapsIcon").bind('resize', function () {
301                 jQuery().recentrage_widget();
302             })
303             jQuery("#icon_gmaps").bind('click', function () {
304                 jQuery().recentrage_widget();
305             })
306
307
308
309
310
311
312             /* jQuery */
313             var img_init = { height: img_height, width: img_width };  // taille initiale
314             var img_defaut = { height: scaled_height, width: scaled_width };
315             var img_reelle = { height: img_height, width: img_width };
316             var img_finale = { height: 0, width: 0 };
317             var Zone_Affichage = { height: 0, width: 0 };
318
319             //============================================================
320
321             var Info_the_page = jQuery("#the_page").infos();
322             var Zone_Affichage = jQuery("#theImage").infos();
323
324             var Bandeau = 0;
325             var Bandeau_t = Info_entete("theImage")
326             Bandeau = Bandeau_t.img_top;
327             var Bandeau_bas = 0;
328             Bandeau_bas = Info_description("theImage");
329             var old_window = { width: 0, height: 0 };
330
331
332             //===================================================================     
333             /*
334             * window .resize
335             */
336
337
338             jQuery(window).resize(
339               function (event, ui) {
340                   if (event.type == "resize")
341
342
343                       myevent = arguments[0] = jQuery.event.fix(event || window.event);
344                   myevent.currentTarget = this;
345
346                   // Namespaced event handlers
347                   var namespaces = myevent.type.split(".");
348                   myevent.type = namespaces.shift();
349                   if (typeof (init_resize) == "undefined") init_resize = false;
350
351                   new_window = jQuery(window).infos();
352                   init_resize = (new_window.width == old_window.width);
353                   if (init_resize == false) {
354                       init_resize = Resize();
355                   }
356                   init_resize = (new_window.height == old_window.height)
357                   if (init_resize == false)
358                       init_resize = Resize(); ;
359
360
361
362               });
363
364             var chk = eval(user_status + "_enabled");
365             function Resize(Force) {
366
367                 if (!cl_visible == true) return true;
368                 if (chk == "") return true;
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 false;
584                         if (typeof (myPamoorama.skipInit) == "undefined") return false;
585                         if (myPamoorama.skipInit == false) {
586                            // setTimeout("wait_Timer()",300);
587                             return false;
588                         }
589                         //=========================================================
590                         img_reelle.height = myPamoorama.imageHeight;
591                         img_reelle.width = myPamoorama.imageWidth;
592                         TheImg = myPamoorama.image;
593                         info_theImage = jQuery("#pamoorama").infos();
594                         info_the_page = jQuery("#the_page").infos();
595
596                         break
597
598
599                 }
600
601                 //=============== Vérification taille minimale  autorizée ======================
602                 var miniWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-width"), mini_width);
603                 miniHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-height"), mini_height);
604
605
606                 var maxWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-width"), winwidth, "0");
607                 maxHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-height"), winheight, "0");
608
609                 mini_width = parseInt(miniWidth);
610                 mini_height = parseInt(miniHeight);
611
612                 img_reelle.width = parseInt(img_reelle.width);
613
614
615                 if (img_reelle.width < mini_width) return;
616
617                 img_reelle.height = parseInt(img_reelle.height);
618                 if (img_reelle.height < parseInt(mini_height)) return;
619                 //==================================================================================   
620                 if (rapport < 0) {
621
622                     img_init.height = parseInt(img_height);
623                     img_init.width = parseInt(img_width);
624
625                     rapport = img_width / img_height;
626
627                     if (Type_Img != "map")
628                         rapport = (img_init.width / img_init.height);
629                     else
630                         rapport = 0;
631
632                 }
633
634
635                 //=============== Zone d'affichage ============================
636
637                 borderW = Zone_Affichage.borderwidth.left;
638                 borderW += Zone_Affichage.borderwidth.right;
639
640
641                 Zone_Affichage.width = winwidth - borderW;
642
643
644
645                 var Licence = jQuery(".licencetag");
646                 info_Licence = jQuery(".licencetag").infos();
647
648                 jQuery("#theImage #theImg IMG").css("marginTop", "0px")
649                 //========== Correction en fonction du thème =============================
650                 var correction = 0;
651                 if (theme.match(RegExp("sobre", "g"))) {
652
653                     correction = -info_Licence.padding.top;
654
655                 } else if (theme.match(RegExp("Pure", "g"))) {
656                     correction += 0; //??
657                 } else if (theme.match(RegExp("luciano", "g"))) {
658                     correction = 0; //??
659
660                 } else if (theme.match(RegExp("simple", "g"))) {
661                     correction += 0; //??
662                 } else if (theme.match(RegExp("gally", "g"))) {
663                     correction += 0; //??
664
665                 }
666                 //================ Licence  ========================
667
668                 if (Licence.length > 0) {
669                     jQuery(".licencetag").css("padding", "0px");
670
671                 }
672                 //====================================================
673                 info_img = jQuery(TheImg).infos();
674
675
676
677                 img_top = Bandeau;
678
679                 Marge_Basse = parseInt(marge_basse || 0); // hors bandeau
680                 //==========================================================================
681                 h = 0;
682                 Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction;
683                 var Image_height = Zone_Affichage.height - Bandeau_bas.height - Bandeau_bas.marge.top - Bandeau_bas.marge.bottom;
684
685                 //=============================================================
686                 var height_user = eval(user_status + "_height");
687                 var reg1 = new RegExp("%", "g");
688                 if (height_user.match(reg1))
689                     Image_height = Image_height * parseInt(height_user) / 100;
690                 else
691                     Image_height = parseInt(height_user);
692
693                 echelle_max = parseFloat(echelle_max, '3');
694                 var echelle = parseFloat(Image_height / img_reelle.height, 3);
695
696                 if (echelle > echelle_max) { echelle = echelle_max; }
697                 Image_height = parseInt(img_reelle.height * echelle);
698                 //============================================================
699
700                 var Image_width;
701                 if (rapport > 0)
702                     Image_width = parseInt(Image_height * rapport);
703                 else if (Type_Img == "map") {
704                     Image_width = Zone_Affichage.width - marge_left - marge_right;
705                 } else {
706                     Image_width = Zone_Affichage.width;
707                 }
708
709                 //===============================================================
710                 align_auto = "center";
711                 if (jQuery("#theImg").css("textAlign"))
712                     align_auto = jQuery("#theImg").css("textAlign");
713                 var widthmin = winwidth;
714
715                 if (check_auto_w == 'checked="checked"') {
716                     // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) {
717                     //==== largeur à atteindre ===
718                     var width_user = eval(user_status + "_width");
719                     // Largeur maximale en fonction du statut
720                     if (width_user.match(reg1))
721                     // pourcentage
722                         widthmin = widthmin * parseInt(width_user) / 100;
723                     else
724                         widthmin = parseInt(width_user);
725                     var marges = marges_llgbo;
726                     widthmin -= info_img.borderwidth.left;
727                     widthmin -= info_img.borderwidth.right;
728
729                     widthmin -= marges;
730                     if (Image_width > widthmin) {
731                         //   Image_width largeur à atteindre
732                         //  Calcul du rapport d'agrandissement
733                         var echelle_w = parseFloat((widthmin) / img_reelle.width, 3);
734                         if (echelle_w > echelle_max) { echelle_w = echelle_max; }
735                         Image_width = parseInt(img_reelle.width * echelle_w);
736                         if (rapport > 0)
737                             Image_height = parseInt(Image_width / rapport);
738                     }
739
740
741
742                 }
743
744
745                 // }
746                 //===================================================
747
748
749
750                 zoom = echelle;
751                 //=============LLGBO2 ===========================
752
753
754                 if (marges_llgbo > 0) {
755
756                     t1 = jQuery(llgboframe).infos();
757                     if (!TheImg.src) {
758                         TheImg = jQuery(TheImg).find("img").get(0)
759                     }
760                     if (TheImg.src) {
761
762                         Image_width -= marges_llgbo; // réduction frame
763                         Image_height -= marges_llgbo; // réduction frame
764                         if (rapport > 1) {
765                             if (Image_width > winwidth) {
766                                 jQuery("#gbo").outerWidth(winwidth);
767                                 jQuery("#gbo").css("width", winwidth + "px");
768                             }
769                             else {
770                                 jQuery("#gbo").outerWidth(Image_width);
771                                 jQuery("#gbo").css("width", Image_width + "px");
772                             }
773
774                             t1 = jQuery("#gbo div:last").infos();
775
776                             Image_width = t1.width - (t1.borderwidth.left + t1.borderwidth.right);
777                             Image_height = parseInt(Image_width / rapport);
778
779                             jQuery("#gbo").outerHeight(Image_height + marges_llgbo);
780                             jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
781                             if (jQuery.browser.msie) {
782                                 jQuery("#gbo").css("paddingBottom", 17 + "px");
783                             }
784
785                         } else {
786                             Image_height -= 4;
787                             Image_width -= 4;
788                             if (Image_width > winwidth) {
789                                 jQuery("#gbo").outerWidth(winwidth);
790                                 jQuery("#gbo").css("width", winwidth + "px");
791                             }
792                             else {
793                                 jQuery("#gbo").outerWidth(Image_width);
794                                 jQuery("#gbo").css("width", Image_width + "px");
795                             }
796
797                             jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
798                             jQuery("#gbo").height(Image_height + marges_llgbo);
799
800                             jQuery("#gbo").css("width", Image_width + marges_llgbo + "px");
801                             jQuery("#gbo").width(Image_width + marges_llgbo);
802
803
804
805                             if (jQuery.browser.msie) {
806                                 jQuery("#gbo").css("paddingBottom", 17 + "px");
807                             }
808
809                         }
810                         //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
811                         a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]");
812                         a1 = jQuery("area[rel=prev]");
813                         a2 = jQuery("area[rel=next]");
814                         a3 = jQuery("area[rel=up]");
815                         nb_zone = 3;
816                         if (a1.length == 0) {
817                             nb_zone -= 1;
818                         }
819                         if (a2.length == 0) {
820                             nb_zone -= 1;
821                         }
822
823
824                         var Largeur_zone = (Image_width / nb_zone);
825                         var Hauteur_zone = (Image_height);
826                         var init_zone = 0;
827
828                         if (a1.length > 0) {
829                             coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone };
830
831                             jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
832                             init_zone += Largeur_zone;
833                         }
834
835                         coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
836
837                         if (a0.length > 0) {
838                             jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" });
839                             jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" });
840                         } else {
841                             jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" });
842                         }
843                         init_zone += Largeur_zone;
844
845                         if (a2.length > 0) {
846                             coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
847                             jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
848                         }
849                     }
850                 }
851
852                 //================ Zone affichage =========================
853                 //  Image_height, Image_width = valeur a atteindre.
854                 if (theme.match(RegExp("luciano", "g"))) {
855                     //---- information en dehors du cadre
856                     Zone_Affichage.height -= Bandeau_bas.height - 20;
857                     jQuery(Cadre).height(Zone_Affichage.height);
858
859                 }
860
861                 //=========================================================
862
863                 //  jQuery(Cadre).css("top", "0px");
864                 jQuery("#standard").css("top", 0 + "px");
865                 jQuery("#comments").css("top", 0 + "px");
866
867
868                 jQuery(Cadre).width(Zone_Affichage.width);
869
870                 //==============================================================
871
872                 img_finale.height = Image_height;
873                 img_finale.width = Image_width;
874
875                 //=========================================================================
876
877
878                 if (typeof (gmaps) != "undefined") {
879                     Gmap_ = gmaps.maps[0];
880                     if (Gmap_.sizeMode == 'A') {
881                         jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" });
882
883                     }
884                 }
885                 //==============================================================
886                 if (Type_Img == "charlie") {
887                     t1 = jQuery("#charlie").infos();
888                     /**/
889                     pdf = 2 * parseInt(jQuery(".none_2").css("paddingRight"));
890                     jQuery("#charlie").css({
891                         width: Image_width + pdf,
892                         height: Image_height,
893                         margin: "auto"
894                     });
895
896
897                     jQuery("#player").css("width", Image_width + 100 + "px");
898                     jQuery("#player").css("height", Image_height);
899
900                     jQuery("#embedplayer").css("width", Image_width);
901                     jQuery("#embedplayer").css("height", Image_height);
902
903
904                     jQuery("object").width(Image_width);
905                     jQuery("object").height(Image_height);
906                 } else if (Type_Img == "panorama") {
907
908                     // -----     jQuery(TheImg).panorama2(img_finale.height, img_finale.width);
909                     // jQuery(TheImg).height(img_finale.height);
910                     // jQuery(TheImg).width(img_finale.width);
911                     jQuery("#Panorama div").height(Image_height);
912                     //  class=simple_panorama
913
914                     jQuery(".panorama-viewport").css("left", "2px");
915                     jQuery(".panorama-viewport").css("width", "auto");
916                     //   setTimeout("cl_Timer()", 500);
917
918                 } else if (Type_Img == "pamoorama") {
919
920                     img_height = myPamoorama.imageHeight
921
922                     marge_left += 0;
923
924                     if (theme.match(RegExp("simple", "g"))) {
925                         marge_right = 0;
926                     }
927                     new_width = Zone_Affichage.width - marge_right - marge_left;
928                     new_width -= 4;
929                     myPamoorama.options.width = new_width;
930                     info_theImage.height = img_reelle.height + info_pamoorama_footer.height
931                     //====================================================
932                     jQuery("#pamoorama").css({
933                         marginLeft: "auto",
934                         marginRight: "auto",
935                         height: info_theImage.height + "px",
936                         width: new_width + "px"
937                     });
938                     jQuery("#pamoorama").width(new_width);
939                     //====================================================
940                     jQuery("#pamoorama_outter").css({
941                         left: marge_left + "px",
942                         height: myPamoorama.imageHeight + "px",
943                         width: (new_width) + "px"
944                     });
945                     jQuery("#pamoorama_outter").width(new_width);
946                     //====================================================
947                     jQuery("#pamoorama_footer").width(new_width);
948                     jQuery("#pamoorama_footer").css('width', new_width + "px");
949                     //====================================================
950
951                    //myPamoorama.continueInit();
952                     //myPamoorama.skipInit = false;
953
954                     jQuery("#linkNext").css({ width: "200px", overflow: "hidden" });
955                     jQuery("#linkPrev").css({ width: "200px", overflow: "hidden" });
956                     zoom = Image_height / img_height;
957
958
959
960
961                 } else if (TheImg.src) {
962                     //--- background ?? ---
963                     jQuery(TheImg).height(img_finale.height);
964                     jQuery(TheImg).width(img_finale.width);
965                     jQuery(TheImg).css("height", img_finale.height + "px");
966                     jQuery(TheImg).css("width", img_finale.width + "px");
967
968                 } else {
969                     //===map ? ===
970                     jQuery(TheImg).height(img_finale.height);
971                     jQuery(TheImg).width(img_finale.width);
972                     jQuery(TheImg).css("height", img_finale.height + "px");
973                     jQuery(TheImg).css("width", img_finale.width + "px");
974
975                 }
976
977                 if (DEBUG == "true") {
978
979                     jQuery("#Debug1").css({
980                         position: "absolute",
981                         top: Bandeau + "px",
982                         textAlign: align_auto,
983                         margin: "0px auto",
984
985
986                         border: "solid 1px red",
987
988                         width: Image_width + "px",
989                         height: Image_height + "px"
990
991                     });
992                     jQuery("#Debug1").text("info_theImage.height : " + info_theImage.height);
993                     //===================================================
994                     jQuery("#Debug2").css({ position: "absolute",
995                         left: Zone_Affichage.left + 'px',
996                         border: "solid 1px green",
997                         top: Zone_Affichage.top + "px",
998                         width: Zone_Affichage.width / 2 + "px",
999                         height: Zone_Affichage.height + "px"
1000
1001                     });
1002                     jQuery("#Debug2").text("info_Cadre.height : " + info_Cadre.height);
1003                 }
1004                 jQuery("#navThumbPrev").css({ overflow: "hidden"
1005                 });
1006                 jQuery("#navThumbNext").css({
1007                     overflow: "hidden"
1008                 });
1009                 try {
1010                     if (theme.match(RegExp("gally", "g"))) {
1011
1012                         //===========================================================================
1013                         initializeImageMode("resize");
1014                         if (jQuery("#navThumbPrev").length > 0) {
1015                             jQuery("#navThumbPrev").css({ height: info_img.height + "px",
1016                                 top: info_img.top + 20 + "px", overflow: "hidden"
1017                             });
1018                             if (Type_Img == "map")
1019                                 jQuery("#navThumbPrevContainer").css({ background: 'none' });
1020                         }
1021                         if (jQuery("#navThumbNext").length > 0) {
1022                             jQuery("#navThumbNext").css({ height: info_img.height + "px",
1023                                 top: info_img.top + 20 + "px", overflow: "hidden"
1024                             });
1025
1026                         }
1027                         if (Type_Img == "map")
1028                             jQuery("#navThumbNextContainer").css({ background: 'none' });
1029
1030
1031
1032                         if (!theme.match(RegExp("lapis", "gi"))) { initializeImageMode("resize"); }
1033                     } else if (theme.match(RegExp("simple", "g"))) {
1034
1035                         jQuery("#imageToolBar").css("position", "static");
1036                         info_imageInfoBar = jQuery("#imageInfoBar").infos();
1037                         if (info_imageInfoBar.bottom < info_img.bottom) {
1038                             jQuery("#imageInfoBar").height(info_img.bottom);
1039                         }
1040
1041                     } else {
1042
1043                         //    jQuery("#imageToolBar").css("position", "static");
1044                     }
1045                 } catch (e) {
1046
1047                 }
1048                 // 
1049                 if (!pos) pos = jQuery("#copyright").infos();
1050                 if (pos != jQuery("#copyright").infos())
1051                     pos = jQuery("#copyright").infos();
1052                 if (pos.top > 100) jQuery("#the_page").height(pos.top);
1053                 jQuery("#theImage").animate(
1054               { opacity: 1 }
1055             , fade_in, "swing"
1056             );
1057                 return true;
1058
1059             };  // Resize();
1060             //======================================================================
1061             var pos;
1062             var set_p = false;
1063             fade_in = parseInt(fade_in);
1064
1065             jQuery("#theImage").animate(
1066                { opacity: 0 }
1067             , 500, "swing", function () {
1068                 if (Resize() == true) return;
1069                 jQuery("#theImage").animate(
1070                { opacity: 0.0 }
1071             , fade_in, "swing", function () {
1072                 if (Resize()) return
1073                 opacite = set_opacite(1);
1074                 jQuery("#theImage").animate(
1075                opacite
1076             , fade_in, "swing", function () {
1077                 Resize();
1078             });
1079             });
1080             });
1081
1082
1083
1084             /*
1085             * recherche la plus grande image (hauteur ou largeur)
1086             */
1087
1088
1089             function Get_Img_Maxi(myobj) {
1090                 var w00 = 0;
1091                 var TheImg = null;
1092                 jQuery(myobj).each(function (i) {
1093                     w0 = img_reelle.width;
1094                     h0 = img_reelle.height;
1095                     if (h0 > w0) w0 = h0;
1096                     if (w0 > w00) {
1097                         if (!this.src.match(RegExp(".png", "g")))
1098                             if (!this.src.match(RegExp(thumbnail, "g"))) {
1099                                 TheImg = this;
1100                                 w00 = w0;
1101                             }
1102
1103                     }
1104                 });
1105                 return TheImg;
1106             }
1107         }); // window.onload
1108         /* Extension
1109         * recentrage_widget:
1110         * :
1111         */
1112         //=========================================================
1113         jQuery.fn.extend({
1114             recentrage_widget: function () {
1115                 jQuery('html,body').stop().scrollTop(0);
1116                 jQuery('html,body').stop().scrollLeft(0);
1117                 jQuery(".ui-widget-overlay").css("opacity", "0.75");
1118
1119                 l1 = (jQuery(window).width() - (jQuery(".gmapsPopup").width())) / 2;
1120                 h1 = (jQuery(window).height() - (jQuery(".gmapsPopup").height())) / 2;
1121
1122                 jQuery(".gmapsPopup").css("left", l1 + "px");
1123                 jQuery(".gmapsPopup").css("top", h1 + "px");
1124
1125             }
1126             //=========================================================
1127         });            // fin extend
1128
1129     } // function
1130);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             // ready
1131    /*
1132*
1133*/
1134    jQuery.extend(jQuery.expr[':'], {
1135        // Nom du sélecteur personnalisé
1136        Description: function (a) {
1137            n = jQuery(a).infos();
1138            return a;
1139
1140        }
1141    });
1142
1143    function set_opacite(opac) {
1144        if (jQuery.browser.safari) {
1145
1146            return { opacity: opac };
1147
1148
1149        } else if (jQuery.browser.msie) {
1150            return { opacity: opac };
1151            Opacite = 'alpha(opacity=' + opac * 100 + ')';
1152            return { filter: Opacite };
1153
1154        } else if (jQuery.browser.opera) {
1155            return { opacity: opac };
1156
1157
1158        } else if (jQuery.browser.mozilla) {
1159
1160            return { opacity: opac };
1161
1162        }
1163
1164         
1165          }
Note: See TracBrowser for help on using the repository browser.