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

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

[Autosize][beta] fix bug with themes :simple,montblanc...

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