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

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

[Autosize][beta] fix bug on "height page".


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