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

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

[Autosize][beta] save.

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