Changeset 16589


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

[extensions] Autosize fix compatibility with 2.4

Location:
extensions/Autosize
Files:
4 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 = {
  • extensions/Autosize/js/autosize.cookie.js

    r16579 r16589  
    5454 * @author Klaus Hartl/klaus.hartl@stilbuero.de
    5555 */
    56 jQuery.cl_cookie = function(name, value, options) {
     56jQuery.cookie = function(name, value, options) {
    5757    if (typeof value != 'undefined') { // name and value given, set cookie
    5858        options = options || {};
     
    9696    };
    9797
     98    if (jQuery.cookie('picture-menu') == 'visible') {
     99      jQuery("head").append("<style type=\"text/css\">#content.contentWithMenu, #the_page > .content {margin-left:240px;}</style>");
     100    } else {
     101      jQuery("head").append("<style type=\"text/css\">#the_page #menubar {display:none;} #content.contentWithMenu, #the_page > .content {margin-left:35px;}</style>");
     102    }
    98103 
     104    function hideMenu(delay) {
     105      var menubar = jQuery("#menubar");
     106      var menuswitcher = jQuery("#menuSwitcher");
     107      var content = jQuery("#the_page > .content");
     108      var pcontent = jQuery("#content");
     109
     110      menubar.hide(delay);
     111      menuswitcher.addClass("menuhidden").removeClass("menushown");
     112      content.addClass("menuhidden").removeClass("menushown");
     113      pcontent.addClass("menuhidden").removeClass("menushown");
     114      jQuery.cookie('picture-menu', 'hidden', { path: "/" });
     115
     116    }
     117
     118    function showMenu(delay) {
     119
     120      var menubar = jQuery("#menubar");
     121      var menuswitcher = jQuery("#menuSwitcher");
     122      var content = jQuery("#the_page > .content");
     123      var pcontent = jQuery("#content");
     124
     125      menubar.show(delay);
     126      menuswitcher.addClass("menushown").removeClass("menuhidden");
     127      content.addClass("menushown").removeClass("menuhidden");
     128      pcontent.addClass("menushown").removeClass("menuhidden");
     129      jQuery.cookie('picture-menu', 'visible', { path: "/" });
     130
     131    }
     132
     133    function hideInfo(delay) {
     134
     135      var imageInfos = jQuery("#imageInfos");
     136      var infoswitcher = jQuery("#infoSwitcher");
     137      var theImage = jQuery("#theImage");
     138
     139      imageInfos.hide(delay);
     140      infoswitcher.addClass("infohidden").removeClass("infoshown");
     141      theImage.addClass("infohidden").removeClass("infoshown");
     142      jQuery.cookie('side-info', 'hidden', { path: "/" });
     143
     144    }
     145
     146    function showInfo(delay) {
     147
     148      var imageInfos = jQuery("#imageInfos");
     149      var infoswitcher = jQuery("#infoSwitcher");
     150      var theImage = jQuery("#theImage");
     151
     152      imageInfos.show(delay);
     153      infoswitcher.addClass("infoshown").removeClass("infohidden");
     154      theImage.addClass("infoshown").removeClass("infohidden");
     155      jQuery.cookie('side-info', 'visible', { path: "/" });
     156
     157    }
     158
     159    jQuery("document").ready(function (jQuery) {
     160
     161      // side-menu show/hide
     162
     163      var sidemenu = jQuery.cookie('picture-menu');
     164      var menubar = jQuery("#menubar");
     165
     166      if (menubar.length == 1) {
     167
     168        jQuery("#menuSwitcher").html("<div class=\"switchArrow\">&nbsp;</div>");
     169
     170        // if cookie says the menu is hiding, keep it hidden!
     171        if (sidemenu == 'visible') {
     172          showMenu(0);
     173        } else {
     174          hideMenu(0);
     175        }
     176
     177        jQuery("#menuSwitcher").click(function () {
     178          if (jQuery("#menubar").is(":hidden")) {
     179            showMenu(0);
     180            return false;
     181          } else {
     182            hideMenu(0);
     183            return false;
     184          }
     185        });
     186
     187      }
     188
     189      // info show/hide
     190
     191      var sideinfo = jQuery.cookie('side-info');
     192      var imageInfos = jQuery("#imageInfos");
     193
     194      if (imageInfos.length == 1) {
     195
     196        jQuery("#infoSwitcher").html("<div class=\"switchArrow\">&nbsp;</div>");
     197
     198        // if cookie says the menu is hiding, keep it hidden!
     199        if (sideinfo == 'hidden') {
     200          hideInfo(0);
     201        } else {
     202          showInfo(0);
     203        }
     204
     205        jQuery("#infoSwitcher").click(function () {
     206          if (jQuery("#imageInfos").is(":hidden")) {
     207            showInfo(0);
     208            return false;
     209          } else {
     210            hideInfo(0);
     211            return false;
     212          }
     213        });
     214
     215      }
     216
     217      // comments show/hide
     218
     219      var commentsswicther = jQuery("#commentsSwitcher");
     220      var comments = jQuery("#thePicturePage #comments");
     221
     222      commentsswicther.html("<div class=\"switchArrow\">&nbsp;</div>");
     223
     224      if (comments.length == 1) {
     225        var comments_button = jQuery("#comments h3");
     226
     227        if (comments_button.length == 0) {
     228          jQuery("#addComment").before("<h3>Comments</h3>");
     229          comments_button = jQuery("#comments h3");
     230        }
     231
     232        if (jQuery.cookie('comments') == 'visible') {
     233          comments.addClass("commentsshown");
     234          comments_button.addClass("comments_toggle").addClass("comments_toggle_off");
     235        } else {
     236          comments.addClass("commentshidden");
     237          comments_button.addClass("comments_toggle").addClass("comments_toggle_on");
     238        }
     239
     240        comments_button.click(function () { commentsToggle() });
     241        commentsswicther.click(function () { commentsToggle() });
     242
     243      }
     244
     245
     246    });
     247
     248    function commentsToggle() {
     249      var comments = jQuery("#thePicturePage #comments");
     250      var comments_button = jQuery("#comments h3");
     251
     252      if (comments.hasClass("commentshidden")) {
     253        comments.removeClass("commentshidden").addClass("commentsshown");
     254        comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_on"); ;
     255        jQuery.cookie('comments', 'visible', { path: "/" });
     256      } else {
     257        comments.addClass("commentshidden").removeClass("commentsshown");
     258        comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_off"); ;
     259        jQuery.cookie('comments', 'hidden', { path: "/" });
     260      }
     261
     262    }
  • extensions/Autosize/template/header_2_2.tpl

    r16579 r16589  
    1212{combine_script id="jquery.cluetip" path = "themes/default/js/plugins/jquery.cluetip.js" require="jquery" }
    1313{combine_script id="autosize.dimensions" path = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" require="jquery"}
    14 {combine_script id="autosize.cookie" path = $AUTOSIZE_PATH|@cat:"js/autosize.cookie.js" require="jquery" }
     14
    1515
    1616
  • extensions/Autosize/template/picture_2_2.tpl

    r16579 r16589  
    11{combine_script id="Affiche_script" path= $AUTOSIZE_PATH|@cat:"js/Affiche_script.js" require='jquery,conflit_script'  }
     2{if $theme != "elegant"}{/if}
     3{combine_script id="autosize.cookie" path = $AUTOSIZE_PATH|@cat:"js/autosize.cookie.js" require="jquery"  }
Note: See TracChangeset for help on using the changeset viewer.