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

Last change on this file since 7354 was 7354, checked in by cljosse, 14 years ago

[Autosize][beta] fix bug on check_dsec_v.


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