Changeset 18944


Ignore:
Timestamp:
Nov 5, 2012, 8:39:40 PM (11 years ago)
Author:
cljosse
Message:

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

Location:
extensions/Autosize/js
Files:
2 edited

Legend:

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

    r18941 r18944  
    129129        frm1 = jQuery("#theImage" + " " + type_src).get(0);
    130130        Type_Img = "iframe";
    131 
    132131        //'fb - xfbml - like - button
    133 
    134132        objs = jQuery("#theImage" + " div").get(0);
    135133        if (jQuery(objs).length > 0) {
     
    141139              jQuery(frm1).attr("id", "charlie");
    142140            } else {
    143               Type_Img = "img";
     141              //  Type_Img = "img";
    144142            }
    145143          }
    146144        } else {
    147145          jQuery(frm1).attr("id", "iframe");
     146          jQuery(frm1).wrap('<div id="' + "theMainImage" + '" style="border:1px solid Transparent" />');
    148147        }
    149148
     
    320319
    321320          infos_theMainImage = jQuery("#iframe").infos(true);
    322           theMainImage_id = "iframe";
     321
    323322          options.valide = true;
    324323
     
    868867
    869868
    870         if (Type_Img == "charlie" || Type_Img == "iframe") {
     869          if (Type_Img == "charlie" || Type_Img == "iframe") {
     870            jQuery("#" + "theMainImage_obj").attr("width",Zone_image.image.width);
     871             jQuery("#" + "theMainImage_obj").attr("height",Zone_image.image.height);
     872          jQuery("#" + Type_Img).attr("width",Zone_image.image.width);
     873          jQuery("#" + Type_Img).attr("height",Zone_image.image.height);
    871874          swfobj = jQuery("#" + Type_Img).infos({ absolute: true });
    872875
     
    911914        document.cookie = 'picture_sel_type=' + type + ';path=' + COOKIE_PATH;
    912915      } else {
    913      
     916
    914917        jQuery('#derivativeChecked' + typeSave).css('visibility', 'visible');
    915918        document.cookie = 'picture_sel_type=' + typeSave + ';path=' + COOKIE_PATH;
     
    12621265          vn = this;
    12631266          size_derive = { w: parseInt(vn[2]), h: parseInt(vn[3]) };
    1264           if (vn[0] == options.pictureSelType || vn[0] == "Original" ) {
     1267          if (vn[0] == options.pictureSelType || vn[0] == "Original") {
    12651268            maxi_size = size_derive;
    12661269            maxi_size.idx = n;
     
    13711374        identique = Zone_image.src.match(RegExp(imgSrc, "gi"));
    13721375        if (identique) return;
    1373         href_path = "javascript:changeImgSrc('" + imgSrc + IMg.pictureDeriv + "', '"+ "', '" + IMg.pictureMap + "', '" + options.pictureSelType + "')";
     1376        href_path = "javascript:changeImgSrc('" + imgSrc + IMg.pictureDeriv + "', '" + "', '" + IMg.pictureMap + "', '" + options.pictureSelType + "')";
    13741377        jQuery(".linkAutosize").attr("href", href_path);
    13751378        theImg = document.getElementById(theMainImage_id.replace("#", ""));
     
    16831686      options.theImageLeft = new_dim.left;
    16841687      options.theImageRight = (new_win.width - new_dim.right);
     1688      options.marge_bottom = Math.ceil(new_dim.out.bottom - new_img.out.bottom);
     1689      if (Type_Img == "iframe") { }
     1690      new_dim.out.bottom = new_win.height - options.marge_bottom;
     1691
    16851692      options.theImageBottom = new_win.height - new_dim.out.bottom;
    16861693      options.marge_top = Math.ceil(new_img.top - new_dim.top);
    1687       options.marge_bottom = Math.ceil(new_dim.out.bottom - new_img.out.bottom);
     1694
    16881695      if (options.theImageBottom < 0) {
    16891696        options.theImageBottom = 0;
     
    16941701      if (chk == "") { return; }
    16951702
    1696       if (Type_Img != "map")
     1703      if (Type_Img != "map" && Type_Img != "iframe")
    16971704        Select_Image();
    16981705      infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true });
     
    17671774          Zone_image.image.width = options.theImageWidth;
    17681775          Zone_image.image.height = options.theImageHeight;
     1776          Zone_image.zoom = 1;
    17691777          break
    17701778        case "pamoorama":
     
    21202128
    21212129
    2122   });                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           // ready
     2130  });                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              // ready
    21232131
    21242132
  • extensions/Autosize/js/autosize_ajax.js

    r18744 r18944  
    1818  function progress(success,data) {
    1919    if (success) {
    20        jQuery("#theMainImage").trigger("ON", [{ nb: derivatives.total - derivatives.done, total: derivatives.total, done: derivatives.done,status:"ok",src:data.url,Width:data.Width,Height:data.Height}]);
     20      try {
     21        jQuery("#theMainImage").trigger("ON", [{ nb: derivatives.total - derivatives.done, total: derivatives.total, done: derivatives.done, status: "ok", src: data.url, Width: data.Width, Height: data.Height}]);
     22      } catch (e) {
     23
     24      }
    2125    } else {
    2226
     
    8185                j = derivatives.done;
    8286                derivatives.done++;
    83                 for (var j = 0; j < params.src.length; j++) {
    84                   if (data.url.match(params.src[j])) {
    85                     params.src[j] = ""; break;
     87                try {
     88                  for (var j = 0; j < params.src.length; j++) {
     89                    if (data.url.match(params.src[j])) {
     90                      params.src[j] = ""; break;
     91                    }
    8692                  }
     93                  data.Width = Width;
     94                  data.Height = Height;
     95                } catch (e) {
     96
    8797                }
    88                 data.Width = Width;
    89                 data.Height = Height;
    9098                progress(true, data);
    9199              }),
Note: See TracChangeset for help on using the changeset viewer.