Ignore:
Timestamp:
Dec 1, 2010, 10:19:47 AM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] compatibility with simple


Location:
extensions/Autosize/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/js/Affiche_script.js

    r7943 r7962  
    214214                 //=================================================================
    215215
     216
    216217                 var winwidth = jQuery(window).width();
    217218                 var winheight = jQuery(window).height();
     
    410411                 miniHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-height"), mini_height);
    411412
     413                 var miniWidth2 = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-width"), mini_width2);
     414                 var miniHeight2 = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-height"), mini_height2);
    412415
    413416                 var maxWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-width"), winwidth, "0");
    414417                 maxHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-height"), winheight, "0");
     418
    415419
    416420                 mini_width = parseInt(miniWidth);
     
    481485                 h = 0;
    482486
    483                  Zone_Affichage.height -= (Zone_Affichage.padding.bottom + Zone_Affichage.padding.top + Zone_Affichage.margin.top + Zone_Affichage.margin.bottom);
    484                  Bandeau = Bandeau_t.bottom;
    485                  Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction;
     487                 h = (Zone_Affichage.padding.bottom + Zone_Affichage.padding.top + Zone_Affichage.margin.top + Zone_Affichage.margin.bottom);
     488                 Bandeau = Bandeau_t.img_top;
     489                 Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction - h;
     490                 //=========================================================================
     491                 if (Zone_Affichage.height < mini_height)
     492                     Zone_Affichage.height = mini_height2;
     493                 if (Zone_Affichage.width < mini_width)
     494                     Zone_Affichage.width = mini_width2;
     495                 //=========================================================================
    486496                 if (typeof (Bandeau_bas) != "undefined") {
    487                      var Image_height = Zone_Affichage.height - Bandeau_bas.height - Bandeau_bas.marge.top - Bandeau_bas.marge.bottom;
     497                     Zone_Affichage.height -= (Bandeau_bas.height + Bandeau_bas.marge.top + Bandeau_bas.marge.bottom);
    488498
    489499
    490500                 } else {
    491                      var Image_height = Zone_Affichage.height;
    492                  }
    493 
    494 
     501
     502                 }
     503
     504                 var Image_height = Zone_Affichage.height;
    495505
    496506                 //=============================================================
     
    534544                     else
    535545                         widthmin = parseInt(width_user);
     546
    536547                     var marges = marges_llgbo;
     548
    537549                     if (typeof (info_img) != "undefined") {
    538550                         widthmin -= info_img.borderwidth.left || 0;
     
    540552                     }
    541553                     widthmin -= marges;
     554                     widthmin -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left);
     555                     Image_width -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left);
    542556                     if (Image_width > widthmin) {
    543557                         //   Image_width largeur à atteindre
     
    558572                 //===================================================
    559573
    560 
     574                 img_finale.height = Image_height;
     575                 img_finale.width = Image_width;
    561576
    562577                 zoom = echelle;
     
    572587                     if (TheImg.src) {
    573588
    574                          Image_width -= marges_llgbo; // réduction frame
    575                          Image_height -= marges_llgbo; // réduction frame
     589                         img_finale.width -= (marges_llgbo); // réduction frame
     590                         img_finale.height -= (marges_llgbo); // réduction frame
     591
    576592                         if (rapport > 1) {
     593                             if (img_finale.width > winwidth) {
     594                                 jQuery("#gbo").width(winwidth);
     595                                 jQuery("#gbo").height(winheight);
     596                                 jQuery("#gbo").css("width", winwidth + "px");
     597                                 jQuery("#gbo").css("height", winheight + "px");
     598                             }
     599                             else {
     600                                 jQuery("#gbo").width(img_finale.width);
     601                                 jQuery("#gbo").height(img_finale.height);
     602                                 jQuery("#gbo").css("width", img_finale.width + "px");
     603                                 jQuery("#gbo").css("height", img_finale.height + "px");
     604                             }
     605
     606                             t1 = jQuery("#gbo div:last").infos();
     607
     608                             img_finale.width = t1.width - (t1.borderwidth.left + t1.borderwidth.right);
     609                             img_finale.height = parseInt(img_finale.width / rapport);
     610
     611                             jQuery("#gbo").height(Image_height);
     612                             jQuery("#gbo").css("height", (Image_height) + "px");
     613
     614
     615                         } else {
     616                             img_finale.width -= (marges_llgbo / 2); // réduction frame
     617                             img_finale.height -= (marges_llgbo / 2); // réduction frame
    577618                             if (Image_width > winwidth) {
    578619                                 jQuery("#gbo").width(winwidth);
     
    582623                             }
    583624                             else {
    584                                  jQuery("#gbo").width(Image_width);
    585                                  jQuery("#gbo").height(Image_height);
    586                                  jQuery("#gbo").css("width", Image_width + "px");
    587                                  jQuery("#gbo").css("height", Image_height + "px");
     625                                 jQuery("#gbo").width(img_finale.width);
     626                                 jQuery("#gbo").height(img_finale.height);
     627                                 jQuery("#gbo").css("width", img_finale.width + "px");
     628                                 jQuery("#gbo").css("height", img_finale.height + "px");
    588629                             }
    589630
    590                              t1 = jQuery("#gbo div:last").infos();
    591 
    592                              Image_width = t1.width - (t1.borderwidth.left + t1.borderwidth.right);
    593                              Image_height = parseInt(Image_width / rapport);
    594 
    595                              jQuery("#gbo").height(Image_height + marges_llgbo);
    596                              jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
    597 
    598 
    599                          } else {
    600                              Image_width -= (marges_llgbo / 2); // réduction frame
    601                              Image_height -= (marges_llgbo / 2); // réduction frame
    602                              if (Image_width > winwidth) {
    603                                  jQuery("#gbo").width(winwidth);
    604                                  jQuery("#gbo").height(winheight);
    605                                  jQuery("#gbo").css("width", winwidth + "px");
    606                                  jQuery("#gbo").css("height", winheight + "px");
    607                              }
    608                              else {
    609                                  jQuery("#gbo").width(Image_width);
    610                                  jQuery("#gbo").height(Image_height);
    611                                  jQuery("#gbo").css("width", Image_width + "px");
    612                                  jQuery("#gbo").css("height", Image_height + "px");
    613                              }
    614 
    615 
    616                              jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
    617                              jQuery("#gbo").height(Image_height + marges_llgbo);
    618 
    619                              jQuery("#gbo").css("width", Image_width + marges_llgbo + "px");
    620                              jQuery("#gbo").width(Image_width + marges_llgbo);
    621 
    622 
    623                          }
     631
     632                             jQuery("#gbo").css("height", (img_finale.height + marges_llgbo) + "px");
     633                             jQuery("#gbo").height(img_finale.height + marges_llgbo);
     634
     635                             jQuery("#gbo").css("width", img_finale.width + marges_llgbo + "px");
     636                             jQuery("#gbo").width(img_finale.width + marges_llgbo);
     637
     638
     639                         }
     640                         Zone_Affichage.height = jQuery("#gbo").outerHeight(true)
     641
     642                         //=============================================================
    624643                         //  jQuery(Parent + " p:not(:contains(' ')) ").remove();
    625644                         a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]");
     
    636655
    637656
    638                          var Largeur_zone = (Image_width / nb_zone);
    639                          var Hauteur_zone = (Image_height);
     657                         var Largeur_zone = (img_finale.width / nb_zone);
     658                         var Hauteur_zone = (img_finale.height);
    640659                         var init_zone = 0;
    641660
     
    647666                         }
    648667
    649                          coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
     668                         coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height };
    650669
    651670                         if (a0.length > 0) {
     
    658677
    659678                         if (a2.length > 0) {
    660                              coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
     679                             coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height };
    661680                             jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
    662681                         }
     
    665684
    666685                 //================ Zone affichage =========================
    667  
     686
    668687                 if (theme.match(RegExp("luciano", "g"))) {
    669688                     //---- information en dehors du cadre
     
    678697
    679698
    680                  jQuery(Cadre).width(Zone_Affichage.width - 4);
    681 
    682                  //============= Remise à l'échelle =======================
    683 
    684                  img_finale.height = Image_height;
    685                  img_finale.width = Image_width;
     699
     700
     701                 //========== Image Remise à l'échelle =======================
     702
     703                 Image_height = img_finale.height;
     704                 Image_width = img_finale.width;
     705
     706
    686707
    687708                 //=========================================================================
    688 
     709                 jQuery(Cadre).width(Zone_Affichage.width);
     710                 //   jQuery(Cadre).height(Zone_Affichage.height);
    689711
    690712                 if (typeof (gmaps) != "undefined") {
     
    712734                         pdf += p1.padding.right + p1.padding.left;
    713735                     });
    714 
     736                     img_finale.width -= pdf;
    715737
    716738                     jQuery("#charlie").css({
    717                          width: Image_width + pdf,
    718                          height: Image_height,
     739                         width: img_finale.width + pdf,
     740                         height: img_finale.height,
    719741                         margin: "auto"
    720742                     });
     
    722744
    723745
    724                      jQuery("#player").css("width", Image_width + 100 + "px");
    725                      jQuery("#player").css("height", Image_height);
    726 
    727                      jQuery("#embedplayer").css("width", Image_width);
    728                      jQuery("#embedplayer").css("height", Image_height);
    729 
    730 
    731                      jQuery("object").width(Image_width);
    732                      jQuery("object").height(Image_height);
     746                     jQuery("#player").css("width", img_finale.width + "px");
     747                     jQuery("#player").css("height", img_finale.height);
     748
     749                     jQuery("#embedplayer").css("width", img_finale.width);
     750                     jQuery("#embedplayer").css("height", img_finale.height);
     751
     752
     753                     jQuery("object").width(img_finale.width);
     754                     jQuery("object").height(img_finale.height);
    733755
    734756
     
    738760                     // jQuery(TheImg).height(img_finale.height);
    739761                     // jQuery(TheImg).width(img_finale.width);
    740                      jQuery("#Panorama div").height(Image_height);
     762                     jQuery("#Panorama div").height(img_finale.height);
    741763                     //  class=simple_panorama
    742764
     
    790812                     info_frame = jQuery(myPamoorama.frame).infos();
    791813
    792                      zoom = Image_height / img_height;
     814                     zoom = img_finale.height / img_height;
    793815
    794816
     
    797819                     jQuery(TheImg).height(img_finale.height);
    798820                     jQuery(TheImg).width(img_finale.width);
    799                      jQuery(TheImg).css({ height: img_finale.height + "px ", width: img_finale.width + "px " });
     821                     jQuery(TheImg).css({ height: img_finale.height + "px ",
     822                         width: img_finale.width + "px "
     823                     });
    800824
    801825
     
    804828                     jQuery(TheImg).height(img_finale.height);
    805829                     jQuery(TheImg).width(img_finale.width);
    806                      jQuery(TheImg).css({ height: img_finale.height + "px ", width: img_finale.width + "px " });
    807 
    808                  }
    809 
    810                  info_frame = Zone_Affichage;
    811                  h0 = jQuery(Cadre).outerHeight(true);
     830                     jQuery(TheImg).css({ height: img_finale.height + "px ",
     831                         width: img_finale.width + "px "
     832                     });
     833
     834                 }
     835
     836
    812837
    813838
     
    868893                     jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" });
    869894                 }
     895                 info_frame = jQuery("#the_page").infos();
     896
    870897                 if (DEBUG == "true") {
    871                      //  jQuery(Parent).height(info_frame.height +info_description.height   +"px");
    872                      //  info_Cadre = jQuery(Parent).infos();
    873 
    874                      //  jQuery("#Debug3").css({ top: info_Cadre.top + "px", height: info_Cadre.height + "px" }); //blue
     898                     if (theme.match(RegExp("stripped", "gi"))) {
     899                         pos = "absolute";
     900                         t1 = info_imageInfoBar.bottom;
     901                         l1 = info_imageInfoBar.left;
     902                     } else {
     903                         pos = "absolute";
     904                         t1 = info_frame.top;
     905                         l1 = info_frame.left;
     906                     }
     907                     //   jQuery(Cadre).css("border", "solid green");
     908                     margins = jQuery(Cadre).css("margin");
    875909                     jQuery("#Debug5").css({ background: "transparent",
     910                         position: pos,
    876911                         border: "red solid 2px",
    877                          top: info_frame.top + "px",
    878                          left: info_frame.left + "px",
     912                         textAlign: align_auto,
     913                         margin: "4px",
     914                         top: t1 + "px",
     915                         left: l1 + "px",
    879916                         width: info_frame.width + "px",
    880917                         height: info_frame.height + "px"
     
    930967                 *
    931968                 */
     969                 
    932970                 function Info_entete(Parent) {
    933 
     971                     if (typeof (marge_top) != "undefined") return result;
    934972                     info_imageToolBar = jQuery("#imageToolBar").infos();
    935973                     if (info_imageToolBar.position == "absolute") {
     
    937975                         jQuery("#imageToolBar").css("top", 0 + "px");
    938976                     }
    939 
     977                     optiontop = 0;
     978                     
     979                     info_imageInfoBar = jQuery("#imageInfoBar").infos();
     980
     981
     982                    info_theImgContainer = jQuery("#"+ "theImgContainer").infos();
    940983                     info_theImage = jQuery(Parent).infos();
    941 
    942 
    943                      if (info_theImage.position == "relative") {
    944                          //--- passage relative ==> static ===/
    945                          jQuery(Parent).css("position", "static");
    946                          info_theImage = jQuery(Parent).infos();
    947 
    948                      }
     984                 info_thePicturePage =   jQuery("#thePicturePage").infos();
     985
     986
     987                 if (info_theImage.position == "relative") {
     988                     //--- passage relative ==> static ===/
     989                     jQuery(Parent).css("position", "static");
     990                     info_theImage = jQuery(Parent).infos();
     991
     992                 } else {
     993                   if ( theme.match(RegExp("stripped", "gi"))) 
     994                     {
     995                        optiontop = info_imageInfoBar.bottom;
     996                    }
     997                 }
    949998                     if (info_theImage.position == "absolute") {
    950999                         //--- passage absolute ==> static ===/
     
    9561005                     marge_top = Math.ceil(Info_the_page.top +
    9571006                                     Info_the_page.borderwidth.top +
    958                                      info_theImage.borderwidth.top);
    959 
    960                      img_top = Math.ceil(info_theImage.top + info_theImage.borderwidth.top);
     1007                                     info_theImage.borderwidth.top +
     1008                                     info_thePicturePage.margin.top
     1009                                     );
     1010
     1011                     img_top = Math.ceil(info_theImage.top +
     1012                      info_theImage.borderwidth.top +
     1013                       info_thePicturePage.margin.top + optiontop);
    9611014                     result = info_imageToolBar;
    9621015                     result.width = "20%";
     
    10061059
    10071060
    1008                      Bandeau_t = Info_entete(Parent)
    1009                      Bandeau = Bandeau_t.img_top;
     1061
    10101062                     llgboframe = jQuery("#gbo div:first");
    10111063                     marges_llgbo = 0;
     
    10141066                     if (llgboframe.length > 0) {
    10151067                         ll0 = jQuery("#gbo").infos();
    1016                          ll1 = jQuery("#llgboframe31").infos();
    1017                          ll2 = jQuery("#llgboframe1").infos();
    1018                          marges_llgbo = (ll1.width - ll2.width) + ll2.borderwidth.left + ll2.borderwidth.right;
    1019                      }
    1020 
    1021 
     1068                         ll1 = jQuery("#gbo div:first").infos();
     1069                         ll12 = jQuery("#gbo div:last").infos(); ;
     1070                         ll1 = jQuery("#"+ll1.id).outerWidth(true);
     1071                         ll2 = jQuery("#" + ll12.id).outerWidth(true);
     1072                         marges_llgbo = ((ll1 - ll2)*2) + ll0.borderwidth.left + ll0.borderwidth.right;
     1073                     }
     1074
     1075                     Bandeau_t = Info_entete(Parent)
     1076                     Bandeau = Bandeau_t.img_top;
    10221077
    10231078                     if (theme.match(RegExp("simple", "gi"))) {
  • extensions/Autosize/js/conflit.js

    r7943 r7962  
    88var init_tb = 0;
    99var dom = {};
     10
    1011if (typeof jQuery == 'undefined') {
    1112    alert(" jQuery n'est pas chargé");
     
    1415}
    1516
     17try{
     18    if (DEBUG == "true") {
     19
     20    }
     21}catch(e)
     22{
     23    DEBUG = "false";
     24}
    1625//===================================================
    1726var detect = navigator.userAgent.toLowerCase();
Note: See TracChangeset for help on using the changeset viewer.