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

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

[Autosize][beta] fix bug with Opera.


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