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

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

[Autosize][beta] adjust hight with theme simple.

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