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

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

[Autosize][beta] Improvement compatibility Gmaps, rvmaps,pamooramic.

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