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

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

[Autosize][beta] fix bugs.

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