Ignore:
Timestamp:
Jul 10, 2012, 3:06:15 PM (12 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4

File:
1 edited

Legend:

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

    r16579 r16589  
    145145      Zone_image = Calcul_Image(nds == "none");
    146146
     147      jQuery("#theImage").width(Zone_image.container.width);
     148      jQuery("#theImage").height(Zone_image.image.height + 5);
    147149
    148150      jQuery(theMainImage_obj).width(Zone_image.image.width);
    149 
     151      jQuery(theMainImage_obj).height(Zone_image.image.height);
    150152
    151153
     
    165167      test_w = window.myPamoorama.autoSlideFx.to;
    166168      test_w = window.myPamoorama.autoScrollFx.to;
     169      jQuery("#pamoorama_thumb img").height(47);
    167170    });
    168171
     
    172175      test_w = window.myPamoorama.autoSlideFx.to;
    173176      test_w = window.myPamoorama.autoScrollFx.to;
     177      jQuery("#pamoorama_thumb img").height(47);
    174178
    175179    });
     
    219223    //=====================================================================
    220224    jQuery("#infoSwitcher").click(function () {
     225
    221226      jQuery("#llgbo").trigger("ON");
    222227      jQuery("#theImage").css({ textAlign: "center" });
     
    270275
    271276            wx = parseInt(nw[0]);
    272             //wh = parseInt(wx / rapport);
     277            wh = parseInt(wx / rapport);
    273278            //jQuery("#theImage").css("height", wh + "px");
    274279            jQuery(theImg).width(wx);
    275             // jQuery(theImg).height(wh);
     280            jQuery(theImg).height(wh);
    276281          }
    277282        }
     
    279284
    280285    });  // fin click #derivativeSwitchBox a
    281     //==========================================================
     286
    282287    //=========================================================================
    283288    Autosize_init = function (name, value) {
     
    313318      Zone_Affichage = jQuery("#theImage").infos();
    314319
    315       jQuery.cl_cookie('path', cookie_path, { path: cookie_path });
    316       typeMap = jQuery.cl_cookie('picture_map');
    317       typeSave = jQuery.cl_cookie('picture_deriv');
    318       old_img = jQuery.cl_cookie('img');
    319       old_img_h = jQuery.cl_cookie('img_h');
    320       old_img_w = jQuery.cl_cookie('img_w');
    321       old_window_height = jQuery.cl_cookie('window_height');
    322       old_window_width = jQuery.cl_cookie('window_width');
     320      jQuery.cookie('path', cookie_path, { path: cookie_path });
     321      typeMap = jQuery.cookie('picture_map');
     322      typeSave = jQuery.cookie('picture_deriv');
     323      old_img = jQuery.cookie('img');
     324      old_img_h = jQuery.cookie('img_h');
     325      old_img_w = jQuery.cookie('img_w');
     326      old_window_height = jQuery.cookie('window_height');
     327      old_window_width = jQuery.cookie('window_width');
    323328      //============================================================
    324329      img_init = { height: img_height, width: img_width };  // taille initiale
     
    337342    //===========================================================================
    338343    Autosize_resize = function (force, parametres) {
    339 
     344      if (typeof rapport == "undefined") return;
    340345      if (force && force == true) old_window.width = 0;
    341346      id_map = jQuery(theMainImage_obj).attr("usemap");
     
    367372      //=============================================================
    368373      if (Type_Img == "pamoorama") {
    369         if (theMainImage_obj == "#pamoorama") {
     374        theMainImage_obj = "#pamoorama"
    370375          Set_Pamoorama();
    371         }
     376
    372377      }
    373378      if (Type_Img == "map") {
     
    493498          img_reelle.height = img_height;
    494499          img_reelle.width = Zone_Affichage.width;
    495           if (myPamoorama) theMainImage_obj = myPamoorama.image;
     500          if (typeof myPamoorama != "undifened") theMainImage_obj = myPamoorama.image;
    496501          infos_theImage = jQuery("#pamoorama").infos();
    497502          infos_theImage.height = infos_theImage.height;
     
    10851090        if (typeof theMainImage_obj != "undefined") {
    10861091          var theImg = document.getElementById("theMainImage");
    1087           jQuery.cl_cookie('img', theImg.src, cookie_path); // créer un cookie avec une valeur
     1092          jQuery.cookie('img', theImg.src, cookie_path); // créer un cookie avec une valeur
    10881093          theImg.useMap = theImg.useMap || "autosize";
    10891094
    1090           jQuery.cl_cookie('picture_map', theImg.useMap, { path: cookie_path });
    1091           jQuery.cl_cookie('img_h', jQuery(theMainImage_obj).height(), { path: cookie_path });
    1092           jQuery.cl_cookie('img_w', jQuery(theMainImage_obj).width(), { path: cookie_path });
     1095          jQuery.cookie('picture_map', theImg.useMap, { path: cookie_path });
     1096          jQuery.cookie('img_h', jQuery(theMainImage_obj).height(), { path: cookie_path });
     1097          jQuery.cookie('img_w', jQuery(theMainImage_obj).width(), { path: cookie_path });
    10931098
    10941099          if (typeof Window_Affichage != "undefined") {
    1095             jQuery.cl_cookie('window_height', Window_Affichage.height, { path: cookie_path });
    1096             jQuery.cl_cookie('window_width', Window_Affichage.width, { path: cookie_path });
     1100            jQuery.cookie('window_height', Window_Affichage.height, { path: cookie_path });
     1101            jQuery.cookie('window_width', Window_Affichage.width, { path: cookie_path });
    10971102          }
    10981103        }
     
    12071212
    12081213          document.cookie = 'picture_deriv=' + typeSave + ';path="' + cookie_path + '" ';
    1209           jQuery.cl_cookie('picture_deriv', typeSave, { path: cookie_path });
    1210           jQuery.cl_cookie('picture_map', typeMap, { path: cookie_path });
     1214        jQuery.cookie('picture_deriv', typeSave, { path: cookie_path });
     1215        jQuery.cookie('picture_map', typeMap, { path: cookie_path });
    12111216          theImg.src = url; // charge Image
    12121217
     
    19771982        }
    19781983
    1979         jQuery("#pamoorama_inner1").css({
    1980           "transform": "scale(" + Zoom_pano + ")",
    1981           "-ms-transform": "scale(" + Zoom_pano + ")", /* IE 9 */
    1982           "-webkit-transform": "scale(" + Zoom_pano + ")", /* Safari and Chrome */
    1983           "-o-transform": "scale(" + Zoom_pano + ")", /* Opera */
    1984           "-moz-transform": "scale(" + Zoom_pano + ")", /* Firefox */
    1985           "transform-origin": "0 0",
    1986           "-ms-transform-origin": "0 0", /* IE 9 */
    1987           "-webkit-transform-origin": "0 0", /* Safari and Chrome */
    1988           "-moz-transform-origin": "0 0", /* Firefox */
    1989           "-o-transform-origin": "0 0", /* Opera */
    1990           "background-size": "100%"
    1991         });
    19921984        jQuery("#pamoorama_inner").css({ width: new_image.width, height: new_image.height, "background-size": "100%"
    19931985        });
     
    20112003
    20122004        //  jQuery("#pamoorama_thumb").width(200 /  Zone_image.zoom);
    2013         jQuery("#pamoorama_thumb").css({ "width": "" });
     2005
    20142006        jQuery("#pamoorama_outter").css({
    20152007
     
    20242016        });
    20252017
    2026 
    2027         jQuery("#pamoorama_thumb").width(200);
    20282018        window.myPamoorama.options.width = Math.ceil(Zone_image.container.width);
    20292019        //==================================================================
     
    20412031        window.myPamoorama.imageHeight = new_image.height;
    20422032
    2043         //  200 = new_image.width
    2044         thumb_z = (Zone_image.container.width / window.myPamoorama.ratio);
    2045         thumb_h = (new_image.height / window.myPamoorama.ratio) * Zoom_pano;
    2046 
    2047         jQuery("#pamoorama_frame").css({
    2048           width: thumb_z + "px"
    2049 
    2050         });
    2051 
    2052         window.myPamoorama.frame.setStyle('width', thumb_z);
     2033
    20532034      } // test img
    20542035    } // Set_Pamoorama
     
    20792060        src_infos_1 = src5;
    20802061      }
     2062      jQuery("#theMainImage").height(jQuery("#theMainImage").width() / rapport);
     2063
    20812064      Zone_image.zoom = (Zone_image.image.height / Zone_image.height_init);
     2065 
    20822066      zoom_cl = parseInt(100 * Zone_image.zoom);
     2067      zoom_cl = Zone_image.zoom;
    20832068      jQuery('#zoom ').val(zoom_cl);
     2069
    20842070      zoom_cl = jQuery('#zoom ').val();
    20852071      jQuery('#bp_cla').attr('alt', src_info);
     
    22182204        }
    22192205      }
    2220       retrait_h += (b * 2)
     2206      retrait_h += (b * 2) - 5;
     2207      retrait_img += 5;
     2208
    22212209      height_theImage = jQuery(window).height() - retrait_h;
    22222210      width_theImage -= retrait_w;
    22232211      //===============================================================
    2224       width_theMainImage = width_theImage - retrait_img;
    2225       height_theMainImage = parseInt(width_theImage / rapport) - (retrait_img);
     2212      width_theMainImage = (width_theImage - retrait_img);
     2213      height_theMainImage = parseInt(width_theImage / rapport);
    22262214
    22272215      //===============================================================
     
    22492237      height_theImage += (b * 2);
    22502238      if (height_theImage > height_theMainImage + retrait_h) {
     2239        if (Type_Img != "pamoorama") {
    22512240        height_theImage = height_theMainImage + retrait_h;
    22522241      }
     2242      }
     2243      height_theMainImage = width_theMainImage / rapport;
    22532244
    22542245      Zone_image = {
Note: See TracChangeset for help on using the changeset viewer.