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

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

[Autosize][beta] fix compatiblity with charlie.

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