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

Last change on this file since 7262 was 7262, checked in by cljosse, 14 years ago

[Autosize][beta] GMaps compatibility.


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