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

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

[Autosize][beta] Add the option validation of the autosize according to the status

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