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

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

[Autosize][beta] save

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