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

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

[Autosize][beta]Include an option for the description and the copyright.


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