Ignore:
Timestamp:
Oct 26, 2010, 9:01:00 AM (14 years ago)
Author:
cljosse
Message:

[Autosize][beta] Add the option validation of the autosize according to the status

Location:
extensions/Autosize/js
Files:
3 edited

Legend:

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

    r7375 r7394  
    3333              marges_llgbo = jQuery(llgboframe).outerWidth() - jQuery("#gbo div:last").innerWidth();
    3434          }
    35        
     35
    3636
    3737          //=========================================================
     
    8989          */
    9090          function Info_entete(Parent) {
    91 
    92               var Info_the_page = jQuery("#the_page").info();
    93               var info_theHeader = jQuery("#theHeader").info();
    9491              var info_imageToolBar = jQuery("#imageToolBar").info();
     92              if (info_imageToolBar.position == "absolute") {
     93                  jQuery("#imageToolBar").css("position", "relative");
     94                  jQuery("#imageToolBar").css("top", 0 + "px");
     95              }
    9596              var info_theImage = jQuery("#theImage").info();
    96               var info_image = jQuery("#theImage img").info();
    97               /* Squelette
    98               //montblanc info_theImage.top  121
    99               //          imageToolBar.margin top:10 padding bottom:10
    100               //<body> thePicturePage
    101               //  <div> the_page
    102               //    <div> theHeader
    103               //    <div> imageHeaderBar
    104               //    <div> imageToolBar
    105               //    <div> theImage
    106               //     <img> ??
    107               //     <p>
    108               //       <br>
    109               //       <p>
    110               //     <span class="licencetag" style="text-align: left;">
    111               //
    112               // image top gallycuise :154
    113               //
    114               //<body> thePicturePage
    115               //  <div> the_page
    116               //    <div> theHeader
    117               //    <div> theHeaderAlt
    118               //     <div> content
    119               //             theImageHigh
    120               //       <div> imageHeaderBar
    121               //       <div> imageToolBar
    122               //       <div> theImage
    123               //                   theImgContainer
    124               //                     <img> ??
    125               //        <p>
    126               //        <br>
    127               //         <p>
    128               //         <span class="licencetag" style="text-align: left;">
    129               //        theTabsContainer
    130               //      copyright
    131               */
    132 
     97
     98              if (info_theImage.position == "relative") {
     99                  //--- passage absolute ==> static ===/
     100                  jQuery("#theImage").css("position", "static");
     101                  info_theImage = jQuery("#theImage").info();
     102
     103              }
    133104              if (info_theImage.position == "absolute") {
    134                   var Bandeau = info_theImage.top -
    135                               (Info_the_page.top +
    136                               Get_Val_int(Info_the_page.borderwidth.top) +
    137                               Get_Val_int(info_theImage.borderwidth.top));
    138 
    139                   Bandeau = info_theImage.top;
    140               } else {
    141                   var Bandeau = info_theImage.top +
    142                                 Get_Val_int(info_imageToolBar.margin.bottom) +
    143                                  Get_Val_int(info_imageToolBar.margin.top) +
    144                               Info_the_page.top +
    145                               Get_Val_int(Info_the_page.borderwidth.top) +
    146                               Get_Val_int(info_theImage.borderwidth.top);
    147               }
    148 
    149               var Bandeau_t = Info_the_page.top +
    150                                       Get_Val_int(Info_the_page.borderwidth.top) +
    151                                       Get_Val_int(info_theImage.borderwidth.top);
    152 
    153               return { marge_top: Bandeau_t, img_top: Bandeau };
     105                  //--- passage absolute ==> static ===/
     106                  jQuery("#theImage").css("position", "static");
     107                  info_theImage = jQuery("#theImage").info();
     108
     109              }
     110
     111              marge_top = Info_the_page.top +
     112                                     Info_the_page.borderwidth.top +
     113                                     info_theImage.borderwidth.top;
     114
     115              img_top = info_theImage.top + info_theImage.borderwidth.top ;
     116              return { marge_top: marge_top, img_top: img_top };
    154117
    155118          }
     
    159122          */
    160123          function Info_description(Parent) {
    161 
    162               //jQuery("#theImage br").remove();
    163               // jQuery("#theImage br").css("lineHeight", "2px");
    164               var inter_ligne = Get_Val_int(jQuery("#" + Parent + " p").css("lineHeight"));
    165               var info_description = jQuery("#" + Parent + " ").info();
    166               jQuery("#" + Parent).css({ marginLeft: "auto", marginRight: "auto" });
    167               var Description = jQuery("#" + Parent + " >*");
    168 
    169               jQuery(Description).each(
    170 
    171              function (i) {
    172                  t = jQuery(this).text();
    173                  t = jQuery.trim(t);
    174                  pr = jQuery(this).parent().get(0).id;
    175                  n = this.nodeName;
    176                  infos = jQuery(this).info();
    177 
    178                  if (t == "") {
    179                      if (this.nodeName == "IMG") {
    180                          info_description.top = infos.bottom - Get_Val_int(infos.margin.top) + inter_ligne;
    181                          info_description.bottom = infos.bottom + Get_Val_int(infos.margin.bottom);
    182                      }
    183                      else if (this.nodeName == "P" || this.nodeName == "BR") {
    184                          jQuery(this).remove();
    185                      } else {
    186                          //   jQuery(this).css("border", "solid 3px GREEN");
    187                          info_description.top = infos.bottom - Get_Val_int(infos.margin.top);
    188                          info_description.bottom = infos.bottom + Get_Val_int(infos.margin.bottom);
    189                      }
    190                  } else {
    191 
    192                      jQuery(this).css("border", "solid 1px transparent");
    193                      info_description.bottom = infos.bottom + Get_Val_int(infos.margin.bottom);
    194                  }
    195 
    196 
    197 
    198 
    199              });
     124              jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px "
     125              });
     126            //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
     127              var inter_ligne = jQuery("#" + Parent + " p").css("lineHeight");
     128
     129              jQuery("#" + Parent).css({ padding: "0px",
     130               marginLeft: "auto",
     131                  marginRight: "auto",
     132                  marginTop: "0px",
     133                  marginBottom: "0px"
     134                });
     135
     136              var info_description = { top: 0, bottom: 0, height: 0 };
     137              //=============================================================================
     138              info_img = jQuery("#" + Parent + " img").info();
     139              info_description.top = info_img.bottom;
     140              //=============================================================================
     141              info_gbo = jQuery("#gbo").info();
     142              if (info_description.top < info_gbo.bottom)
     143                  info_description.top = info_gbo.bottom;
     144              //=============================================================================
     145
     146              info_desc = jQuery("#" + Parent + " p:last").info();
     147              info_description.bottom = info_desc.bottom;
     148
    200149              info_licencetag = jQuery(".licencetag").info();
     150
     151
    201152              if (info_licencetag.bottom > info_description.bottom) {
    202153                  jQuery(".licencetag").css("border", "solid 2px transparent");
     
    204155
    205156              }
     157              //=============================================================================
    206158
    207159              if (info_description.top < 1)
     
    209161
    210162
    211               var Info_the_page = jQuery("#the_page").info();
    212               var Bandeau_t = Info_entete(Parent);
    213 
    214163              if (info_description.bottom < info_description.top)
    215164                  info_description.bottom = info_description.top = 1;
    216165
    217               if (theme.match(RegExp("gally", "g"))) {
    218                      marges_llgbo = 0;
    219               }
    220 
    221               info_description.top += Bandeau_t.marge_top - marges_llgbo;
    222               // info_description.bottom 739 ;
    223               //  info_description.height 277 ;
    224               //      info_description.top 465
    225               info_description.height = marges_llgbo + (info_description.bottom + Info_the_page.top) - info_description.top;
     166              info_description.height = info_description.bottom - info_description.top ;
    226167
    227168              if (check_desc_v != 'checked="checked"') {
     
    231172              return info_description;
    232173
    233           }
    234           /*
    235           * Get_val_int
    236           * params: element,valeur maxi
    237           * return: valeur entiere
    238           */
    239           function Get_Val_int(myObj, Maxi_val, Mini_val) {
    240               var val = 0;
    241               var reg1 = new RegExp("%", "g")
    242               Maxi_val = parseInt(Maxi_val || "0");
    243 
    244               /*
    245               - numérique suivie de px ou % ou pt ou em,
    246               - thin, bordure mince,
    247               - medium, bordure moyenne (valeur par défaut),
    248               - thick, bordure épaisse,
    249               - inherit, hérite de son parent (css2).
    250               */
    251 
    252               if (!myObj) {
    253                   return Maxi_val;
    254               }
    255               if (typeof (myObj) == "string") {
    256                   if (myObj == "none") return Maxi_val;
    257                   if (myObj == "auto") return Maxi_val;
    258                   if (Mini_val)
    259                       if (myObj < Mini_val) return Maxi_val;
    260                   switch (myObj) {
    261                       case 'thin':
    262                           return 1;
    263                           break;
    264                       case 'medium':
    265                           return 2;
    266                           break;
    267                       case 'thick':
    268                           return 4;
    269                           break;
    270                       case 'inherit':
    271 
    272 
    273                           break;
    274 
    275                       default:
    276 
    277 
    278                           break;
    279                   }
    280 
    281 
    282 
    283 
    284 
    285                   if (myObj.match(reg1)) val = myObj * Maxi_val / 100;
    286                   val = parseInt(myObj);
    287 
    288               } else
    289                   val = parseInt(myObj);
    290 
    291 
    292               if (typeof (val) == "NaN") return Maxi_val;
    293               return val;
    294174          }
    295175
     
    323203          var img_reelle = { height: img_height, width: img_width };
    324204          var img_finale = { height: 0, width: 0 };
    325           var zone_affichage = { height: 0, width: 0 };
     205          var Zone_Affichage = { height: 0, width: 0 };
    326206
    327207          //============================================================
     
    330210          var Zone_Affichage = jQuery("#theImage").info();
    331211
    332           var Bandeau = Info_entete("theImage").img_top;
    333 
    334           var Bandeau_bas = Info_description("theImage");
     212          var Bandeau = 0;
     213          var Bandeau_t = Info_entete("theImage")
     214          Bandeau = Bandeau_t.img_top;
     215
     216
     217          var Bandeau_bas = 0;
     218          Bandeau_bas = Info_description("theImage");
     219
    335220
    336221          //===================================================================
     
    345230              if (typeof (event) == 'undefined') return;
    346231              if (!cl_visible) return;
     232               if (eval(user_status + "_enabled") == "") return;
     233              var chk = eval(user_status + "_enabled");
     234              /*  jQuery("#Debug").text(jQuery("#Debug").text() + user_status);
     235               
     236              jQuery("#Debug").hide();
     237              jQuery("#Debug1").hide();
     238              jQuery("#Debug2").hide();
     239             
     240              jQuery("#Debug").css({ position: "absolute", width: "200px", border: "solid 1px green", top: Bandeau + "px" });
     241              jQuery("#Debug").text(Bandeau);
     242
     243              jQuery("#Debug1").css({ position: "absolute",
     244              border: "solid 1px green",
     245              top: Bandeau_bas.top + "px",
     246              width: (Bandeau_bas.width / 5) + "px",
     247              height: Bandeau_bas.height + "px"
     248              });
     249              jQuery("#Debug1").text(Bandeau_bas.top + " height:" + Bandeau_bas.height);
     250
     251              jQuery("#Debug2").css({ position: "absolute",
     252              left: '200px',
     253              border: "solid 1px green", top: Bandeau_bas.bottom + "px"
     254              });
     255              jQuery("#Debug2").text(Bandeau_bas.bottom);
     256             
     257 */
     258             
    347259
    348260              //==========================================================================
     
    352264
    353265
    354               /*
    355               * recherche la plus grande image (hauteur ou largeur)
    356               */
    357 
    358 
    359               function Get_Img_Maxi(myobj) {
    360                   var w00 = 0;
    361                   var TheImg = null;
    362                   jQuery(myobj).each(function (i) {
    363                       w0 = img_reelle.width;
    364                       h0 = img_reelle.height;
    365                       if (h0 > w0) w0 = h0;
    366                       if (w0 > w00) {
    367                           if (!this.src.match(RegExp(".png", "g")))
    368                               if (!this.src.match(RegExp(thumbnail, "g"))) {
    369                                   TheImg = this;
    370                                   w00 = w0;
    371                               }
    372 
    373                       }
    374                   });
    375                   return TheImg;
    376               }
    377266
    378267              if (old_w != winwidth)
     
    383272
    384273
    385               Cadre = jQuery("#theImage").get(0);
    386 
    387               //===============  Information cadre ======
    388               var info_the_page = jQuery("#the_page").info();
    389 
    390               //=============================================================================
    391               var info_HeaderBar = jQuery("#imageHeaderBar").info();
    392               var info_imageInfoBar = jQuery("#imageInfoBar").info();
    393               var info_content = jQuery("#content").info();
    394               var info_ToolBar = jQuery("#imageToolBar").info();
    395 
    396               var info_titrePage = jQuery("#titrePage").info();
    397 
    398               var info_the_page = jQuery("#the_page").info();
    399               var zone_affichage = jQuery("#theImage").info();
    400 
     274              var Cadre = jQuery("#theImage").get(0);
    401275
    402276              var Type_Img = "";
     
    424298
    425299              var info_Cadre = jQuery(Cadre).info();
    426 
    427 
    428               if (info_Cadre.position != "static") {
    429                   /* Si LLGBO met le cadre en relative  */
    430                   if (theme.match(RegExp("gally", "g"))) {
    431                       //--- passage absolute ==> static ===/
    432                       jQuery(Cadre).css("position", "static");
    433                       info_Cadre = jQuery(Cadre).info();
    434 
    435                   }
    436               }
    437 
    438               jQuery("#imageToolBar").css("position", "relative");
    439               jQuery("#imageHeaderBar").css("position", "relative");
    440               jQuery("#imageToolBar").css("top", 0 + "px");
    441               jQuery("#imageHeaderBar").css("top", "0px");
    442               w0 = Zone_Affichage.width;
    443               marge = (Zone_Affichage.width - info_ToolBar.width) / 2;
     300              //===============  Information cadre ======
     301              var info_the_page = jQuery("#the_page").info();
     302
     303              //=============================================================================
     304              var info_HeaderBar = jQuery("#imageHeaderBar").info();
     305
     306              var info_content = jQuery("#content").info();
     307
     308
     309              var info_titrePage = jQuery("#titrePage").info();
     310
     311               
     312              var Zone_Affichage = jQuery("#theImage").info();
     313
     314              var info_ToolBar = jQuery("#imageToolBar").info();
     315              var info_imageInfoBar = jQuery("#imageInfoBar").info();
     316              var info_theHeader = jQuery("#theHeader").info();
     317
     318              var marge = 0;
    444319
    445320              var marge_right = marge;
    446321              var marge_left = marge;
    447322              if (info_content.width > 100) {
    448                   marge_right = Get_Val_int(info_imageInfoBar.margin.left) + Get_Val_int(info_imageInfoBar.margin.right);
     323                  marge_right = info_imageInfoBar.margin.left + info_imageInfoBar.margin.right;
    449324                  winwidth = info_content.width;
    450325                  marge_right = info_imageInfoBar.width + marge_right;
     
    454329
    455330              winwidth -= (marge_right + marge_left);
    456               //  var marge_top = info_ToolBar.top + info_ToolBar.height;
    457331
    458332              //======================================================================
    459               info_theHeader = jQuery("#theHeader").info();
    460               //  var marge_top =info_theHeader.bottom + info_HeaderBar.height+ info_ToolBar.height; //145
    461               var marge_top = info_HeaderBar.bottom + info_ToolBar.height; //145
     333
     334
    462335              if (Type_Img == "pamoorama") {
    463336                  var info_pamoorama = jQuery("#pamoorama").info();
     
    505378
    506379                      var TheImg = jQuery("#map").get(0);
    507                       info_image = jQuery("#map").info();
    508 
    509 
    510                       pos_page = jQuery("#the_page").info();
     380                       img_reelle.height = info_image.height;
     381                       img_reelle.width = winwidth - marge_right - marge_right;
     382                      Bandeau_bas.height = 10;
     383                      marge_right = 10;
     384                     
     385                      info_the_page = jQuery("#the_page").info();
    511386                      ;
    512387
     
    526401                      });
    527402
    528                       pos_image = jQuery(TheImg).info();
    529                       pos_page = jQuery("#the_page").info();
     403                      info_theImage = jQuery(TheImg).info();
     404                      info_the_page = jQuery("#the_page").info();
    530405
    531406                      break
     
    533408
    534409                      if (!TheImg) return;
    535                       pos_image = jQuery(TheImg).info();
    536                       pos_page = jQuery("#the_page").info();
     410                      info_theImage = jQuery(TheImg).info();
     411                      info_the_page = jQuery("#the_page").info();
    537412
    538413
     
    540415                  case "img_autre":
    541416                      if (!TheImg) return;
    542                       pos_image = jQuery(TheImg).position();
    543                       pos_page = jQuery("#the_page").position();
     417                      info_theImage = jQuery(TheImg).info();
     418                      info_the_page = jQuery("#the_page").info();
    544419
    545420
     
    550425                      TheImg = jQuery(Cadre).find("embed");
    551426
    552                       pos_image = jQuery(Cadre).position();
    553                       pos_page = jQuery("#the_page").position();
     427                      info_theImage = jQuery(Cadre).info();
     428                      info_the_page = jQuery("#the_page").info();
    554429                      if (rapport < 0) {
    555430                          img_height = parseInt(jQuery(TheImg).outerHeight());
     
    565440
    566441                      TheImg = jQuery('#charlie object').get(0);
    567                       pos_image = jQuery(Cadre).position();
    568                       pos_page = jQuery("#the_page").position();
     442                      info_theImage = jQuery(Cadre).info();
     443                      info_the_page = jQuery("#the_page").info();
    569444                      if (rapport < 0) {
    570445                          img_height = parseInt(TheImg.height);
     
    581456                      var Image = jQuery("#pamoorama").find("img");
    582457
    583                       pos_image = jQuery("#pamoorama").info();
    584                       pos_page = jQuery("#the_page").info();
     458                      info_theImage = jQuery("#pamoorama").info();
     459                      info_the_page = jQuery("#the_page").info();
    585460                      break
    586461
     
    589464
    590465              //=============== Vérification taille minimale  autorizée ======================
    591               var miniWidth = Get_Val_int(jQuery(TheImg).css("min-width"), mini_width);
    592               miniHeight = Get_Val_int(jQuery(TheImg).css("min-height"), mini_height);
    593 
    594 
    595               var maxWidth = Get_Val_int(jQuery(TheImg).css("max-width"), winwidth, "0");
    596               maxHeight = Get_Val_int(jQuery(TheImg).css("max-height"), winheight, "0");
     466              var miniWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-width"), mini_width);
     467              miniHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-height"), mini_height);
     468
     469
     470              var maxWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-width"), winwidth, "0");
     471              maxHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-height"), winheight, "0");
    597472
    598473              mini_width = parseInt(miniWidth);
     
    624499              //=============== Zone d'affichage ============================
    625500
    626               borderW = Get_Val_int(zone_affichage.borderwidth.left, 2);
    627               borderW += Get_Val_int(zone_affichage.borderwidth.right, 2);
    628 
    629 
    630               zone_affichage.width = winwidth - borderW;
    631               zone_affichage.height = winheight - marge_top;
     501              borderW = Zone_Affichage.borderwidth.left;
     502              borderW += Zone_Affichage.borderwidth.right;
     503
     504
     505              Zone_Affichage.width = winwidth - borderW;
    632506
    633507              //==================================================================================
     
    661535              //============ Padding image ? ===============
    662536
    663               img_padding_top = Get_Val_int(info_img.padding.top);
    664               img_padding_top += Get_Val_int(info_img.padding.bottom);
    665               img_padding_top += Get_Val_int(info_img.borderwidth.top);
    666               img_padding_top += Get_Val_int(info_img.borderwidth.bottom);
    667 
    668               margin_top = Get_Val_int(info_Cadre.margin.top);
    669               padding_top = Get_Val_int(info_Cadre.padding.top);
    670               padding_top += Get_Val_int(info_Cadre.padding.bottom);
     537              img_padding_top = (info_img.padding.top);
     538              img_padding_top += (info_img.padding.bottom);
     539              img_padding_top += (info_img.borderwidth.top);
     540              img_padding_top += (info_img.borderwidth.bottom);
     541
     542              margin_top = (info_Cadre.margin.top);
     543              padding_top = (info_Cadre.padding.top);
     544              padding_top += (info_Cadre.padding.bottom);
    671545
    672546              Marge_Basse = parseInt(marge_basse || 0); // hors bandeau
    673547              //==========================================================================
    674548              h = 0;
    675               zone_affichage.height = winheight - Bandeau - Marge_Basse - h - margin_top - padding_top;
    676               var Image_height = zone_affichage.height - Bandeau_bas.height - img_padding_top;
    677               var Delta = zone_affichage.height - Image_height;
    678 
     549              Zone_Affichage.height = winheight - Bandeau - Marge_Basse;
     550              var Image_height = Zone_Affichage.height - Bandeau_bas.height;
     551
     552              // jQuery("#Debug1").css("top", Image_height + "px");
    679553              //=============================================================
    680554              var height_user = eval(user_status + "_height");
     
    696570                  Image_width = parseInt(Image_height * rapport);
    697571              else if (Type_Img == "map") {
    698                   Image_width = zone_affichage.width - marge_left - marge_right;
     572                  Image_width = Zone_Affichage.width - marge_left - marge_right;
    699573              } else {
    700                   Image_width = zone_affichage.width;
     574                  Image_width = Zone_Affichage.width;
    701575              }
    702576
     
    717591                  else
    718592                      widthmin = parseInt(width_user);
    719                  var marges = 0;
    720                   widthmin -= Get_Val_int(info_img.borderwidth.left);
    721                   widthmin -= Get_Val_int(info_img.borderwidth.right);
    722                   if (jQuery("#gbo") && jQuery("#gbo div:first").length > 0) {
    723                       llgboframe = jQuery("#gbo div:first");
    724                       marges = jQuery(llgboframe).outerWidth() - jQuery("#gbo div:last").innerWidth();
    725                   }
    726                   widthmin -= 2 * marges;
     593                  var marges = marges_llgbo;
     594                  widthmin -= info_img.borderwidth.left;
     595                  widthmin -= info_img.borderwidth.right;
     596
     597                  widthmin -= marges;
    727598                  if (Image_width > widthmin) {
    728599                      //   Image_width largeur à atteindre
     
    745616              zoom = echelle;
    746617              //=============LLGBO2 ===========================
    747               marges = 0;
     618
    748619              t1 = { top: 0 };
    749               if (jQuery("#gbo") && jQuery("#gbo div:first").length > 0) {
    750                   llgboframe = jQuery("#gbo div:first");
    751                   marges = jQuery(llgboframe).outerWidth() - jQuery("#gbo div:last").innerWidth();
    752 
    753                   m1 = jQuery(llgboframe).outerHeight();
    754                   t1 = jQuery(llgboframe).position();
     620              if (marges_llgbo > 0) {
     621
     622                  t1 = jQuery(llgboframe).info();
    755623
    756624
    757625                  if (TheImg.src) {
    758                       marge_top = t1.top - img_top;
    759                       Image_height -= marge_top;
    760                       Image_width = Image_height * rapport;
     626
     627
    761628                      if ((winwidth) < Image_width) {
    762629                          _width = maxWidth;
    763630                      } else {
    764                           _width = Image_width - (marges / 2);
     631                          _width = Image_width;
    765632                      }
    766 
     633                      _width -= marges_llgbo; // réduction frame
    767634                      jQuery("#gbo").outerWidth(_width);
    768635                      jQuery("#gbo").css("width", (_width) + "px");
    769                       jQuery("#gbo").css("height", (Image_height) + "px");
    770                       jQuery("#gbo").outerHeight(Image_height);
     636
     637
     638
    771639                      Image_width = jQuery("#gbo div:last").innerWidth();
    772640                      Image_height = parseInt(Image_width / rapport);
     641                      jQuery("#gbo").outerHeight(Image_height + marges_llgbo + 10);
     642                      jQuery("#gbo").css("height", (Image_height + marges_llgbo + 10) + "px");
    773643
    774644                  } else {
    775645
    776                       jQuery("#gbo").width(zone_affichage.width - marges);
     646                      jQuery("#gbo").width(Zone_Affichage.width - marges);
    777647                      jQuery("#gbo").height(Image_height + marges)
    778                       jQuery("#gbo").css("width", zone_affichage.width - marges + "px");
     648                      jQuery("#gbo").css("width", Zone_Affichage.width - marges + "px");
    779649                      jQuery("#gbo").css("height", Image_height - marges + "px")
    780650
     
    816686              //  Image_height, Image_width = valeur a atteindre.
    817687              if (theme.match(RegExp("luciano", "g"))) {
    818                   zone_affichage.height -= Bandeau_bas;
    819               }
    820 
    821 
    822               jQuery(Cadre).width(zone_affichage.width);
     688                  Zone_Affichage.height -= Bandeau_bas;
     689              }
     690
     691
     692              jQuery(Cadre).width(Zone_Affichage.width);
    823693              //==============================================================
    824694
     
    829699              if (typeof (gmaps) != "undefined") {
    830700                  Gmap_ = gmaps.maps[0];
    831                   if (Gmap_.sizeMode == 'A');
     701                  if (Gmap_.sizeMode == 'A')
    832702                  {
    833703                      jQuery("#iGMapsIcon").css({ width: old_w * 0.8 + "px", height: old_h * 0.8 + "px" });
     
    837707              //==============================================================
    838708              if (Type_Img == "charlie") {
    839                   t1 = jQuery("#charlie").position();
     709                  t1 = jQuery("#charlie").info();
    840710                  /**/
    841711                  pdf = 2 * parseInt(jQuery(".none_2").css("paddingRight"));
     
    872742
    873743                  marge_left += 0;
    874                   new_width = zone_affichage.width - marge_right - marge_left;
     744                  new_width = Zone_Affichage.width - marge_right - marge_left;
    875745                  jQuery("#pamoorama").css({ margin: 0 + "px",
    876746                      left: marge_left + "px",
     
    890760
    891761
    892                   jQuery("#pamoorama_footer").width((zone_affichage.width - marge_right - marge_left));
    893                   jQuery("#pamoorama_footer").css('width', (zone_affichage.width - marge_right - marge_left) + "px");
     762                  jQuery("#pamoorama_footer").width((Zone_Affichage.width - marge_right - marge_left));
     763                  jQuery("#pamoorama_footer").css('width', (Zone_Affichage.width - marge_right - marge_left) + "px");
    894764                  zoom = Image_height / img_height;
    895765                  info_pamoorama_outter = jQuery("#pamoorama_outter").info();
     
    933803              }
    934804              // 
    935               if (!pos) pos = jQuery("#copyright").position();
    936               if (pos != jQuery("#copyright").position())
    937                   pos = jQuery("#copyright").position();
     805              if (!pos) pos = jQuery("#copyright").info();
     806              if (pos != jQuery("#copyright").info())
     807                  pos = jQuery("#copyright").info();
    938808              if (pos.top > 100) jQuery("#the_page").height(pos.top);
    939809
     
    945815          //===================================================================   
    946816          jQuery(window).resize();
     817          /*
     818          * recherche la plus grande image (hauteur ou largeur)
     819          */
     820
     821
     822          function Get_Img_Maxi(myobj) {
     823              var w00 = 0;
     824              var TheImg = null;
     825              jQuery(myobj).each(function (i) {
     826                  w0 = img_reelle.width;
     827                  h0 = img_reelle.height;
     828                  if (h0 > w0) w0 = h0;
     829                  if (w0 > w00) {
     830                      if (!this.src.match(RegExp(".png", "g")))
     831                          if (!this.src.match(RegExp(thumbnail, "g"))) {
     832                              TheImg = this;
     833                              w00 = w0;
     834                          }
     835
     836                  }
     837              });
     838              return TheImg;
     839          }
    947840
    948841
    949842      } // function
    950 );                                                                                                                                                                                                                                                                                                                  // ready
     843);                                                                                                                                                                                                                                                                                                                                        // ready
    951844    /*
    952845*
  • extensions/Autosize/js/conflit.js

    r7316 r7394  
    22var d1 = 0;
    33var init_tb = 0;
    4 
     4function addEvent2(obj, type, fn) {
     5    if (obj.addEventListener) {
     6        obj.addEventListener(type, fn, false);
     7        EC.add(obj, type, fn);
     8    }
     9    else if (obj.attachEvent) {
     10        obj["e" + type + fn] = fn;
     11        obj[type + fn] = function () {
     12            obj["e" + type + fn](window.event);
     13        }
     14        obj.attachEvent("on" + type, obj[type + fn]);
     15        EC.add(obj, type, fn);
     16    }
     17    else {
     18        obj["on" + type] = obj["e" + type + fn];
     19    }
     20}
    521function $(element, nc) {
    622    //============== détection framework ==================
  • extensions/Autosize/js/jquery.dimensions.js

    r7353 r7394  
    105105
    106106
    107                 borderwidth.left = jQuery(elem).css("borderLeftWidth");
    108                 borderwidth.right = jQuery(elem).css("borderRightWidth");
    109                 borderwidth.top = jQuery(elem).css("borderTopWidth");
    110                 borderwidth.bottom = jQuery(elem).css("borderBottomWidth");
     107                borderwidth.left = jQuery(elem).Get_Val_int(jQuery(elem).css("borderLeftWidth"));
     108                borderwidth.right = jQuery(elem).Get_Val_int(jQuery(elem).css("borderRightWidth"));
     109                borderwidth.top = jQuery(elem).Get_Val_int(jQuery(elem).css("borderTopWidth"));
     110                borderwidth.bottom = jQuery(elem).Get_Val_int(jQuery(elem).css("borderBottomWidth"));
    111111                try {
    112                     borderwidth.width = jQuery(elem).css("borderWidth");
     112                    borderwidth.width = jQuery(elem).Get_Val_int(jQuery(elem).css("borderWidth"));
    113113                } catch (e) {
    114114                    borderwidth.width = '"' + borderwidth.left + ' ' + borderwidth.top + ' ' + borderwidth.right + ' ' + borderwidth.bottom + '"';
     
    116116
    117117
    118                 margin.left = jQuery(elem).css("marginLeft");
    119                 margin.right = jQuery(elem).css("marginRight");
    120                 margin.top = jQuery(elem).css("marginTop");
    121                 margin.bottom = jQuery(elem).css("marginBottom");
     118                margin.left = jQuery(elem).Get_Val_int(jQuery(elem).css("marginLeft"));
     119                margin.right = jQuery(elem).Get_Val_int(jQuery(elem).css("marginRight"));
     120                margin.top = jQuery(elem).Get_Val_int(jQuery(elem).css("marginTop"));
     121                margin.bottom = jQuery(elem).Get_Val_int(jQuery(elem).css("marginBottom"));
    122122                try {
    123                     margin.margin = jQuery(elem).css("margin");
     123                    margin.margin = jQuery(elem).Get_Val_int(jQuery(elem).css("margin"));
    124124                } catch (e) {
    125125                    margin.margin = '"' + margin.left + ' ' + margin.top + ' ' + margin.right + ' ' + margin.bottom + '"';
    126126                }
    127127
    128                 padding.left = jQuery(elem).css("paddingLeft");
    129                 padding.right = jQuery(elem).css("paddingRight");
    130                 padding.top = jQuery(elem).css("paddingTop");
    131                 padding.bottom = jQuery(elem).css("paddingBottom");
    132                 try { padding.padding = jQuery(elem).css("padding"); } catch (e) {
     128                padding.left = jQuery(elem).Get_Val_int(jQuery(elem).css("paddingLeft"));
     129                padding.right = jQuery(elem).Get_Val_int(jQuery(elem).css("paddingRight"));
     130                padding.top = jQuery(elem).Get_Val_int(jQuery(elem).css("paddingTop"));
     131                padding.bottom = jQuery(elem).Get_Val_int(jQuery(elem).css("paddingBottom"));
     132                try { padding.padding = jQuery(elem).Get_Val_int(jQuery(elem).css("padding")); } catch (e) {
    133133                    padding.padding = '"' + padding.left + ' ' + padding.top + ' ' + padding.right + ' ' + padding.bottom + '"';
    134134                }
     
    190190                offsetParent = offsetParent.offsetParent;
    191191            return jQuery(offsetParent);
     192        },
     193    /*
     194    * Get_val_int
     195    * params: element,valeur maxi
     196    * return: valeur entiere
     197    */
     198 
     199     Get_Val_int: function(myObj, Maxi_val, Mini_val) {
     200        var val = 0;
     201        var reg1 = new RegExp("%", "g")
     202        Maxi_val = parseInt(Maxi_val || "0");
     203
     204        /*
     205        - numérique suivie de px ou % ou pt ou em,
     206        - thin, bordure mince,
     207        - medium, bordure moyenne (valeur par défaut),
     208        - thick, bordure épaisse,
     209        - inherit, hérite de son parent (css2).
     210        */
     211
     212        if (!myObj) {
     213            return Maxi_val;
    192214        }
     215        if (typeof (myObj) == "string") {
     216            if (myObj == "none") return Maxi_val;
     217            if (myObj == "auto") return Maxi_val;
     218            if (Mini_val)
     219                if (myObj < Mini_val) return Maxi_val;
     220            switch (myObj) {
     221                case 'thin':
     222                    return 1;
     223                    break;
     224                case 'medium':
     225                    return 2;
     226                    break;
     227                case 'thick':
     228                    return 4;
     229                    break;
     230                case 'inherit':
     231
     232
     233                    break;
     234
     235                default:
     236
     237
     238                    break;
     239            }
     240
     241
     242
     243
     244
     245            if (myObj.match(reg1)) val = myObj * Maxi_val / 100;
     246            val = parseInt(myObj);
     247
     248        } else
     249            val = parseInt(myObj);
     250
     251
     252        if (typeof (val) == "NaN") return Maxi_val;
     253        return val;
     254    }
    193255    });
    194256    /*
     
    198260        return parseInt(jQuery.curCSS(el.jquery ? el[0] : el, prop, true)) || 0;
    199261    };
     262
     263
     264
    200265})(jQuery);
Note: See TracChangeset for help on using the changeset viewer.