Ignore:
Timestamp:
Oct 24, 2012, 5:29:52 PM (12 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4 (setup miniature when not admin_enabled)

File:
1 edited

Legend:

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

    r18726 r18731  
    591591    //=============================================================
    592592    theMainImage_st = false;
    593     jQuery("#theMainImage").error(function (e) {
    594       jQuery.noop();
    595     });
    596     jQuery("#theMainImage").bind("ON", function (e, data) {
    597       if (!data.status != "ok") {
    598         return;
    599       }
    600 
    601       if (data.done == 1)
    602         jQuery("#theMainImage").attr("src", nofile[data.done].file);
    603       jQuery.noop();
    604 
    605     });
    606     jQuery("#theMainImage").bind("Finish", function (e, data) {
    607 
    608       jQuery("#theMainImage").attr("src", nofile[1].file);
    609       if (typeof imageInfos_id == "undefined") return;
    610       Autosize_resize(true, options);
    611 
    612     });
     593
    613594
    614595    /***********************
    615596    *
    616597    **********************/
    617     jQuery("#theMainImage," + theMainImage_id + ",.preload, .next1 , ").load(function (e) {
    618       src = this.src;
    619       theMainImage_st = true;
    620       if (typeof Zone_image == "undefined") {
    621         Zone_image = {};
    622       }
    623       Zone_image.image_init = { width: this.width, height: this.height, rapport: this.width / this.height
    624 
    625       }
    626       // Autosize_resize(true, options);
    627 
    628       return;
    629 
    630       if (typeof theMainImage_id != "undefined")
    631         if (!init_img(this)) {
    632           nu_img = 0;
    633         }
    634 
    635 
    636     });
     598    jQuery("#theMainImage," + theMainImage_id + ",.preload, .next1 , ")
     599        .load(function (e) {         
     600          src = this.src;
     601          theMainImage_st = true;
     602          if (typeof Zone_image == "undefined") {
     603            Zone_image = {};
     604          }
     605          Zone_image.image_init = { width: this.width, height: this.height, rapport: this.width / this.height }
     606          return;
     607          if (typeof theMainImage_id != "undefined")
     608            if (!init_img(this)) {
     609              nu_img = 0;
     610            }
     611          })
     612         .error(function (e) {
     613
     614         })
     615         .bind("Finish", function (e, data) {             
     616              if (typeof imageInfos_id == "undefined") return;
     617                  Autosize_resize(true, options);
     618          })
     619          .bind("ON", function (e, data) {
     620         if (data.status != "ok") {
     621           popup = jQuery(".errors");
     622           if (popup.length == 0) {
     623             jQuery("#theImage").append("<div class='errors'><span></span></div>");
     624           }
     625           jQuery(".errors").text("Erreur : [" + data.done + "] " + data.responseText);
     626           jQuery(".errors").show().delay(20000).hide(2000);
     627           return;
     628         }
     629         if (data.src) {
     630           theImg = document.getElementById(theMainImage_id.replace("#", ""));
     631            jQuery("#theMainImage").attr("src", data.src);
     632            theImg.src = data.src;
     633           if (data.src.match(RegExp(options.pictureDeriv.substr(0, 2) + ".jpg", "gi"))) {
     634             theImg.src = options.imgSrc;
     635
     636           }
     637         }
     638       });
     639
     640
     641    ;
     642
     643
     644
     645
     646    ;
    637647    //_________ theMainImage  ___________
    638648
     
    938948          swfobj = jQuery("#theMainImage").infos({ absolute: true });
    939949
    940           jQuery("#theMainImage_obj").attr({height: Zone_image.image.height,width:Zone_image.image.width-50});
     950          jQuery("#theMainImage_obj").attr({ height: Zone_image.image.height, width: Zone_image.image.width - 50 });
    941951          jQuery("#theMainImage_emb").attr({ height: Zone_image.image.height, width: Zone_image.image.width });
    942952
     
    21452155
    21462156
    2147   });                                                                                                                                                                                                                                                                                                                                                                                                                                                              // ready
     2157  });                                                                                                                                                                                                                                                                                                                                                                                                                                                                     // ready
    21482158
    21492159
Note: See TracChangeset for help on using the changeset viewer.