source: extensions/cl_conflit/js/Affiche_script - Copie (2).js @ 7880

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

[cl_conflit] create of cl_conflit

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