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

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

[Autosize][beta] fix compatiblity with charlie(360 swf).

File size: 51.7 KB
Line 
1if (typeof jQuery == 'undefined') { 
2    // jQuery n'est pas chargé
3} else {
4    // jQuery est chargé
5}
6 
7function Toggle_bp() {
8    cl_visible = !cl_visible;
9    if (cl_visible) src = src1;
10    else src = src2;
11    if (cl_visible) src_info = src3;
12    else src_info = src4;
13
14    jQuery('#bp_cla').attr('alt', src_info);
15    jQuery('#bp_cla').attr('title', src_info);
16
17    jQuery('#bp_img_cla').get(0).src = src;
18    jQuery('#bp_img_cla').attr('alt', src_info);
19    jQuery('#bp_img_cla').attr('title', src_info);
20    jQuery('#bp_cla').attr('Stitle', src_info);
21    jQuery('#bp_cla').attr('Stip', " ");       
22     jQuery().newResize();
23   
24}
25 
26//==========================================================================
27function Wait_Affichage() {
28   if (jQuery("#pamoorama").length) {
29               jQuery().newResize() ;
30               mypanorama = window.myPamoorama;
31               if (!mypanorama){ 
32                    setTimeout("Wait_Affichage()", 500);
33                    return false ;
34               }
35                 if ( mypanorama.skipInit==false) { 
36                    setTimeout("Wait_Affichage()", 500);
37                    return false ;
38               }
39                     info_pamoorama = jQuery("#pamoorama").infos();
40                    new_width= info_pamoorama.width ;
41               
42                 if (  Math.abs(new_width - myPamoorama.options.width)>10  ) {
43                 setTimeout("Wait_Affichage()", 500);
44                 return false ;
45                 }
46         
47
48     }else  if(!jQuery().newResize()) {
49                 setTimeout("Wait_Affichage()", 500);
50                 return 
51    }
52
53
54      fade_in = parseInt(fade_in);
55            if (fade_in==0 )
56                 {
57                 jQuery("#theImage").css({
58                         opacity: 1
59                         
60                         }
61                 )
62                                 }else{
63                 jQuery("#theImage").animate(
64                         { opacity: 1 }, fade_in   , "swing"
65                        );
66             }
67
68
69                         
70} 
71 
72 
73//=========================================================
74
75jQuery(document).ready(
76     function (jQuery) {
77         jQuery(window).load(function () {
78
79             //======= cl_conflit ======
80             if (DEBUG == "false") {
81                 jQuery("#Debug").hide();
82                 jQuery("#Debug1").hide();
83                 jQuery("#Debug2").hide();
84             }
85 
86             img_top = "0";
87             rapport = -1;
88             llgboframe = jQuery("#gbo div:first");
89             marges_llgbo = 0;
90             pos = 0;
91 
92          //=========================================================
93
94             if (llgboframe.length > 0) {
95                       ll1=jQuery("#llgboframe31").infos();
96          ll2=jQuery("#llgboframe1" ).infos();
97
98                 marges_llgbo = (ll1.width - ll2.width) + ll2.borderwidth.left + ll2.borderwidth.right;
99             }
100                   
101             //=============================================================
102             function cl_Timer() {
103                 //   if (!jQuery.browser.msie) { jQuery(function () { alert(jQuery.browser.version); }); }
104                 if (jQuery.browser.msie && parseInt(jQuery.browser.version) < 8)
105                     alert(jQuery.browser.version);
106                 panoramaContainer = jQuery(".panorama-container");
107                 n = document.scripts[6]; //12--14affiche_script ;
108                 t = n.src;
109                 currentPosition = 0 - parseInt(jQuery(panoramaContainer).css('margin-left'));
110                 if (currentPosition == NaN) return;
111                 if (currentPosition > 1000)
112                     jQuery(panoramaContainer).css('margin-left', "0px")
113                 setTimeout("cl_Timer()", 500);
114             }
115
116           
117             //============================================================
118             /*
119             *
120             */
121             function Info_entete(Parent) {
122
123                 var info_imageToolBar = jQuery("#imageToolBar").infos();
124                 if (info_imageToolBar.position == "absolute") {
125                     jQuery("#imageToolBar").css("position", "relative");
126                     jQuery("#imageToolBar").css("top", 0 + "px");
127                 }
128
129                 var info_theImage = jQuery("#theImage").infos();
130
131                 if (info_theImage.position == "relative") {
132                     //--- passage relative ==> static ===/
133                     jQuery("#theImage").css("position", "static");
134                     info_theImage = jQuery("#theImage").infos();
135
136                 }
137                 if (info_theImage.position == "absolute") {
138                     //--- passage absolute ==> static ===/
139                     jQuery("#theImage").css("position", "static");
140                     info_theImage = jQuery("#theImage").infos();
141
142                 }
143           
144                 marge_top =Math.ceil( Info_the_page.top +
145                                     Info_the_page.borderwidth.top +
146                                     info_theImage.borderwidth.top);
147
148                 img_top = Math.ceil( info_theImage.top + info_theImage.borderwidth.top);
149                 return { marge_top: marge_top, img_top: img_top };
150
151             }
152
153             /* Récupère les informations sur la description.
154             *
155             */
156             function Info_description(Parent) {
157                 //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
158                 //=============================================================================
159                 var info_description = { top: 0, bottom: 0, height: 0 };
160                 if (theme.match(RegExp("simple", "gi"))) {
161                     jQuery("#" + Parent).css({ padding: "0px",
162                         marginLeft: "0px",
163                         marginRight: "auto",
164                         marginTop: "0px",
165                         marginBottom: "0px", position: "absolute", top: Bandeau + "px"
166                     });
167                 } else {
168               
169                     jQuery("#" + Parent).css({ padding: "0px",
170                         marginLeft: "auto",
171                         marginRight: "auto",
172                         marginTop: "0px",
173                         marginBottom: "0px"
174                     });
175
176
177                 }
178                 //   jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px "    });
179                 if (theme.match(RegExp("luciano", "g"))) {
180                     info_img = jQuery("#" + Parent + " #theImg img").infos();
181
182                 } else if (jQuery("#charlie").length > 0) {
183                     
184                      jQuery("#charlie").css({ padding: "0px",
185                         marginLeft: "auto",
186                         marginRight: "auto",
187                         marginTop: "auto",
188                         marginBottom:"auto", position: "relative", top: 0+ "px"
189                     });
190
191                       //    info_img = jQuery("#charlie").infos(); //charlie
192                  info_img = jQuery('#charlie object').infos(); //player
193                     
194
195                   } else {
196
197                     info_img = jQuery("#" + Parent + " img").infos();
198                 }
199                 info_description.marge = { bottom: info_img.padding.bottom + info_img.margin.bottom + info_img.borderwidth.bottom,
200                     top: info_img.padding.top + info_img.borderwidth.top
201                 }
202                 if (( info_img.bottom-info_img.top) < 100 ) 
203                 info_img.top =0 ;
204
205                 info_description.top = Bandeau + info_img.top + info_img.bottom + info_img.margin.bottom + info_img.borderwidth.bottom;
206                 //=============================================================================
207                 info_gbo = jQuery("#gbo").infos();
208                 if (info_description.top < info_gbo.bottom)
209                     info_description.top = info_gbo.bottom;
210                 //=============================================================================
211                  info_desc = jQuery("#" + Parent + " p:first").infos();
212                 //----> difference IE8/FF ====
213                 /* borderwidth           2 | 0
214                 margin top/booom       13  | 12
215                 margin                  1  | 0
216                 top                    101 | 104
217                 */
218                 if (info_desc.bottom < info_img.bottom)
219                     info_desc.bottom = info_img.bottom;
220
221                 //  if (info_desc.top > info_img.bottom)
222                 //     info_description.top = info_desc.top;
223                 info_table = jQuery(".infoTable").infos();
224                   
225                 if (info_table.top > info_description.bottom)
226                     info_description.bottom = info_table.top;
227                 //===========================================================================
228
229                 info_licencetag = jQuery(".licencetag").infos();
230
231
232                 if (info_licencetag.bottom > 0) {
233                 if(jQuery.browser.msie == true)
234                 jQuery(".licencetag").css("padding", "0px");
235
236                     jQuery(".licencetag").css("border", "solid 5px transparent");
237                     if (info_licencetag.bottom > info_description.bottom) {
238                         info_description.bottom = info_licencetag.bottom;
239                     }
240                     else
241                         info_description.bottom += info_table.margin.top + info_table.padding.top;
242
243                 }
244                 //=============================================================================
245                 if (theme.match(RegExp("gally", "gi"))) {
246                     if (!theme.match(RegExp("lapis", "gi"))) {
247                         info_description.bottom = info_description.bottom
248                     }
249                 }
250
251
252
253
254
255                 if (info_description.top < 1)
256                     info_description.top = info_description.bottom;
257
258
259                 if (info_description.bottom < info_description.top) {
260                        top_tmp=  info_description.top;
261                        info_description.top=info_description.bottom;
262                        info_description.bottom =top_tmp;
263
264                     info_desc = jQuery("#" + Parent + " p:last").infos();
265
266                     if (info_desc.bottom > info_img.bottom)
267                         info_description.bottom = info_desc.bottom;
268                           if (info_description.bottom < info_description.top) {
269                                top_tmp=  info_description.top;
270                                info_description.top=info_description.bottom;
271                                info_description.bottom =top_tmp;
272                     }
273                       info_description.height =info_description.bottom-info_description.top;
274
275                 }
276
277
278                 if (theme.match(RegExp("gally", "g"))) {
279                     if (!theme.match(RegExp("lapis", "gi"))) {
280                         info_copyright = jQuery("#copyright").infos();
281                         info_description.bottom += info_copyright.height;
282                     }
283                 }
284
285                 if (theme.match(RegExp("luciano", "g"))) { 
286                 //info_description.bottom -= 30
287                 }
288                 if(jQuery.browser.msie!= true)
289                info_description.bottom +=4;
290                 
291                  info_description.height = info_description.bottom - info_description.top;
292
293                 if (DEBUG == "true") {
294                        jQuery("#Debug").css('display', 'block');
295                         jQuery("#Dragg").css('display', 'block');
296                     jQuery("#Debug1").show();
297                     jQuery("#Debug2").show();             
298                 Bandeau_bas = info_description;
299                     jQuery().affiche_debug({ debug: {texte:"Debug:Bandeau : " + Bandeau,
300                     css:{
301                         opacity: 0.5,
302                         filter: 'alpha(opacity:50)',
303                         position: "absolute",
304                         width: "800px",
305                         border: "solid 1px green",
306                         top: Bandeau + "px"}
307                     },
308                         debug1:{ texte:"Debug1:Bandeau_bas top : " + Bandeau_bas.top + " height:" + Bandeau_bas.height,
309                         css:{ 
310                         opacity: 0.5,
311                         filter: 'alpha(opacity:50)',
312                         position: "absolute",
313                         border: "solid 1px green",
314                         top: Bandeau_bas.top + "px",
315                         width: (800) + "px",
316                         height: Bandeau_bas.height + "px"
317                     }
318                     },
319                         debug2: { texte: "Debug2:Bandeau_bas bottom :" + Bandeau_bas.bottom ,
320                         css:{
321                         opacity: 0.5,
322                         filter: 'alpha(opacity:50)',
323                         position: "absolute",
324                         left: '50px',
325                         width: (800) + "px",
326                         border: "solid 1px green", top: Bandeau_bas.bottom + "px"
327                         }
328                         }
329                     });
330
331
332                 }
333
334                 if (check_desc_v != 'checked="checked"') {
335                     info_description.height = 0;
336                 }
337             
338
339                 return info_description;
340
341             }
342
343             /*
344             *
345             */
346
347             //============================================================
348
349             /* jQuery */
350             img_init = { height: img_height, width: img_width };  // taille initiale
351             img_defaut = { height: scaled_height, width: scaled_width };
352             img_reelle = { height: img_height, width: img_width };
353             img_finale = { height: 0, width: 0 };
354             Zone_Affichage = { height: 0, width: 0 };
355
356             //============================================================
357
358             Info_the_page = jQuery("#the_page").infos();
359             Zone_Affichage = jQuery("#theImage").infos();
360
361             Bandeau = 0;
362             Bandeau_t = Info_entete("theImage")
363             Bandeau = Bandeau_t.img_top;
364             Bandeau_bas = 0;
365             Bandeau_bas = Info_description("theImage");
366             var old_window = { width: 0, height: 0 };
367
368
369             //===================================================================     
370             /*
371             * window .resize
372             */
373
374
375             jQuery(window).resize(
376               function (event, ui) {   
377               
378                   
379               event = event || window.event;
380
381                   if (event.type == "resize")                     
382                  { 
383                    myevent = arguments[0] = jQuery.event.fix(event || window.event);
384                    myevent.currentTarget = this;
385                     // Namespaced event handlers
386                   var namespaces = myevent.type.split(".");
387                     myevent.type = namespaces.shift();
388                   }
389                   if (typeof (init_resize) == "undefined") init_resize = false;
390
391                   new_window = jQuery(window).infos();
392                   init_resize = (new_window.width == old_window.width);
393                   if (init_resize == false) {
394                       init_resize = Resize();
395                   }
396                   init_resize = (new_window.height == old_window.height)
397                   if (init_resize == false)
398                       init_resize = Resize(); ;
399
400                 
401
402               });
403
404             //============== initialisation ===================
405
406             var pos;
407             var set_p = false;
408             function Resize() {
409
410                  jQuery().newResize();
411                     
412               
413             }
414
415             //===================================================
416             elem=jQuery("#pamoorama").get(0) ;
417if(elem)
418{           type="propertychange";
419            handle=jQuery().onPropertyChange;
420
421                        if (elem.addEventListener) {// Firefox, Opera, Google Chrome and Safari
422                            elem.addEventListener('DOMAttrModified', handle, false);
423                        } else if (elem.attachEvent) {
424                            elem.attachEvent("on" + type, handle);
425                        }
426    }
427    //======== Doubler  resize ! pour Chrome, safari ==================
428        Wait_Affichage() ;
429
430         }); // window.onload
431         /* Extension
432         * affiche_debug
433
434         * resize
435         * :
436         */
437         //=========================================================
438 
439
440         jQuery.fn.extend({
441                      //=============================================================
442           onPropertyChange:  function (e) {
443           return ;
444
445
446             },
447             /*
448             * recherche la plus grande image (hauteur ou largeur)
449             */
450          Get_Img_Maxi:   function (myobj) {
451                 var w00 = 0;
452                 var TheImg = null;
453                 jQuery(myobj).each(function (i) {
454                     w0 = img_reelle.width;
455                     h0 = img_reelle.height;
456                     if (h0 > w0) w0 = h0;
457                     if (w0 > w00) {
458                         if (!this.src.match(RegExp(".png", "g")))
459                             if (!this.src.match(RegExp(thumbnail, "g"))) {
460                                 TheImg = this;
461                                 w00 = w0;
462                             }
463
464                     }
465                 });
466                 return TheImg;
467             },
468          //============================================================
469           affiche_debug:  function (aff_infos) {
470                 if (aff_infos.Dragg) {
471                    jQuery("#Dragg").css( aff_infos.Dragg.css );
472                     jQuery("#Dragg").text(aff_infos.Dragg.texte);
473                 }
474                 if (aff_infos.debug) {
475                    jQuery("#Debug").css( aff_infos.debug.css );
476                     jQuery("#Debug").text(aff_infos.debug.texte);
477                 }
478                 if (aff_infos.debug1) {
479                     jQuery("#Debug1").css( aff_infos.debug1.css );
480                     jQuery("#Debug1").text(aff_infos.debug1.texte);
481                 }
482                 //===================================================
483                 if (aff_infos.debug2) {
484                    jQuery("#Debug2").css( aff_infos.debug2.css );
485                     jQuery("#Debug2").text(aff_infos.debug2.texte);
486                 }
487             },
488//====================================================
489             newResize: function () {
490                 var chk = eval(user_status + "_enabled");
491                 if (!cl_visible == true)  { return true; }
492                 if (chk == "") { return true;  }
493               
494                 //=================================================================
495                 
496                 var winwidth = jQuery(window).width();
497                 var winheight = jQuery(window).height();
498
499                 old_window = jQuery(window).infos();
500                 //===========================================================================
501
502                 
503                 var Type_Img = "";
504                 //====== détection du type d'images ======
505                 if (jQuery("#charlie").length > 0) {
506                     Type_Img = "charlie";
507                 } else if (jQuery("#pamoorama").length) {
508                     Type_Img = "pamoorama";
509                 } else if (jQuery("#theImage embed").length > 0) {
510                     Type_Img = "embed";
511                 } else if (jQuery("#map").length) {
512                     Type_Img = "map";
513                 } else if (jQuery("#Panorama").length) {
514                     Type_Img = "panorama";
515                 } else if (jQuery("#theImage").find("img").length > 0) {
516                     Type_Img = "img";
517                 } else if (jQuery("img").length > 0) {
518                     Type_Img = "img_autre";
519                     return;
520                 } else {
521                     return;
522                 }
523
524
525
526                 var Cadre = jQuery("#theImage").get(0);
527                 var info_Cadre = jQuery(Cadre).infos();
528                 //===============  Information cadre ======
529                 var info_the_page = jQuery("#the_page").infos();
530
531                 //=============================================================================
532                 var info_HeaderBar = jQuery("#imageHeaderBar").infos();
533
534                 var info_content = jQuery("#content").infos();
535
536
537                 var info_titrePage = jQuery("#titrePage").infos();
538
539
540                 var Zone_Affichage = jQuery("#theImage").infos();
541
542                 var info_ToolBar = jQuery("#imageToolBar").infos();
543                 var info_imageInfoBar = jQuery("#imageInfoBar").infos();
544                 var info_theHeader = jQuery("#theHeader").infos();
545
546
547                 var marge = 0;
548                 if (info_ToolBar.width > 0)
549                     marge = (Zone_Affichage.width - info_ToolBar.width) / 2;
550
551                 var marge_right = marge;
552                 var marge_left = marge;
553
554                 if (info_content.width > 100) {
555                     marge_left = 0;
556                     marge_right = info_imageInfoBar.margin.left + info_imageInfoBar.margin.right;
557                     winwidth = info_content.width;
558                     marge_right = info_imageInfoBar.width + marge_right;
559
560                 }
561                 else
562                     winwidth = Zone_Affichage.width;
563
564                 winwidth -= (marge_right + marge_left);
565
566
567
568
569                 if (Type_Img == "pamoorama") {
570
571                     mypanorama = window.myPamoorama;                   
572                     //============================================================
573                     if (typeof (mypanorama) == "undefined") return false;
574                     var myPamoorama = mypanorama;
575                     if (typeof (myPamoorama.skipInit) == "undefined") return false;
576//
577
578                     if (myPamoorama.skipInit == false) {
579                           
580                            return false;
581                     }
582
583                        var info_pamoorama = jQuery("#pamoorama").infos();
584                     var info_pamoorama_outter = jQuery("#pamoorama_outter").infos();
585                     var info_pamoorama_inner = jQuery("#pamoorama_inner").infos();
586                     var info_pamoorama_footer = jQuery("#pamoorama_footer").infos();
587                     var info_pamoorama_frame = jQuery("#pamoorama_frame").infos();
588                     TheImg = jQuery("#pamoorama");
589                     obj = TheImg.get(0);             
590                     //  myPamoorama = pamoorama;
591
592                     /*
593                     myPamoorama = new pamoorama('pamoorama',{ activateSlider:  {$PANO_ACTIVATESLIDER},
594                     width:             {$PANO_WIDTH},
595                     footercolor:               '{$PANO_FOOTERCOLOR}',
596                     captioncolor:      '{$PANO_CAPTIONCOLOR}',
597                     caption:           '{$ALT_IMG}',
598                     enableAutoscroll:  {$PANO_ENABLEAUTOSCROLL},
599                     autoscrollSpeed:   {$PANO_AUTOSCROLLSPEED},
600                     autoscrollOnLoad:  {$PANO_AUTOSCROLLONLOAD},
601                     startAutoscroll:   '{'pamooramics_startAutoscroll'|@translate}',
602                     stopAutoscroll:            '{'pamooramics_stopAutoscroll'|@translate}',
603                     loadingMessage: '{'pamooramics_loading'|@translate}',
604                     clickMessage:              '{'pamooramics_clickMessage'|@translate}',
605                     dragMessage:               '{'pamooramics_dragMessage'|@translate}'
606                     });
607                     */
608                     /*
609                     pamoorama_outter
610                     pamoorama_inner
611                     pamoorama_footer
612                     pamoorama_caption
613                     pamoorama_thumb
614                     pamoorama_frame
615                     */
616                 } else {
617                     //==== récupère Img la plus grande  =====
618                     if (jQuery("#theImg")) IMG = "#theImg";
619                     else IMG = Cadre;
620
621                     TheImg2 = jQuery().Get_Img_Maxi(IMG + " img");
622                     //=================================================================
623                     if (TheImg2 == null) {
624                         if (jQuery(Cadre).find("img").length > 0) {
625                             IMG = Cadre;
626
627
628                             TheImg = jQuery().Get_Img_Maxi("#theImage img");
629                         }
630                     } else {
631                         TheImg = TheImg2  //luciano ?
632
633                     }
634                 }
635                 //=================================================================
636
637
638                 switch (Type_Img) {
639                     case "map":
640                         var info_image = jQuery("#map").infos();
641
642                         var info_map = jQuery("#mapPicture").infos();
643
644                         marge_left = info_map.width;
645                         jQuery("#map").css("left", marge_left);
646
647                         var TheImg = jQuery("#map").get(0);
648                         img_reelle.height = info_image.height;
649                         img_reelle.width = winwidth - marge_right - marge_right;
650                         Bandeau_bas.height = 10;
651                         marge_right = 10;
652
653                         info_the_page = jQuery("#the_page").infos();
654                         ;
655
656                         break
657
658
659                     case "panorama":
660                         // return;
661
662                       
663                         TheImg = jQuery().Get_Img_Maxi("#Panorama img");
664                         info_theImage = jQuery(TheImg).infos();
665                         info_the_page = jQuery("#the_page").infos();
666
667                         break
668                     case "img":
669
670                         if (!TheImg) return;
671                         if (theme.match(RegExp("luciano", "g"))) {
672                             TheImg = jQuery("#the_page #theImg");
673                         }
674                         info_theImage = jQuery(TheImg).infos();
675                         info_the_page = jQuery("#the_page").infos();
676
677
678                         break
679                     case "img_autre":
680                         if (!TheImg) return;
681                         info_theImage = jQuery(TheImg).infos();
682                         info_the_page = jQuery("#the_page").infos();
683
684
685                         break
686                     case "embed":
687                         //
688
689                         TheImg = jQuery(Cadre).find("embed");
690
691                         info_theImage = jQuery(Cadre).infos();
692                         info_the_page = jQuery("#the_page").infos();
693                         if (rapport < 0) {
694                             img_height = parseInt(jQuery(TheImg).outerHeight());
695                             img_width = parseInt(jQuery(TheImg).outerWidth());
696
697                             img_reelle.height = img_height;
698                             img_reelle.width = img_width;
699
700                         }
701
702                         break
703                     case "charlie":
704
705                         TheImg = jQuery('#charlie object').get(0);
706                         info_theImage = jQuery(Cadre).infos();
707                         info_the_page = jQuery("#the_page").infos();
708                         if (rapport < 0) {
709                             img_height = parseInt(TheImg.height);
710                             img_width = parseInt(TheImg.width);
711
712                             img_reelle.height = parseInt(TheImg.height);
713                             img_reelle.width = parseInt(TheImg.width);
714                         }
715
716                         break
717                     case "pamoorama":
718
719                        img_reelle = { height: img_height, width: img_width };
720
721                         //=========================================================
722                         img_reelle.height = myPamoorama.imageHeight;
723                         img_reelle.width = myPamoorama.imageWidth;
724                         TheImg = myPamoorama.image;
725                         info_theImage = jQuery("#pamoorama").infos();
726                         info_the_page = jQuery("#the_page").infos();
727
728                         break
729
730
731                 }
732
733                 //=============== Vérification taille minimale  autorizée ======================
734                 var miniWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-width"), mini_width);
735                 miniHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-height"), mini_height);
736
737
738                 var maxWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-width"), winwidth, "0");
739                 maxHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-height"), winheight, "0");
740
741                 mini_width = parseInt(miniWidth);
742                 mini_height = parseInt(miniHeight);
743
744                 img_reelle.width = parseInt(img_reelle.width);
745
746
747                 if (img_reelle.width < mini_width) return true;
748
749                 img_reelle.height = parseInt(img_reelle.height);
750                 if (img_reelle.height < parseInt(mini_height)) return true;
751                 //==================================================================================   
752                 if (rapport < 0) {
753
754                     img_init.height = parseInt(img_height);
755                     img_init.width = parseInt(img_width);
756
757                     rapport = img_width / img_height;
758
759                     if (Type_Img != "map")
760                         rapport = (img_init.width / img_init.height);
761                     else
762                         rapport = 0;
763
764                 }
765
766
767                 //=============== Zone d'affichage ============================
768
769                 borderW = Zone_Affichage.borderwidth.left;
770                 borderW += Zone_Affichage.borderwidth.right;
771
772
773                 Zone_Affichage.width = winwidth - borderW;
774
775
776
777                 var Licence = jQuery(".licencetag");
778                 info_Licence = jQuery(".licencetag").infos();
779
780                 jQuery("#theImage #theImg IMG").css("marginTop", "0px")
781                 //========== Correction en fonction du thème =============================
782                 var correction = 0;
783                 if (theme.match(RegExp("sobre", "g"))) {
784
785                     correction = -info_Licence.padding.top;
786
787                 } else if (theme.match(RegExp("Pure", "g"))) {
788                     correction += 0; //??
789                 } else if (theme.match(RegExp("luciano", "g"))) {
790                     correction = 0; //??
791
792                 } else if (theme.match(RegExp("simple", "g"))) {
793                     correction += 0; //??
794                 } else if (theme.match(RegExp("gally", "g"))) {
795                     correction += 0; //??
796
797                 }
798                 //================ Licence  ========================
799
800                 if (Licence.length > 0) {
801                     jQuery(".licencetag").css("padding", "0px");
802
803                 }
804                 //====================================================
805                 info_img = jQuery(TheImg).infos();
806                 img_top = Bandeau;
807
808                 Marge_Basse = parseInt(marge_basse || 0); // hors bandeau
809                 //==========================================================================
810                 h = 0;
811                 if(Bandeau_bas.height <0) Bandeau_bas.height =0 ;
812
813                 Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction;
814                 var Image_height = Zone_Affichage.height - Bandeau_bas.height - Bandeau_bas.marge.top - Bandeau_bas.marge.bottom;
815
816                 //=============================================================
817                 var height_user = eval(user_status + "_height");
818                 var reg1 = new RegExp("%", "g");
819                 if (height_user.match(reg1))
820                     Image_height = Image_height * parseInt(height_user) / 100;
821                 else
822                     Image_height = parseInt(height_user);
823
824                 echelle_max = parseFloat(echelle_max, '3');
825                 var echelle = parseFloat(Image_height / img_reelle.height, 3);
826
827                 if (echelle > echelle_max) { echelle = echelle_max; }
828                 Image_height = parseInt(img_reelle.height * echelle);
829                 //============================================================
830
831                 var Image_width;
832                 if (rapport > 0)
833                     Image_width = parseInt(Image_height * rapport);
834                 else if (Type_Img == "map") {
835                     Image_width = Zone_Affichage.width - marge_left - marge_right;
836                 } else {
837                     Image_width = Zone_Affichage.width;
838                 }
839
840                 //===============================================================
841                 align_auto = "center";
842                 if (jQuery("#theImg").css("textAlign"))
843                     align_auto = jQuery("#theImg").css("textAlign");
844                 var widthmin = winwidth;
845
846                 if (check_auto_w == 'checked="checked"') {
847                     // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) {
848                     //==== largeur à atteindre ===
849                     var width_user = eval(user_status + "_width");
850                     // Largeur maximale en fonction du statut
851                     if (width_user.match(reg1))
852                     // pourcentage
853                         widthmin = widthmin * parseInt(width_user) / 100;
854                     else
855                         widthmin = parseInt(width_user);
856                     var marges = marges_llgbo;
857                     widthmin -= info_img.borderwidth.left;
858                     widthmin -= info_img.borderwidth.right;
859
860                     widthmin -= marges;
861                     if (Image_width > widthmin) {
862                         //   Image_width largeur à atteindre
863                         //  Calcul du rapport d'agrandissement
864                         var echelle_w = parseFloat((widthmin) / img_reelle.width, 3);
865                         if (echelle_w > echelle_max) { echelle_w = echelle_max; }
866                         Image_width = parseInt(img_reelle.width * echelle_w);
867                         if (rapport > 0)
868                             Image_height = parseInt(Image_width / rapport);
869                     }
870
871
872
873                 }
874
875
876                 // }
877                 //===================================================
878
879
880
881                 zoom = echelle;
882                 //=============LLGBO2 ===========================
883
884
885                 if (marges_llgbo > 0) {
886
887                     t1 = jQuery(llgboframe).infos();
888                     if (!TheImg.src) {
889                         TheImg = jQuery(TheImg).find("img").get(0)
890                     }
891                     if (TheImg.src) {
892                   
893                         Image_width -= marges_llgbo; // réduction frame
894                         Image_height -= marges_llgbo; // réduction frame
895                         if (rapport > 1) {
896                             if (Image_width > winwidth) {
897                                 jQuery("#gbo").width(winwidth);
898                                 jQuery("#gbo").height(winheight);
899                                 jQuery("#gbo").css("width", winwidth + "px");
900                                 jQuery("#gbo").css("height", winheight + "px");
901                             }
902                             else {
903                                 jQuery("#gbo").width(Image_width);
904                                 jQuery("#gbo").height(Image_height);
905                                 jQuery("#gbo").css("width", Image_width + "px");
906                                 jQuery("#gbo").css("height", Image_height + "px");
907                             }
908
909                             t1 = jQuery("#gbo div:last").infos();
910
911                             Image_width = t1.width - (t1.borderwidth.left + t1.borderwidth.right);
912                             Image_height = parseInt(Image_width / rapport);
913
914                             jQuery("#gbo").height(Image_height + marges_llgbo);
915                             jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
916
917
918                         } else {
919                         Image_width -= (marges_llgbo/2); // réduction frame
920                         Image_height -= (marges_llgbo/2); // réduction frame
921                             if (Image_width > winwidth) {
922                                 jQuery("#gbo").width(winwidth);
923                                 jQuery("#gbo").height(winheight);
924                                 jQuery("#gbo").css("width", winwidth + "px");
925                                 jQuery("#gbo").css("height", winheight + "px");
926                             }
927                             else {
928                                 jQuery("#gbo").width(Image_width);
929                                 jQuery("#gbo").height(Image_height);
930                                 jQuery("#gbo").css("width", Image_width + "px");
931                                 jQuery("#gbo").css("height", Image_height + "px");
932                             }
933
934
935                             jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
936                             jQuery("#gbo").height(Image_height + marges_llgbo);
937
938                             jQuery("#gbo").css("width", Image_width + marges_llgbo + "px");
939                             jQuery("#gbo").width(Image_width + marges_llgbo);
940 
941
942                         }
943                         //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
944                         a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]");
945                         a1 = jQuery("area[rel=prev]");
946                         a2 = jQuery("area[rel=next]");
947                         a3 = jQuery("area[rel=up]");
948                         nb_zone = 3;
949                         if (a1.length == 0) {
950                             nb_zone -= 1;
951                         }
952                         if (a2.length == 0) {
953                             nb_zone -= 1;
954                         }
955
956
957                         var Largeur_zone = (Image_width / nb_zone);
958                         var Hauteur_zone = (Image_height);
959                         var init_zone = 0;
960
961                         if (a1.length > 0) {
962                             coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone };
963
964                             jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
965                             init_zone += Largeur_zone;
966                         }
967
968                         coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
969
970                         if (a0.length > 0) {
971                             jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" });
972                             jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" });
973                         } else {
974                             jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" });
975                         }
976                         init_zone += Largeur_zone;
977
978                         if (a2.length > 0) {
979                             coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
980                             jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
981                         }
982                     }
983                 }
984
985                 //================ Zone affichage =========================
986                 //  Image_height, Image_width = valeur a atteindre.
987                 if (theme.match(RegExp("luciano", "g"))) {
988                     //---- information en dehors du cadre
989                  //   Zone_Affichage.height -= Bandeau_bas.height - 20;
990                     jQuery(Cadre).height(Zone_Affichage.height -= Bandeau_bas.height);
991                   
992                 }
993
994                 //=========================================================
995
996                 //  jQuery(Cadre).css("top", "0px");
997                 jQuery("#standard").css("top", 0 + "px");
998                 jQuery("#comments").css("top", 0 + "px");
999
1000
1001                 jQuery(Cadre).width(Zone_Affichage.width);
1002
1003                 //============= Remise à l'échelle =======================
1004
1005                 img_finale.height = Image_height;
1006                 img_finale.width = Image_width;
1007
1008                 //=========================================================================
1009
1010
1011                 if (typeof (gmaps) != "undefined") {
1012                     Gmap_ = gmaps.maps[0];
1013                     if (Gmap_.sizeMode == 'A') {
1014                         jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" });
1015
1016                     }
1017                 }
1018                 //============= flv,mov,mpg  ok
1019                 /* wmv nok
1020                 * avi nok
1021                 //===========================================
1022                 */
1023                 if (Type_Img == "charlie") {
1024                     t1 = jQuery("#charlie").infos();
1025
1026                     /**/
1027                     pdf = 2 * parseInt(jQuery(".none_2").css("paddingRight"));
1028                     jQuery("#charlie").css({
1029                         width: Image_width + pdf ,
1030                         height: Image_height,
1031                         margin: "auto"
1032                     });
1033
1034                     jQuery(".none_2").width(Image_width) ;
1035                     jQuery(".none_2").height( Image_height) ;
1036
1037
1038                     jQuery("#player").css("width", Image_width + 100 + "px");
1039                     jQuery("#player").css("height", Image_height);
1040
1041                     jQuery("#embedplayer").css("width", Image_width);
1042                     jQuery("#embedplayer").css("height", Image_height);
1043
1044
1045                     jQuery("object").width(Image_width);
1046                     jQuery("object").height(Image_height);
1047
1048
1049                 } else if (Type_Img == "panorama") {
1050
1051                     // -----     jQuery(TheImg).panorama2(img_finale.height, img_finale.width);
1052                     // jQuery(TheImg).height(img_finale.height);
1053                     // jQuery(TheImg).width(img_finale.width);
1054                     jQuery("#Panorama div").height(Image_height);
1055                     //  class=simple_panorama
1056
1057                     jQuery(".panorama-viewport").css("left", "2px");
1058                     jQuery(".panorama-viewport").css("width", "auto");
1059                     //   setTimeout("cl_Timer()", 500);
1060
1061                 } else if (Type_Img == "pamoorama") {
1062
1063                     img_height = myPamoorama.imageHeight
1064
1065                     marge_left += 2;
1066
1067                     if (theme.match(RegExp("simple", "g"))) {
1068                         marge_right = 2;
1069                     }
1070                     new_width = Zone_Affichage.width - marge_right - marge_left;
1071                     
1072                     myPamoorama.options.width = new_width;
1073                     info_theImage.height = img_reelle.height + info_pamoorama_footer.height
1074                     //====================================================
1075                     jQuery("#pamoorama").css({
1076                         marginLeft: "auto",
1077                         marginRight: "auto",
1078                         height: info_theImage.height + "px",
1079                         width: new_width + "px"
1080                     });
1081                     jQuery("#pamoorama").width(new_width);
1082
1083                     //====================================================
1084                 info_pamoorama = jQuery("#pamoorama").infos();
1085                  img_finale.height=info_pamoorama.height-info_pamoorama_footer.height;
1086                  img_finale.width=new_width;
1087
1088                 jQuery("#pamoorama_outter").width(new_width) ;
1089                 jQuery("#pamoorama_outter").height(info_pamoorama.height-info_pamoorama_footer.height);
1090                 
1091
1092
1093                 jQuery("#pamoorama_outter").css({width:new_width+"px",
1094                 height:info_pamoorama.height-info_pamoorama_footer.height+"px"
1095                 } );
1096          //     
1097                     //====================================================
1098                     var info_pamoorama = jQuery("#pamoorama").infos();
1099                     var info_pamoorama_outter = jQuery("#pamoorama_outter").infos();
1100                     var info_pamoorama_inner = jQuery("#pamoorama_inner").infos();
1101                     var info_pamoorama_footer = jQuery("#pamoorama_footer").infos();
1102                     var info_pamoorama_frame = jQuery("#pamoorama_frame").infos();
1103
1104                     info_frame = jQuery(myPamoorama.frame).infos();
1105               /*   myPamoorama.ratio = new_width / 200;
1106                  jQuery("#pamoorama_frame").width(myPamoorama.ratio);
1107                  jQuery("#pamoorama_frame").css("width", myPamoorama.ratio + "px");
1108                 jQuery("#pamoorama_footer img").width(200)
1109                 jQuery("#pamoorama_footer img").css({ width: "200px", height: info_pamoorama_footer.height+"px" });
1110                 jQuery("#pamoorama_footer").width(new_width) ;
1111                 jQuery("#pamoorama_footer").css({width:new_width+"px"})
1112
1113                     jQuery(TheImg).height(img_finale.height);
1114                     jQuery(TheImg).width(img_finale.width);
1115                     jQuery(TheImg).css("height", img_finale.height + "px ");
1116                     jQuery(TheImg).css("width", img_finale.width + "px ");
1117*/
1118                     zoom = Image_height / img_height;
1119
1120
1121
1122
1123                 } else if (TheImg.src) {
1124                     //--- background ?? ---
1125                     jQuery(TheImg).height(img_finale.height);
1126                     jQuery(TheImg).width(img_finale.width);
1127                     jQuery(TheImg).css("height", img_finale.height + "px ");
1128                     jQuery(TheImg).css("width", img_finale.width + "px ");
1129
1130                 } else {
1131                     //===map ? ===
1132                     jQuery(TheImg).height(img_finale.height);
1133                     jQuery(TheImg).width(img_finale.width);
1134                     jQuery(TheImg).css("height", img_finale.height + "px ");
1135                     jQuery(TheImg).css("width", img_finale.width + "px ");
1136
1137                 }
1138
1139                 if (DEBUG == "true") {
1140
1141                     jQuery().affiche_debug({ debug3: { texte: "Debug:Bandeau : " + Bandeau,
1142                         css: {
1143                             opacity: 0.5,
1144                             filter: 'alpha(opacity:50)',
1145                             position: "absolute",
1146 
1147                         }
1148                     },
1149                     debug1: { texte: "Debug1:img_finale.height : " + img_finale.width + " height:" + img_finale.height,
1150                             css: {
1151                                 opacity: 0.5,
1152                                 filter: 'alpha(opacity:50)',
1153                                 position: "absolute",
1154                   
1155                             }
1156                         },
1157                         debug2: { texte: "Debug2:Bandeau_bas bottom :" + Bandeau_bas.bottom,
1158                             css: {
1159                                 opacity: 0.5,
1160                                 filter: 'alpha(opacity:50)',
1161                                 position: "absolute",
1162                             
1163                             }
1164                         }
1165                     });
1166
1167                 }
1168                 jQuery("#navThumbPrev").css({ overflow: "hidden"
1169                 });
1170                 jQuery("#navThumbNext").css({
1171                     overflow: "hidden"
1172                 });
1173                 try {
1174                     if (theme.match(RegExp("gally", "gi"))) {
1175
1176                         //===========================================================================
1177                         initializeImageMode("resize");
1178                         if (jQuery("#navThumbPrev").length > 0) {
1179                             jQuery("#navThumbPrev").css({ height: info_img.height + "px",
1180                                 top: info_img.top + 20 + "px", overflow: "hidden"
1181                             });
1182                             if (Type_Img == "map")
1183                                 jQuery("#navThumbPrevContainer").css({ background: 'none' });
1184                         }
1185                         if (jQuery("#navThumbNext").length > 0) {
1186                             jQuery("#navThumbNext").css({ height: info_img.height + "px",
1187                                 top: info_img.top + 20 + "px", overflow: "hidden"
1188                             });
1189
1190                         }
1191                         if (Type_Img == "map")
1192                             jQuery("#navThumbNextContainer").css({ background: 'none' });
1193
1194
1195
1196                         if (!theme.match(RegExp("lapis", "gi"))) { initializeImageMode("resize"); }
1197                     } else if (theme.match(RegExp("simple", "g"))) {
1198
1199                         jQuery("#imageToolBar").css("position", "static");
1200                         info_imageInfoBar = jQuery("#imageInfoBar").infos();
1201                         if (info_imageInfoBar.bottom < info_img.bottom) {
1202                             jQuery("#imageInfoBar").height(info_img.bottom);
1203                         }
1204
1205                     } else {
1206
1207                         //    jQuery("#imageToolBar").css("position", "static");
1208                     }
1209                 } catch (e) {
1210
1211                 }
1212                 //  --- rglage de la hauteur de page en fonction du copyright-----------
1213                 if (typeof (pos) == "undefined") pos = jQuery("#copyright").infos();
1214                 if (pos != jQuery("#copyright").infos())
1215                     pos = jQuery("#copyright").infos();
1216                 if (pos.top > 100) jQuery("#the_page").height(pos.top);
1217                  if (!theme.match(RegExp("luciano", "gi"))) {
1218                 jQuery("#linkNext").css({ height:"80px",width: "200px", overflow: "hidden" });
1219                 jQuery("#linkPrev").css({  height:"80px",width: "200px", overflow: "hidden" });
1220                 jQuery(".navThumb img").css({ height:"80px",width:"", overflow: "hidden" });
1221                 }
1222                                 return true;
1223
1224
1225
1226
1227
1228                 //_____________________________________________________
1229             } // Resize();
1230
1231
1232             //======================================================================
1233
1234
1235         });            // fin extend
1236
1237     } // function
1238);   
1239
Note: See TracBrowser for help on using the repository browser.