Changeset 18744 for extensions/Autosize


Ignore:
Timestamp:
Oct 25, 2012, 5:33:32 PM (11 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4 (prechargement)

Location:
extensions/Autosize/js
Files:
2 edited

Legend:

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

    r18737 r18744  
    626626         .bind("Finish", function (e, data) {
    627627           if (typeof imageInfos_id == "undefined") return;
    628            Autosize_resize(true, options);
     628         
    629629         })
    630630          .bind("ON", function (e, data) {
     
    635635              }
    636636              jQuery(".errors").text("Erreur : [" + data.done + "] " + data.responseText);
    637               jQuery(".errors").show().delay(20000).hide(2000);
     637              jQuery(".errors").show().delay(10000).hide(2000);
    638638              return;
    639639            }
    640             if (data.src) {
    641               theImg = document.getElementById(theMainImage_id.replace("#", ""));
    642               jQuery("#theMainImage").attr("src", data.src);
    643               theImg.src = data.src;
    644               if (data.src.match(RegExp(options.pictureDeriv.substr(0, 2) + ".jpg", "gi"))) {
    645                 theImg.src = options.imgSrc;
    646 
     640            if (data.src) {
     641             if (typeof imageInfos_id == "undefined") return;
     642              if (data.src.match(RegExp(options.pictureDeriv.substr(0, 2) + ".jpg", "gi"))) {             
     643             //   Autosize_resize(true, options);
    647644              }
    648645            }
  • extensions/Autosize/js/autosize_ajax.js

    r18737 r18744  
    1818  function progress(success,data) {
    1919    if (success) {
    20       jQuery("#theMainImage").height(params.height[derivatives.done]);
    21       jQuery("#theMainImage").width(params.width[derivatives.done]);
    22 
    23       jQuery("#theMainImage").show();
    24       jQuery("#theMainImage").trigger("ON", [{ nb: derivatives.total - derivatives.done, total: derivatives.total, done: derivatives.done,status:"ok",src:data.url}]);
     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}]);
    2521    } else {
    2622
     
    4440  function getDerivativeUrls(nofile) {
    4541    params.max_urls = nofile.length;
     42    Width = jQuery("#theMainImage").width();
     43    Height = jQuery("#theMainImage").height();
     44
    4645    jQuery(nofile).each(function (i, t) {
    4746      if (typeof t.file != "undefined") {
     
    5251          params.types.push(t.type);
    5352          params.src.push(t.file);
    54           params.width.push(t.width);
    55           params.height.push(t.height);
     53         
    5654
    5755        } else if (~jQuery.inArray(t.file, params.src)) {
     
    6159          params.types.push(t.type);
    6260          params.src.push(t.file);
    63           params.width.push(t.width);
    64           params.height.push(t.height);
     61 
    6562        }
    6663      }
     
    8986                  }
    9087                }
     88                data.Width = Width;
     89                data.Height = Height;
    9190                progress(true, data);
    9291              }),
Note: See TracChangeset for help on using the changeset viewer.