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

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

[Autosize][beta] fix display time.

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