Ignore:
Timestamp:
May 2, 2013, 5:56:33 PM (11 years ago)
Author:
cljosse
Message:

[extensions] Autosize update to piwigo 2.5 (fix bugs with jquery 1.9 )

File:
1 edited

Legend:

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

    r22367 r22467  
    805805    // REPONSE TRIGGER
    806806    // ===========================================================
    807     jQuery('#ret_autosize').live('ON', function (e) {
     807    jQuery(document).on('ON','#ret_autosize', function (e) {
    808808      if (nu_img == "") nu_img = 8;
    809809      jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
     
    825825    // jQuery("#llgbo").trigger("ON");
    826826    // ==================================
    827     jQuery(llgbo_id).live('ON', function (e) {
     827    jQuery(window).on('ON',llgbo_id, function (e) {
    828828      n_id = this;
    829829      infos_llgbo = jQuery(llgbo_id).infos();
     
    845845    // jQuery("#mapPicture").trigger("ON");
    846846    // ==============================
    847     jQuery("#mapPicture").live('ON', function (e) {
     847    jQuery(window).on('ON',"#mapPicture", function (e) {
    848848      p2 = jQuery("#infoSwitcher").infos();
    849849    });
     
    851851    // jQuery("#map").trigger("ON");
    852852    // ==============================
    853     jQuery("#map").live('ON', function (e) {
     853    jQuery(window).on('ON', "#map", function (e) {
    854854      p2 = jQuery("#map").infos();
    855855    });
     
    857857    // jQuery(theImage_id).trigger("ON");
    858858    // ===================================
    859     jQuery("#imageInfos").live('on', function (e) {
     859    jQuery(window).on('ON', "#imageInfos", function (e) {
    860860      target = e.target.id;
    861861    });
     
    864864    // jQuery(theImage_id).trigger("ON");
    865865    // ===================================
    866     jQuery(theImage_id).live('ON', function (e) {
     866    jQuery(window).on('ON', theImage_id, function (e) {
    867867      target = e.target.id;
    868868
     
    871871    });
    872872
    873     jQuery("#theMainImage").load(function (e) {
     873    jQuery("#theMainImage").on("load",function (e) {
    874874      if (!e.target.src) return;
    875875      if (e.target.src.match(RegExp("gif", "gi"))) {
     
    878878
    879879    });
     880
     881
    880882    jQuery("#theMainImage").resize(function (e) {
    881883
     
    890892
    891893    // =================================================================
    892     jQuery(document).live('gallyInterfaceReady', function (e) {
     894    jQuery(document).on('on','gallyInterfaceReady', function (e) {
    893895      i = jQuery(this).text();
    894896      jQuery(this).trigger('ON');
     
    921923    // jQuery("#theImageAndInfos").trigger("ON");
    922924    // ===========================================
    923     jQuery("#theImageAndInfos").live('ON', function (e) {
     925    jQuery(window).on('ON', "#theImageAndInfos", function (e) {
    924926      infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();
    925927      // setTimeout(function () { Autosize_resize(true) }, 100);
     
    10371039      nauto = Get_dimensions(true, parametres);
    10381040      if (nauto == "Wait") {
    1039         setTimeout(function (force, parametres) { Autosize_resize(force, parametres); }, 100);
     1041        setTimeout(function (force, parametres) { Autosize_resize(force,options); }, 100);
    10401042        return;
    10411043      }
     
    11901192      mypanorama = window.myPamoorama;
    11911193      if (mypanorama) {
    1192         jQuery(mypanorama).live('ON', function (e) {
     1194        jQuery(window).on('ON', mypanorama, function (e) {
    11931195          jQuery(jQuery('.debug').get(1)).trigger('ON');
    11941196          Autosize_resize(true, options);
     
    11991201        // jQuery(theImage_id).trigger("Start_right");
    12001202        // ===============================================
    1201         jQuery(mypanorama).live('Start_right', function (e) {
     1203        jQuery(window).on('Start_right', mypanorama, function (e) {
    12021204          if (typeof Zone_image == "undefined") return
    12031205          test_w = window.myPamoorama.autoSlideFx.to;
     
    12141216        // jQuery(theImage_id).trigger("Start_left");
    12151217        // ===============================================
    1216         jQuery(mypanorama).live('Start_left', function (e) {
     1218        jQuery(window).on('Start_left', mypanorama, function (e) {
    12171219          if (typeof Zone_image == "undefined") return
    12181220          jQuery(theImage_id).show(0);
     
    18231825      if (Type_Img != "map" && Type_Img != "iframe")
    18241826        if (Select_Image() == "Wait") {
    1825           return "Wait";
     1827          if (!Zone_image.src.match("error")) 
     1828        return "Wait";
    18261829        }
    18271830      useMap = options.pictureSelType;
     
    20242027    * DEBUG ....
    20252028    **************************************************************************/
    2026     /*
    2027     * if (DEBUG_autosize.match("true",gi)) { for (var i = 0; i < 10; i++) {
    2028     * jQuery('#adddebugs').click(); } jQuery(jQuery('.debug').get(i -
    2029     * 1)).click(); }
    2030     */
     2029    /**/
     2030      if (DEBUG_autosize.match(new RegExp( "true","gi") )) { for (var i = 0; i < 10; i++) {
     2031      jQuery('#adddebugs').click(); } jQuery(jQuery('.debug').get(i -
     2032      1)).click(); }
     2033   
    20312034
    20322035    // Custom Event, ON to turn on a debug.
    2033     jQuery('.debug').live('ON', function (e) {
     2036    jQuery(document).on('ON','.debug', function (e) {
    20342037
    20352038      nu_img = jQuery(this).text();
     
    20402043
    20412044    // On Click = debugs On
    2042     jQuery('.debug').live('click', function (e) {
     2045    jQuery(document).on('click','.debug', function (e) {
    20432046      i = jQuery(this).text();
    20442047      jQuery(this).trigger('ON');
     
    20462049
    20472050    // Custom Event, Turn off a debug
    2048     jQuery('.debug').live('OFF', function (e) {
     2051    jQuery('.debug').on('OFF', '.debug', function (e) {
    20492052      jQuery(this).removeClass('debugOn');
    20502053    });
    20512054
    20522055    // on Double Click, remove the debug from the DOM
    2053     jQuery('.debug').live('dblclick', function () {
     2056    jQuery('.debug').on('dblclick', '.debug', function (e) {
    20542057      jQuery(this).fadeOut(function () { jQuery(this).remove(); });
    20552058    });
Note: See TracChangeset for help on using the changeset viewer.