Ignore:
Timestamp:
Nov 1, 2010, 10:25:51 AM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] save.

File:
1 edited

Legend:

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

    r7458 r7536  
    1 var cl_visible = true;
     1
    22function Toggle_bp() {
    33    cl_visible = !cl_visible;
     
    2020
    2121jQuery(document).ready(
     22
    2223      function (jQuery) {
     24         
     25
     26          if (DEBUG == "false") {
     27              jQuery("#Debug").hide();
     28              jQuery("#Debug1").hide();
     29              jQuery("#Debug2").hide();
     30          }
    2331          var img_top = "0";
    2432
     
    3038          var marges_llgbo = 0;
    3139          if (llgboframe.length > 0) {
    32 
    33               marges_llgbo = jQuery(llgboframe).outerWidth() - jQuery("#gbo div:last").innerWidth();
     40              ll1 = jQuery(llgboframe).info();
     41              ll2 = jQuery("#gbo div:last").info();
     42              marges_llgbo = (ll1.width - ll2.width) + ll2.borderwidth.left + ll2.borderwidth.right;
    3443          }
    3544
     
    4756
    4857
    49 
     58          //=============================================================
    5059          function cl_Timer() {
    5160              //   if (!jQuery.browser.msie) { jQuery(function () { alert(jQuery.browser.version); }); }
     
    6473              setTimeout("cl_Timer()", 500);
    6574          }
     75          //=============================================================
    6676          function onPropertyChange(e) {
    6777              var el = e.srcElement;
     
    8999          */
    90100          function Info_entete(Parent) {
     101         
    91102              var info_imageToolBar = jQuery("#imageToolBar").info();
    92103              if (info_imageToolBar.position == "absolute") {
     
    97108
    98109              if (info_theImage.position == "relative") {
    99                   //--- passage absolute ==> static ===/
     110                  //--- passage relative ==> static ===/
    100111                  jQuery("#theImage").css("position", "static");
    101112                  info_theImage = jQuery("#theImage").info();
     
    108119
    109120              }
    110 
     121 
    111122              marge_top = Info_the_page.top +
    112123                                     Info_the_page.borderwidth.top +
     
    122133          */
    123134          function Info_description(Parent) {
    124               jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px "
    125               });
     135
     136
    126137              //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
    127138
     
    136147                      marginRight: "auto",
    137148                      marginTop: "0px",
    138                       marginBottom: "0px"
     149                      marginBottom: "0px", position: "absolute", top: Bandeau + "px"
    139150                  });
    140151              } else {
    141                   jQuery("#" + Parent).css({ padding: "0px",
    142                       marginLeft: "auto",
    143                       marginRight: "auto",
    144                       marginTop: "0px",
    145                       marginBottom: "0px"
     152
     153                  /*   jQuery("#" + Parent).css({ padding: "0px",
     154                  marginLeft: "auto",
     155                  marginRight: "auto",
     156                  marginTop: "0px",
     157                  marginBottom: "0px"
    146158                  });
    147               }
     159                  */
     160
     161              }
     162
     163
     164              //   jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px "    });
     165
    148166
    149167              if (theme.match(RegExp("luciano", "g"))) {
    150                   info_img = jQuery("#" + Parent + " #theImg").info();
     168                  info_img = jQuery("#" + Parent + " #theImg img").info();
     169
    151170              } else {
    152171
     
    165184              //=============================================================================
    166185              info_desc = jQuery("#" + Parent + " p:first").info();
     186              if (info_desc.bottom < info_img.bottom)
     187                  info_desc.bottom = info_img.bottom;
     188
    167189              //  if (info_desc.top > info_img.bottom)
    168190              //     info_description.top = info_desc.top;
    169191
    170 
     192              if (jQuery("#Panorama").length) {
     193                  Type_Img = "panorama";
     194                  //  cl_visible = false;
     195
     196              }
    171197              info_table = jQuery(".infoTable").info();
    172198
     
    180206              if (info_licencetag.bottom > 0) {
    181207                  jQuery(".licencetag").css("border", "solid 5px transparent");
    182                   if (info_licencetag.bottom > info_licencetag.height)
    183                       info_description.bottom = info_licencetag.bottom - 3;
     208                  if (info_licencetag.bottom > info_description.bottom) {
     209                      info_description.bottom = info_licencetag.bottom;
     210                  }
    184211                  else
    185                       info_description.bottom -= info_licencetag.padding.top + info_table.margin.top;
     212                      info_description.bottom += info_table.margin.top + info_table.padding.top;
    186213
    187214              }
     
    217244                  }
    218245              }
     246
     247              if (theme.match(RegExp("luciano", "g"))) { info_description.bottom -= 30 }
     248
    219249              info_description.height = info_description.bottom - info_description.top;
    220250
    221               if (0) {
     251
     252              if (DEBUG == "true") {
     253
    222254                  /*  jQuery("#Debug").text(jQuery("#Debug").text() + user_status);   
    223255       
    224                   jQuery("#Debug").hide();
    225                   jQuery("#Debug1").hide();
    226                   jQuery("#Debug2").hide();
     256
    227257                  info_description.width = "800";
    228258                  */
    229 
     259                  jQuery("#Debug").css('display', 'block');
     260                  jQuery("#Debug1").show();
     261                  jQuery("#Debug2").show();
    230262                  Bandeau_bas = info_description;
    231263
     
    257289                  });
    258290                  jQuery("#Debug2").text("Debug2:Bandeau_bas bottom :" + Bandeau_bas.bottom);
    259                   //  cl_visible = false;
     291
    260292              }
    261293
     
    285317              jQuery().recentrage_widget();
    286318          })
    287 
     319          jQuery("#icon_gmaps").bind('click', function () {
     320              jQuery().recentrage_widget();
     321          })
    288322
    289323
     
    315349          jQuery(window).resize(function (event, ui) {
    316350              if (typeof (event) == 'undefined') return;
    317               if (!cl_visible) return;
     351              if (!cl_visible == true) return;
    318352              if (eval(user_status + "_enabled") == "") return;
    319353              var chk = eval(user_status + "_enabled");
     
    334368              //===========================================================================
    335369
    336 
    337               var Cadre = jQuery("#theImage").get(0);
    338370
    339371              var Type_Img = "";
     
    349381              } else if (jQuery("#Panorama").length) {
    350382                  Type_Img = "panorama";
    351               } else if (jQuery(Cadre).find("img").length > 0) {
     383              } else if (jQuery("#theImage").find("img").length > 0) {
    352384                  Type_Img = "img";
    353385              } else if (jQuery("img").length > 0) {
     
    360392
    361393
     394              var Cadre = jQuery("#theImage").get(0);
    362395              var info_Cadre = jQuery(Cadre).info();
    363396              //===============  Information cadre ======
     
    379412              var info_theHeader = jQuery("#theHeader").info();
    380413
    381               var marge = (Zone_Affichage.width - info_ToolBar.width) / 2;
     414
     415              var marge = 0;
     416              if (info_ToolBar.width > 0)
     417                  marge = (Zone_Affichage.width - info_ToolBar.width) / 2;
    382418
    383419              var marge_right = marge;
     
    394430
    395431              winwidth -= (marge_right + marge_left);
     432
    396433
    397434
     
    454491
    455492                  case "panorama":
    456 
    457                       var w00 = 0;
    458                       jQuery("#Panorama img").each(function (i) {
    459                           w0 = this.width;
    460                           if (w0 > w00) {
    461                               TheImg = this;
    462                               n = TheImg.nameProp;
    463                               w00 = w0;
    464                           }
    465                       });
    466 
     493                      // return;
     494
     495
     496                      TheImg = Get_Img_Maxi("#Panorama img");
    467497                      info_theImage = jQuery(TheImg).info();
    468498                      info_the_page = jQuery("#the_page").info();
     
    472502
    473503                      if (!TheImg) return;
     504                      if (theme.match(RegExp("luciano", "g"))) {
     505                          TheImg = jQuery("#the_page #theImg");
     506                      }
    474507                      info_theImage = jQuery(TheImg).info();
    475508                      info_the_page = jQuery("#the_page").info();
     
    573606              var Licence = jQuery(".licencetag");
    574607              info_Licence = jQuery(".licencetag").info();
    575               //==================================================================================
     608
    576609              jQuery("#theImage #theImg IMG").css("marginTop", "0px")
    577 
     610              //========== Correction en fonction du thème =============================
    578611              var correction = 0;
    579612              if (theme.match(RegExp("sobre", "g"))) {
     
    584617                  correction += 0; //??
    585618              } else if (theme.match(RegExp("luciano", "g"))) {
    586                   correction += 0; //??
     619                  correction = 0; //??
     620
    587621              } else if (theme.match(RegExp("simple", "g"))) {
    588622                  correction += 0; //??
     
    682716
    683717                  t1 = jQuery(llgboframe).info();
    684 
    685 
     718                  if (!TheImg.src) {
     719                      TheImg = jQuery(TheImg).find("img").get(0)
     720                  }
    686721                  if (TheImg.src) {
    687722
     
    689724                      Image_height -= marges_llgbo; // réduction frame
    690725                      if (rapport > 1) {
    691                           jQuery("#gbo").outerWidth(Image_width);
    692                           jQuery("#gbo").css("width", Image_width + "px");
    693 
     726                          if (Image_width > winwidth) {
     727                              jQuery("#gbo").outerWidth(winwidth);
     728                              jQuery("#gbo").css("width", winwidth + "px");
     729                          }
     730                          else {
     731                              jQuery("#gbo").outerWidth(Image_width);
     732                              jQuery("#gbo").css("width", Image_width + "px");
     733                          }
    694734
    695735                          t1 = jQuery("#gbo div:last").info();
    696736
    697                           Image_width = jQuery("#gbo div:last").innerWidth();
     737                          Image_width = t1.width - (t1.borderwidth.left + t1.borderwidth.right);
    698738                          Image_height = parseInt(Image_width / rapport);
    699739
    700740                          jQuery("#gbo").outerHeight(Image_height + marges_llgbo);
    701741                          jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
    702                           if ( jQuery.browser.msie) {
    703                               jQuery("#gbo").css("paddingBottom", 18 + "px");
     742                          if (jQuery.browser.msie) {
     743                              jQuery("#gbo").css("paddingBottom", 17 + "px");
    704744                          }
    705745
     
    707747                          Image_height -= 4;
    708748                          Image_width -= 4;
     749                          if (Image_width > winwidth) {
     750                              jQuery("#gbo").outerWidth(winwidth);
     751                              jQuery("#gbo").css("width", winwidth + "px");
     752                          }
     753                          else {
     754                              jQuery("#gbo").outerWidth(Image_width);
     755                              jQuery("#gbo").css("width", Image_width + "px");
     756                          }
     757
    709758                          jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
     759                          jQuery("#gbo").height(Image_height + marges_llgbo);
     760
    710761                          jQuery("#gbo").css("width", Image_width + marges_llgbo + "px");
    711 
    712                           Image_width = jQuery("#gbo div:last").innerWidth();
    713                           Image_height = parseInt(Image_width / rapport);
     762                          jQuery("#gbo").width(Image_width + marges_llgbo);
     763
     764
     765
     766                          if (jQuery.browser.msie) {
     767                              jQuery("#gbo").css("paddingBottom", 17 + "px");
     768                          }
    714769
    715770                      }
    716 
     771                      //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
     772                      a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]");
    717773                      a1 = jQuery("area[rel=prev]");
    718774                      a2 = jQuery("area[rel=next]");
    719 
     775                      a3 = jQuery("area[rel=up]");
     776                      nb_zone = 3;
    720777                      if (a1.length == 0) {
    721                           jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + 0 + "," + 0 + "'" });
    722                           jQuery("area[rel=up]").attr({ coords: "'" + 0 + ",0," + Image_width / 2 + "," + Image_height + "'" });
    723                           jQuery("area[rel=next]").attr({ coords: "'" + Image_width / 2 + ",0," + (Image_width) + "," + Image_height + "'" });
    724 
    725                       } else if (a2.length == 0) {
    726                           jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + (Image_width) / 2 + "," + Image_height + "'" });
    727                           jQuery("area[rel=up]").attr({ coords: "'" + Image_width / 2 + ",0," + (Image_width * 2) / 2 + "," + Image_height + "'" });
    728                           jQuery("area[rel=next]").attr({ coords: "'" + 0 + ",0," + 0 + "," + 0 + "'" });
    729 
     778                          nb_zone -= 1;
     779                      }
     780                      if (a2.length == 0) {
     781                          nb_zone -= 1;
     782                      }
     783
     784
     785                      var Largeur_zone = (Image_width / nb_zone);
     786                      var Hauteur_zone = (Image_height);
     787                      var init_zone = 0;
     788
     789                      if (a1.length > 0) {
     790                          coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone };
     791
     792                          jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
     793                          init_zone += Largeur_zone;
     794                      }
     795
     796                      coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
     797
     798                      if (a0.length > 0) {
     799                          jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" });
     800                          jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" });
    730801                      } else {
    731 
    732                           jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + (Image_width) / 3 + "," + Image_height + "'" });
    733                           jQuery("area[rel=up]").attr({ coords: "'" + Image_width / 3 + ",0," + (Image_width * 2) / 3 + "," + Image_height + "'" });
    734                           jQuery("area[rel=next]").attr({ coords: "'" + (Image_width * 2) / 3 + ",0," + (Image_width) + "," + Image_height + "'" });
     802                          jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" });
    735803                      }
    736 
     804                      init_zone += Largeur_zone;
     805
     806                      if (a2.length > 0) {
     807                          coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
     808                          jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
     809                      }
     810
     811
     812
     813
     814
     815                      /*
     816                      jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + (Image_width) / nb_zone + "," + Image_height + "'" });
     817                      jQuery("area[rel=up]").attr({ coords: "'" + Image_width * (nb_zone - 1) / (nb_zone + 1) + ",0," + (Image_width * (nb_zone - 1)) / (nb_zone + 1) + "," + Image_height + "'" });
     818                      jQuery("area[rel=next]").attr({ coords: "'" + (Image_width * (nb_zone - 1)) / (nb_zone + 1) + ",0," + (Image_width * (nb_zone + 1)) / (nb_zone + 1) + "," + Image_height + "'" });
     819                      */
    737820
    738821                  }
     
    742825              //  Image_height, Image_width = valeur a atteindre.
    743826              if (theme.match(RegExp("luciano", "g"))) {
     827                  //---- information en dehors du cadre
    744828                  Zone_Affichage.height -= Bandeau_bas.height;
    745829                  jQuery(Cadre).height(Zone_Affichage.height);
     
    749833              //=========================================================
    750834
    751               jQuery(Cadre).css("top", "0px");
     835              //  jQuery(Cadre).css("top", "0px");
    752836              jQuery("#standard").css("top", 0 + "px");
    753837              jQuery("#comments").css("top", 0 + "px");
     
    794878              } else if (Type_Img == "panorama") {
    795879
    796                   //      jQuery(TheImg).panorama2(img_finale.height, img_finale.width);
    797                   jQuery(TheImg).height(img_finale.height);
    798                   jQuery(TheImg).width(img_finale.width);
     880                  // -----     jQuery(TheImg).panorama2(img_finale.height, img_finale.width);
     881                  // jQuery(TheImg).height(img_finale.height);
     882                  // jQuery(TheImg).width(img_finale.width);
    799883                  jQuery("#Panorama div").height(Image_height);
    800884                  //  class=simple_panorama
     
    854938                  jQuery(TheImg).css("height", img_finale.height + "px");
    855939                  jQuery(TheImg).css("width", img_finale.width + "px");
     940
    856941              }
    857942
     
    889974                      if (jQuery("#navThumbPrev").length > 0) {
    890975                          jQuery("#navThumbPrev").css({ height: info_img.height + "px",
    891                               top: info_img.top 
     976                              top: info_img.top
    892977                          });
    893978                      }
    894979                      if (jQuery("#navThumbNext").length > 0) {
    895980                          jQuery("#navThumbNext").css({ height: info_img.height + "px",
    896                               top: info_img.top 
     981                              top: info_img.top
    897982                          });
    898983                      }
     
    902987                  } else {
    903988
    904                       jQuery("#imageToolBar").css("position", "static");
     989                      //    jQuery("#imageToolBar").css("position", "static");
    905990                  }
    906991              } catch (e) {
     
    9461031
    9471032      } // function
    948 );                                                                                                                                                                                                                                                                                                                                                                                         // ready
     1033);                                                                                                                                                                                                                                                                                                                                                                                                                                // ready
    9491034    /*
    9501035*
Note: See TracChangeset for help on using the changeset viewer.