Ignore:
Timestamp:
Nov 6, 2012, 3:30:32 PM (11 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4 (charlie's)

File:
1 edited

Legend:

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

    r18946 r18949  
    299299    }
    300300    //__________  Set_llbgo _______________
    301 
     301    var wpng = 0;
    302302    /********************************************
    303303    *  window LOAD
     
    310310      infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true });
    311311      infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
    312       infos_theMainImage_obj = jQuery("#" + "theMainImage_obj").infos();
     312      theMainImage_obj = "theMainImage_obj";
     313      infos_theMainImage_obj = jQuery("#" + theMainImage_obj).infos({ absolute: true });
     314
    313315      infos_theMainImage_obj.rapport = infos_theMainImage_obj.width / infos_theMainImage_obj.height;
    314 
    315316      if (infos_theMainImage.width == 0) {
    316         if (Type_Img == "charlie") {
     317        if (Type_Img == "pamoorama") {
     318          infos_theMainImage = jQuery("#pamoorama").infos(true);
     319          theMainImage_id = "#pamoorama";
     320          options.valide = true;
     321        } else if (Type_Img == "charlie") {
    317322          infos_theMainImage = jQuery("#charlie").infos(true);
    318323          theMainImage_id = "charlie";
     
    331336          jQuery("#iframe").height(infos_theMainImage.height);
    332337
    333         } else if (Type_Img == "pamoorama") {
    334           infos_theMainImage = jQuery("#pamoorama").infos(true);
    335           theMainImage_id = "#pamoorama";
    336           options.valide = true;
     338
    337339
    338340        } else {
    339 
    340341          jQuery("img").each(function (i) {
    341 
    342342            imgSrc = options.imgSrc;
    343 
    344 
    345343          });
    346344          infos_theMainImage = jQuery("#theImage img").infos();
    347 
    348345        }
    349346        if (infos_theMainImage.id == "")
     
    873870
    874871        if (Type_Img == "charlie" || Type_Img == "iframe") {
    875           jQuery("#" + "theMainImage_obj").attr("width", Zone_image.image.height * infos_theMainImage_obj.rapport);
    876           jQuery("#" + "theMainImage_obj").attr("height", Zone_image.image.height);
    877           jQuery("#" + Type_Img).attr("width", Zone_image.image.width);
    878           jQuery("#" + Type_Img).attr("height", Zone_image.image.height);
    879           swfobj = jQuery("#" + Type_Img).infos({ absolute: true });
     872
     873
     874          if (Type_Img == "charlie") {
     875            dp1 = jQuery("#charlie").offset();
     876            dp = jQuery("#" + theMainImage_obj).offset();
     877            if (dp) {
     878              if (wpng == 0)
     879                wpng = (dp.left - dp1.left) * 2;
     880            }
     881            mrgl = (jQuery("#" + "theImage").width() - Zone_image.image.width) / 2;
     882            png_h = jQuery("#" + Type_Img + " div").height();
     883            jQuery("#" + Type_Img).css({ marginLeft: mrgl + "px" });
     884            jQuery("#" + Type_Img).width(Zone_image.image.width);
     885            jQuery("#" + Type_Img).height(Zone_image.image.height);
     886
     887            w01 = jQuery("#" + theMainImage_obj).width();
     888            jQuery("#" + theMainImage_obj).attr("width", Zone_image.image.width - wpng);
     889            jQuery("#" + theMainImage_obj).attr("height", Zone_image.image.height);
     890            jQuery("#theMainImage_emb").attr("width", Zone_image.image.width - wpng);
     891            jQuery("#theMainImage_emb").attr("height", Zone_image.image.height);
     892            jQuery("#theMainImage").height(png_h);
     893            jQuery("#" + Type_Img).height(png_h);
     894         
     895
     896          } else {
     897            jQuery("#" + theMainImage_obj).attr("width", Zone_image.image.width);
     898            jQuery("#" + theMainImage_obj).attr("height", Zone_image.image.height);
     899            jQuery("#" + Type_Img).attr("width", Zone_image.image.width);
     900            jQuery("#" + Type_Img).attr("height", Zone_image.image.height);
     901          }
     902
     903
     904
     905          jQuery("#" + Type_Img).show(options.fade_in);
    880906        }
    881907
     
    13351361        options.theImageMargeZone = Zone_image.marges;
    13361362        if (Type_Img != 'charlie') {
    1337           /*
    1338           if (options.pictureSelType != "SelMaxi" && options.pictureSelType != "Autosize") {
    1339           options.pictureMap = options.pictureDeriv;
    1340            
    1341           imgSrc = options.liste_type[6];
    1342           changeImgSrc(imgSrc, options.pictureDeriv, options.pictureMap, options.pictureSelType);
    1343           src = theImg.src;
    1344           return;
    1345           } else {
    1346           IMg = Get_Maxi(Zone_image.image);
    1347           }
    1348           */
    13491363          IMg = Get_Maxi(Zone_image.image);
    13501364          imgSrc = IMg.url;
     
    13741388        identique = Zone_image.src.match(RegExp(imgSrc, "gi"));
    13751389        if (identique) return;
    1376         href_path = "javascript:changeImgSrc('" + imgSrc + IMg.pictureDeriv + "', '" + "', '" + IMg.pictureMap + "', '" + options.pictureSelType + "')";
     1390        href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + IMg.pictureDeriv + "', '" + IMg.pictureMap + "', '" + options.pictureSelType + "')";
    13771391        jQuery(".linkAutosize").attr("href", href_path);
    13781392        theImg = document.getElementById(theMainImage_id.replace("#", ""));
     
    16351649      }
    16361650      if (Type_Img == "charlie") {
     1651        width_theMainImage = height_theMainImage * options.ratio;
     1652        Zone_image.image_init.rapport = options.ratio;
    16371653
    16381654      } else if (Type_Img == "pamoorama") {
     
    17691785        case "charlie":
    17701786
     1787          Zone_image.zoom = 1;
     1788
    17711789          break
    17721790
    17731791        case "iframe":
     1792          wpng = 0;
    17741793          Zone_image.image.width = options.theImageWidth;
    17751794          Zone_image.image.height = options.theImageHeight;
     
    21282147
    21292148
    2130   });                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 // ready
     2149  });                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     // ready
    21312150
    21322151
Note: See TracChangeset for help on using the changeset viewer.