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

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

[Autosize][beta] fix bug.

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