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

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

[Autosize][beta] save

File size: 50.6 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//=================================================================================================
26new_width=0;
27function Wait_Pamoorama() {
28               mypanorama = window.myPamoorama;
29               if (!mypanorama) setTimeout("Wait_Pamoorama()", 500);
30                 if ( mypanorama.skipInit==false) setTimeout("Wait_Pamoorama()", 500);
31             
32              if(! jQuery().newResize()) setTimeout("Wait_Pamoorama()", 500);
33                 if (  myPamoorama.options.width == new_width ) return 
34}
35 
36 
37//=========================================================
38
39jQuery(document).ready(
40     function (jQuery) {
41         jQuery(window).load(function () {
42
43             //======= cl_conflit ======
44             if (DEBUG == "false") {
45                 jQuery("#Debug").hide();
46                 jQuery("#Debug1").hide();
47                 jQuery("#Debug2").hide();
48             }
49 
50             img_top = "0";
51             rapport = -1;
52             llgboframe = jQuery("#gbo div:first");
53             marges_llgbo = 0;
54             pos = 0;
55 
56          //=========================================================
57
58             if (llgboframe.length > 0) {
59                 ll1 = jQuery(llgboframe).infos();
60                 ll2 = jQuery("#gbo div:last").infos();
61                 marges_llgbo = (ll1.width - ll2.width) + ll2.borderwidth.left + ll2.borderwidth.right;
62             }
63                   
64             //=============================================================
65             function cl_Timer() {
66                 //   if (!jQuery.browser.msie) { jQuery(function () { alert(jQuery.browser.version); }); }
67                 if (jQuery.browser.msie && parseInt(jQuery.browser.version) < 8)
68                     alert(jQuery.browser.version);
69                 panoramaContainer = jQuery(".panorama-container");
70                 n = document.scripts[6]; //12--14affiche_script ;
71                 t = n.src;
72                 currentPosition = 0 - parseInt(jQuery(panoramaContainer).css('margin-left'));
73                 if (currentPosition == NaN) return;
74                 if (currentPosition > 1000)
75                     jQuery(panoramaContainer).css('margin-left', "0px")
76                 setTimeout("cl_Timer()", 500);
77             }
78
79           
80             //============================================================
81             /*
82             *
83             */
84             function Info_entete(Parent) {
85
86                 var info_imageToolBar = jQuery("#imageToolBar").infos();
87                 if (info_imageToolBar.position == "absolute") {
88                     jQuery("#imageToolBar").css("position", "relative");
89                     jQuery("#imageToolBar").css("top", 0 + "px");
90                 }
91
92                 var info_theImage = jQuery("#theImage").infos();
93
94                 if (info_theImage.position == "relative") {
95                     //--- passage relative ==> static ===/
96                     jQuery("#theImage").css("position", "static");
97                     info_theImage = jQuery("#theImage").infos();
98
99                 }
100                 if (info_theImage.position == "absolute") {
101                     //--- passage absolute ==> static ===/
102                     jQuery("#theImage").css("position", "static");
103                     info_theImage = jQuery("#theImage").infos();
104
105                 }
106
107                 marge_top = Info_the_page.top +
108                                     Info_the_page.borderwidth.top +
109                                     info_theImage.borderwidth.top;
110
111                 img_top = info_theImage.top + info_theImage.borderwidth.top;
112                 return { marge_top: marge_top, img_top: img_top };
113
114             }
115
116             /* Récupère les informations sur la description.
117             *
118             */
119             function Info_description(Parent) {
120                 //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
121                 //=============================================================================
122                 var info_description = { top: 0, bottom: 0, height: 0 };
123                 if (theme.match(RegExp("simple", "gi"))) {
124                     jQuery("#" + Parent).css({ padding: "0px",
125                         marginLeft: "0px",
126                         marginRight: "auto",
127                         marginTop: "0px",
128                         marginBottom: "0px", position: "absolute", top: Bandeau + "px"
129                     });
130                 } else {
131
132                     jQuery("#" + Parent).css({ padding: "0px",
133                         marginLeft: "auto",
134                         marginRight: "auto",
135                         marginTop: "0px",
136                         marginBottom: "0px"
137                     });
138
139
140                 }
141                 //   jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px "    });
142                 if (theme.match(RegExp("luciano", "g"))) {
143                     info_img = jQuery("#" + Parent + " #theImg img").infos();
144
145                 } else {
146
147                     info_img = jQuery("#" + Parent + " img").infos();
148                 }
149
150                 info_description.marge = { bottom: info_img.padding.bottom + info_img.margin.bottom + info_img.borderwidth.bottom,
151                     top: info_img.padding.top + info_img.borderwidth.top
152                 }
153
154                 info_description.top = Bandeau + info_img.top + info_img.bottom + info_img.margin.bottom + info_img.borderwidth.bottom;
155                 //=============================================================================
156                 info_gbo = jQuery("#gbo").infos();
157                 if (info_description.top < info_gbo.bottom)
158                     info_description.top = info_gbo.bottom;
159                 //=============================================================================
160                 info_desc = jQuery("#" + Parent + " p:first").infos();
161                 if (info_desc.bottom < info_img.bottom)
162                     info_desc.bottom = info_img.bottom;
163
164                 //  if (info_desc.top > info_img.bottom)
165                 //     info_description.top = info_desc.top;
166
167                 if (jQuery("#Panorama").length) {
168                     Type_Img = "panorama";
169                     //  cl_visible = false;
170
171                 }
172                 info_table = jQuery(".infoTable").infos();
173
174                 if (info_table.top > info_description.bottom)
175                     info_description.bottom = info_table.top;
176                 //===========================================================================
177
178                 info_licencetag = jQuery(".licencetag").infos();
179
180
181                 if (info_licencetag.bottom > 0) {
182                     jQuery(".licencetag").css("border", "solid 5px transparent");
183                     if (info_licencetag.bottom > info_description.bottom) {
184                         info_description.bottom = info_licencetag.bottom;
185                     }
186                     else
187                         info_description.bottom += info_table.margin.top + info_table.padding.top;
188
189                 }
190                 //=============================================================================
191                 if (theme.match(RegExp("gally", "gi"))) {
192                     if (!theme.match(RegExp("lapis", "gi"))) {
193                         info_description.bottom = info_description.bottom
194                     }
195                 }
196
197
198
199
200
201                 if (info_description.top < 1)
202                     info_description.top = info_description.bottom;
203
204
205                 if (info_description.bottom < info_description.top) {
206                     info_description.bottom = info_description.top;
207
208                     info_desc = jQuery("#" + Parent + " p:last").infos();
209
210                     if (info_desc.bottom > info_img.bottom)
211                         info_description.bottom = info_desc.bottom;
212                 }
213
214
215                 if (theme.match(RegExp("gally", "g"))) {
216                     if (!theme.match(RegExp("lapis", "gi"))) {
217                         info_copyright = jQuery("#copyright").infos();
218                         info_description.bottom += info_copyright.height;
219                     }
220                 }
221
222                 if (theme.match(RegExp("luciano", "g"))) { info_description.bottom -= 30 }
223
224                 info_description.height = info_description.bottom - info_description.top;
225
226
227                 if (DEBUG == "true") {
228                        jQuery("#Debug").css('display', 'block');
229                         jQuery("#Dragg").css('display', 'block');
230                     jQuery("#Debug1").show();
231                     jQuery("#Debug2").show();             
232                 Bandeau_bas = info_description;
233                     jQuery().affiche_debug({ debug: {texte:"Debug:Bandeau : " + Bandeau,
234                     css:{
235                         opacity: 0.5,
236                         filter: 'alpha(opacity:50)',
237                         position: "absolute",
238                         width: "800px",
239                         border: "solid 1px green",
240                         top: Bandeau + "px"}
241                     },
242                         debug1:{ texte:"Debug1:Bandeau_bas top : " + Bandeau_bas.top + " height:" + Bandeau_bas.height,
243                         css:{ 
244                         opacity: 0.5,
245                         filter: 'alpha(opacity:50)',
246                         position: "absolute",
247                         border: "solid 1px green",
248                         top: Bandeau_bas.top + "px",
249                         width: (800) + "px",
250                         height: Bandeau_bas.height + "px"
251                     }
252                     },
253                         debug2: { texte: "Debug2:Bandeau_bas bottom :" + Bandeau_bas.bottom ,
254                         css:{
255                         opacity: 0.5,
256                         filter: 'alpha(opacity:50)',
257                         position: "absolute",
258                         left: '50px',
259                         width: (800) + "px",
260                         border: "solid 1px green", top: Bandeau_bas.bottom + "px"
261                         }
262                         }
263                     });
264
265
266                 }
267
268                 if (check_desc_v != 'checked="checked"') {
269                     info_description.height = 0;
270                 }
271
272
273
274
275                 return info_description;
276
277             }
278
279             /*
280             *
281             */
282
283             //============================================================
284
285             /* jQuery */
286             img_init = { height: img_height, width: img_width };  // taille initiale
287             img_defaut = { height: scaled_height, width: scaled_width };
288             img_reelle = { height: img_height, width: img_width };
289             img_finale = { height: 0, width: 0 };
290             Zone_Affichage = { height: 0, width: 0 };
291
292             //============================================================
293
294             Info_the_page = jQuery("#the_page").infos();
295             Zone_Affichage = jQuery("#theImage").infos();
296
297             Bandeau = 0;
298             Bandeau_t = Info_entete("theImage")
299             Bandeau = Bandeau_t.img_top;
300             Bandeau_bas = 0;
301             Bandeau_bas = Info_description("theImage");
302             var old_window = { width: 0, height: 0 };
303
304
305             //===================================================================     
306             /*
307             * window .resize
308             */
309
310
311             jQuery(window).resize(
312               function (event, ui) {       
313               event = event || window.event;
314       
315                   if (event.type == "resize")                     
316                  { 
317                    myevent = arguments[0] = jQuery.event.fix(event || window.event);
318                    myevent.currentTarget = this;
319                     // Namespaced event handlers
320                   var namespaces = myevent.type.split(".");
321                     myevent.type = namespaces.shift();
322                   }
323                   if (typeof (init_resize) == "undefined") init_resize = false;
324
325                   new_window = jQuery(window).infos();
326                   init_resize = (new_window.width == old_window.width);
327                   if (init_resize == false) {
328                       init_resize = Resize();
329                   }
330                   init_resize = (new_window.height == old_window.height)
331                   if (init_resize == false)
332                       init_resize = Resize(); ;
333               });
334
335             //============== initialisation ===================
336             fade_in = parseInt(fade_in);
337            if (fade_in==0 )
338                 {
339                 jQuery("#theImage").css({
340                         opacity: 1,
341                         filter: 'alpha(opacity:100)'}
342                 )}else{
343                 jQuery("#theImage").animate(
344                         { opacity: 1 }, fade_in   , "swing"
345                        );
346             }
347
348             var pos;
349             var set_p = false;
350             function Resize() {
351
352                  jQuery().newResize();
353                     
354               
355             }
356
357             //===================================================
358             elem=jQuery("#pamoorama").get(0) ;
359if(elem)
360{           type="propertychange";
361            handle=jQuery().onPropertyChange;
362
363                        if (elem.addEventListener) {// Firefox, Opera, Google Chrome and Safari
364                            elem.addEventListener('DOMAttrModified', handle, false);
365                        } else if (elem.attachEvent) {
366                            elem.attachEvent("on" + type, handle);
367                        }
368    }
369             jQuery().newResize(); 
370     
371 
372         }); // window.onload
373         /* Extension
374         * affiche_debug
375
376         * resize
377         * :
378         */
379         //=========================================================
380 
381
382         jQuery.fn.extend({
383                      //=============================================================
384           onPropertyChange:  function (e) {
385           return ;
386
387                 if(jQuery.browser.msie)
388                 {    var el = e.srcElement;
389                        ID = el.id;               
390                        Prop = e.propertyName.split(".");
391                        if(Prop.length < 2) return ;                     
392                          Property = Prop[1];
393                 }
394                 else
395                 {ID =this.id ;
396                     Prop = e.attrName ;
397                     Property = e.newValue  ;
398                 }
399           jQuery().affiche_debug({ Dragg: {texte:"onPropertyChange : " + ID,
400                     css:{
401                         opacity: 0.5,
402                         filter: 'alpha(opacity:50)',
403                         position: "absolute",
404                         width: "500px",
405                         border: "solid 1px green",
406                         top: 130 + "px"}
407                     }
408                     });
409                  mypanorama = window.myPamoorama;
410                 if (Property.match("width","gi")) {
411                   
412                 
413                if(!mypanorama) 
414                  setTimeout("wait_Pamoorama()", 500); 
415                   
416
417
418               if(jQuery("#pamoorama_outter").length == 0)
419               {
420               elem=jQuery("#pamoorama").get(0);
421                 type="propertychange";
422            handle=jQuery().onPropertyChange;
423
424                     if (elem.addEventListener) {// Firefox, Opera, Google Chrome and Safari
425                            elem.addEventListener('DOMAttrModified', handle, false);
426                        } else if (elem.attachEvent) {
427                            elem.attachEvent("on" + type, handle);
428                        }
429                  setTimeout("wait_Timer()", 600); 
430                  }
431               else if( jQuery("#pamoorama_footer").length == 0)
432                   setTimeout("wait_Pamoorama()", 600); 
433                else if( jQuery("#pamoorama_frame").length == 0)
434                    setTimeout("wait_Pamoorama()", 600); 
435                 }
436                 return;
437             },
438                     /*
439             * recherche la plus grande image (hauteur ou largeur)
440             */
441          Get_Img_Maxi:   function (myobj) {
442                 var w00 = 0;
443                 var TheImg = null;
444                 jQuery(myobj).each(function (i) {
445                     w0 = img_reelle.width;
446                     h0 = img_reelle.height;
447                     if (h0 > w0) w0 = h0;
448                     if (w0 > w00) {
449                         if (!this.src.match(RegExp(".png", "g")))
450                             if (!this.src.match(RegExp(thumbnail, "g"))) {
451                                 TheImg = this;
452                                 w00 = w0;
453                             }
454
455                     }
456                 });
457                 return TheImg;
458             },
459          //============================================================
460           affiche_debug:  function (aff_infos) {
461                 if (aff_infos.Dragg) {
462                    jQuery("#Dragg").css( aff_infos.Dragg.css );
463                     jQuery("#Dragg").text(aff_infos.Dragg.texte);
464                 }
465                 if (aff_infos.debug) {
466                    jQuery("#Debug").css( aff_infos.debug.css );
467                     jQuery("#Debug").text(aff_infos.debug.texte);
468                 }
469                 if (aff_infos.debug1) {
470                     jQuery("#Debug1").css( aff_infos.debug1.css );
471                     jQuery("#Debug1").text(aff_infos.debug1.texte);
472                 }
473                 //===================================================
474                 if (aff_infos.debug2) {
475                    jQuery("#Debug2").css( aff_infos.debug2.css );
476                     jQuery("#Debug2").text(aff_infos.debug2.texte);
477                 }
478             },
479//====================================================
480             newResize: function () {
481           
482                 //_____________________________________________________
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                            setTimeout("Wait_Pamoorama()", 500);
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;
741
742                 img_reelle.height = parseInt(img_reelle.height);
743                 if (img_reelle.height < parseInt(mini_height)) return;
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
800
801                 
802                 img_top = Bandeau;
803
804                 Marge_Basse = parseInt(marge_basse || 0); // hors bandeau
805                 //==========================================================================
806                 h = 0;
807                 Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction;
808                 var Image_height = Zone_Affichage.height - Bandeau_bas.height - Bandeau_bas.marge.top - Bandeau_bas.marge.bottom;
809
810                 //=============================================================
811                 var height_user = eval(user_status + "_height");
812                 var reg1 = new RegExp("%", "g");
813                 if (height_user.match(reg1))
814                     Image_height = Image_height * parseInt(height_user) / 100;
815                 else
816                     Image_height = parseInt(height_user);
817
818                 echelle_max = parseFloat(echelle_max, '3');
819                 var echelle = parseFloat(Image_height / img_reelle.height, 3);
820
821                 if (echelle > echelle_max) { echelle = echelle_max; }
822                 Image_height = parseInt(img_reelle.height * echelle);
823                 //============================================================
824
825                 var Image_width;
826                 if (rapport > 0)
827                     Image_width = parseInt(Image_height * rapport);
828                 else if (Type_Img == "map") {
829                     Image_width = Zone_Affichage.width - marge_left - marge_right;
830                 } else {
831                     Image_width = Zone_Affichage.width;
832                 }
833
834                 //===============================================================
835                 align_auto = "center";
836                 if (jQuery("#theImg").css("textAlign"))
837                     align_auto = jQuery("#theImg").css("textAlign");
838                 var widthmin = winwidth;
839
840                 if (check_auto_w == 'checked="checked"') {
841                     // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) {
842                     //==== largeur à atteindre ===
843                     var width_user = eval(user_status + "_width");
844                     // Largeur maximale en fonction du statut
845                     if (width_user.match(reg1))
846                     // pourcentage
847                         widthmin = widthmin * parseInt(width_user) / 100;
848                     else
849                         widthmin = parseInt(width_user);
850                     var marges = marges_llgbo;
851                     widthmin -= info_img.borderwidth.left;
852                     widthmin -= info_img.borderwidth.right;
853
854                     widthmin -= marges;
855                     if (Image_width > widthmin) {
856                         //   Image_width largeur à atteindre
857                         //  Calcul du rapport d'agrandissement
858                         var echelle_w = parseFloat((widthmin) / img_reelle.width, 3);
859                         if (echelle_w > echelle_max) { echelle_w = echelle_max; }
860                         Image_width = parseInt(img_reelle.width * echelle_w);
861                         if (rapport > 0)
862                             Image_height = parseInt(Image_width / rapport);
863                     }
864
865
866
867                 }
868
869
870                 // }
871                 //===================================================
872
873
874
875                 zoom = echelle;
876                 //=============LLGBO2 ===========================
877
878
879                 if (marges_llgbo > 0) {
880
881                     t1 = jQuery(llgboframe).infos();
882                     if (!TheImg.src) {
883                         TheImg = jQuery(TheImg).find("img").get(0)
884                     }
885                     if (TheImg.src) {
886
887                         Image_width -= marges_llgbo; // réduction frame
888                         Image_height -= marges_llgbo; // réduction frame
889                         if (rapport > 1) {
890                             if (Image_width > winwidth) {
891                                 jQuery("#gbo").outerWidth(winwidth);
892                                 jQuery("#gbo").css("width", winwidth + "px");
893                             }
894                             else {
895                                 jQuery("#gbo").outerWidth(Image_width);
896                                 jQuery("#gbo").css("width", Image_width + "px");
897                             }
898
899                             t1 = jQuery("#gbo div:last").infos();
900
901                             Image_width = t1.width - (t1.borderwidth.left + t1.borderwidth.right);
902                             Image_height = parseInt(Image_width / rapport);
903
904                             jQuery("#gbo").outerHeight(Image_height + marges_llgbo);
905                             jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
906                             if (jQuery.browser.msie) {
907                                 jQuery("#gbo").css("paddingBottom", 17 + "px");
908                             }
909
910                         } else {
911                             Image_height -= 4;
912                             Image_width -= 4;
913                             if (Image_width > winwidth) {
914                                 jQuery("#gbo").outerWidth(winwidth);
915                                 jQuery("#gbo").css("width", winwidth + "px");
916                             }
917                             else {
918                                 jQuery("#gbo").outerWidth(Image_width);
919                                 jQuery("#gbo").css("width", Image_width + "px");
920                             }
921
922                             jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
923                             jQuery("#gbo").height(Image_height + marges_llgbo);
924
925                             jQuery("#gbo").css("width", Image_width + marges_llgbo + "px");
926                             jQuery("#gbo").width(Image_width + marges_llgbo);
927
928
929
930                             if (jQuery.browser.msie) {
931                                 jQuery("#gbo").css("paddingBottom", 17 + "px");
932                             }
933
934                         }
935                         //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
936                         a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]");
937                         a1 = jQuery("area[rel=prev]");
938                         a2 = jQuery("area[rel=next]");
939                         a3 = jQuery("area[rel=up]");
940                         nb_zone = 3;
941                         if (a1.length == 0) {
942                             nb_zone -= 1;
943                         }
944                         if (a2.length == 0) {
945                             nb_zone -= 1;
946                         }
947
948
949                         var Largeur_zone = (Image_width / nb_zone);
950                         var Hauteur_zone = (Image_height);
951                         var init_zone = 0;
952
953                         if (a1.length > 0) {
954                             coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone };
955
956                             jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
957                             init_zone += Largeur_zone;
958                         }
959
960                         coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
961
962                         if (a0.length > 0) {
963                             jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" });
964                             jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" });
965                         } else {
966                             jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" });
967                         }
968                         init_zone += Largeur_zone;
969
970                         if (a2.length > 0) {
971                             coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
972                             jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
973                         }
974                     }
975                 }
976
977                 //================ Zone affichage =========================
978                 //  Image_height, Image_width = valeur a atteindre.
979                 if (theme.match(RegExp("luciano", "g"))) {
980                     //---- information en dehors du cadre
981                     Zone_Affichage.height -= Bandeau_bas.height - 20;
982                     jQuery(Cadre).height(Zone_Affichage.height);
983
984                 }
985
986                 //=========================================================
987
988                 //  jQuery(Cadre).css("top", "0px");
989                 jQuery("#standard").css("top", 0 + "px");
990                 jQuery("#comments").css("top", 0 + "px");
991
992
993                 jQuery(Cadre).width(Zone_Affichage.width);
994
995                 //============= Remise à l'échelle =======================
996
997                 img_finale.height = Image_height;
998                 img_finale.width = Image_width;
999
1000                 //=========================================================================
1001
1002
1003                 if (typeof (gmaps) != "undefined") {
1004                     Gmap_ = gmaps.maps[0];
1005                     if (Gmap_.sizeMode == 'A') {
1006                         jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" });
1007
1008                     }
1009                 }
1010                 //==============================================================
1011                 if (Type_Img == "charlie") {
1012                     t1 = jQuery("#charlie").infos();
1013                     /**/
1014                     pdf = 2 * parseInt(jQuery(".none_2").css("paddingRight"));
1015                     jQuery("#charlie").css({
1016                         width: Image_width + pdf,
1017                         height: Image_height,
1018                         margin: "auto"
1019                     });
1020
1021
1022                     jQuery("#player").css("width", Image_width + 100 + "px");
1023                     jQuery("#player").css("height", Image_height);
1024
1025                     jQuery("#embedplayer").css("width", Image_width);
1026                     jQuery("#embedplayer").css("height", Image_height);
1027
1028
1029                     jQuery("object").width(Image_width);
1030                     jQuery("object").height(Image_height);
1031                 } else if (Type_Img == "panorama") {
1032
1033                     // -----     jQuery(TheImg).panorama2(img_finale.height, img_finale.width);
1034                     // jQuery(TheImg).height(img_finale.height);
1035                     // jQuery(TheImg).width(img_finale.width);
1036                     jQuery("#Panorama div").height(Image_height);
1037                     //  class=simple_panorama
1038
1039                     jQuery(".panorama-viewport").css("left", "2px");
1040                     jQuery(".panorama-viewport").css("width", "auto");
1041                     //   setTimeout("cl_Timer()", 500);
1042
1043                 } else if (Type_Img == "pamoorama") {
1044
1045                     img_height = myPamoorama.imageHeight
1046
1047                     marge_left += 0;
1048
1049                     if (theme.match(RegExp("simple", "g"))) {
1050                         marge_right = 0;
1051                     }
1052                     new_width = Zone_Affichage.width - marge_right - marge_left;
1053                     
1054                     myPamoorama.options.width = new_width;
1055                     info_theImage.height = img_reelle.height + info_pamoorama_footer.height
1056                     //====================================================
1057                     jQuery("#pamoorama").css({
1058                         marginLeft: "auto",
1059                         marginRight: "auto",
1060                         height: info_theImage.height + "px",
1061                         width: new_width + "px"
1062                     });
1063                     jQuery("#pamoorama").width(new_width);
1064
1065                     //====================================================
1066                 info_pamoorama = jQuery("#pamoorama").infos();
1067                  img_finale.height=info_pamoorama.height-info_pamoorama_footer.height;
1068                  img_finale.width=new_width;
1069
1070                 jQuery("#pamoorama_outter").width(new_width) ;
1071                 jQuery("#pamoorama_outter").height(info_pamoorama.height-info_pamoorama_footer.height);
1072                 jQuery("#pamoorama_fouter").width(new_width) ;
1073
1074                 jQuery("#pamoorama_outter").css({width:new_width+"px",
1075                 height:info_pamoorama.height-info_pamoorama_footer.height+"px"
1076                 } );
1077                jQuery("#pamoorama_footer").css({width:new_width+"px"})
1078                     //====================================================
1079                     var info_pamoorama = jQuery("#pamoorama").infos();
1080                     var info_pamoorama_outter = jQuery("#pamoorama_outter").infos();
1081                     var info_pamoorama_inner = jQuery("#pamoorama_inner").infos();
1082                     var info_pamoorama_footer = jQuery("#pamoorama_footer").infos();
1083                     var info_pamoorama_frame = jQuery("#pamoorama_frame").infos();
1084
1085                     info_frame = jQuery(myPamoorama.frame).infos();
1086                     myPamoorama.ratio = new_width / 200;
1087                     jQuery("#pamoorama_frame").width(myPamoorama.ratio);
1088                     jQuery("#pamoorama_frame").css("width", myPamoorama.ratio + "px");
1089
1090
1091                     jQuery("#linkNext").css({ width: "200px", overflow: "hidden" });
1092                     jQuery("#linkPrev").css({ width: "200px", overflow: "hidden" });
1093
1094                     jQuery(TheImg).height(img_finale.height);
1095                     jQuery(TheImg).width(img_finale.width);
1096                     jQuery(TheImg).css("height", img_finale.height + "px ");
1097                     jQuery(TheImg).css("width", img_finale.width + "px ");
1098
1099                     zoom = Image_height / img_height;
1100
1101
1102
1103
1104                 } else if (TheImg.src) {
1105                     //--- background ?? ---
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                 } else {
1112                     //===map ? ===
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                 }
1119
1120                 if (DEBUG == "true") {
1121
1122                     jQuery().affiche_debug({ debug3: { texte: "Debug:Bandeau : " + Bandeau,
1123                         css: {
1124                             opacity: 0.5,
1125                             filter: 'alpha(opacity:50)',
1126                             position: "absolute",
1127 
1128                         }
1129                     },
1130                     debug1: { texte: "Debug1:img_finale.height : " + img_finale.width + " height:" + img_finale.height,
1131                             css: {
1132                                 opacity: 0.5,
1133                                 filter: 'alpha(opacity:50)',
1134                                 position: "absolute",
1135                   
1136                             }
1137                         },
1138                         debug2: { texte: "Debug2:Bandeau_bas bottom :" + Bandeau_bas.bottom,
1139                             css: {
1140                                 opacity: 0.5,
1141                                 filter: 'alpha(opacity:50)',
1142                                 position: "absolute",
1143                             
1144                             }
1145                         }
1146                     });
1147
1148                 }
1149                 jQuery("#navThumbPrev").css({ overflow: "hidden"
1150                 });
1151                 jQuery("#navThumbNext").css({
1152                     overflow: "hidden"
1153                 });
1154                 try {
1155                     if (theme.match(RegExp("gally", "g"))) {
1156
1157                         //===========================================================================
1158                         initializeImageMode("resize");
1159                         if (jQuery("#navThumbPrev").length > 0) {
1160                             jQuery("#navThumbPrev").css({ height: info_img.height + "px",
1161                                 top: info_img.top + 20 + "px", overflow: "hidden"
1162                             });
1163                             if (Type_Img == "map")
1164                                 jQuery("#navThumbPrevContainer").css({ background: 'none' });
1165                         }
1166                         if (jQuery("#navThumbNext").length > 0) {
1167                             jQuery("#navThumbNext").css({ height: info_img.height + "px",
1168                                 top: info_img.top + 20 + "px", overflow: "hidden"
1169                             });
1170
1171                         }
1172                         if (Type_Img == "map")
1173                             jQuery("#navThumbNextContainer").css({ background: 'none' });
1174
1175
1176
1177                         if (!theme.match(RegExp("lapis", "gi"))) { initializeImageMode("resize"); }
1178                     } else if (theme.match(RegExp("simple", "g"))) {
1179
1180                         jQuery("#imageToolBar").css("position", "static");
1181                         info_imageInfoBar = jQuery("#imageInfoBar").infos();
1182                         if (info_imageInfoBar.bottom < info_img.bottom) {
1183                             jQuery("#imageInfoBar").height(info_img.bottom);
1184                         }
1185
1186                     } else {
1187
1188                         //    jQuery("#imageToolBar").css("position", "static");
1189                     }
1190                 } catch (e) {
1191
1192                 }
1193                 //  --- rglage de la hauteur de page en fonction du copyright-----------
1194                 if (typeof (pos) == "undefined") pos = jQuery("#copyright").infos();
1195                 if (pos != jQuery("#copyright").infos())
1196                     pos = jQuery("#copyright").infos();
1197                 if (pos.top > 100) jQuery("#the_page").height(pos.top);
1198                                 return true;
1199
1200
1201
1202
1203
1204                 //_____________________________________________________
1205             } // Resize();
1206
1207
1208             //======================================================================
1209
1210
1211         });            // fin extend
1212
1213     } // function
1214);   
1215
Note: See TracBrowser for help on using the repository browser.