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

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

[Autosize][beta]fix bugs.


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