Changeset 16589 for extensions/Autosize/js
- Timestamp:
- Jul 10, 2012, 3:06:15 PM (12 years ago)
- Location:
- extensions/Autosize/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/js/Affiche_script.js
r16579 r16589 145 145 Zone_image = Calcul_Image(nds == "none"); 146 146 147 jQuery("#theImage").width(Zone_image.container.width); 148 jQuery("#theImage").height(Zone_image.image.height + 5); 147 149 148 150 jQuery(theMainImage_obj).width(Zone_image.image.width); 149 151 jQuery(theMainImage_obj).height(Zone_image.image.height); 150 152 151 153 … … 165 167 test_w = window.myPamoorama.autoSlideFx.to; 166 168 test_w = window.myPamoorama.autoScrollFx.to; 169 jQuery("#pamoorama_thumb img").height(47); 167 170 }); 168 171 … … 172 175 test_w = window.myPamoorama.autoSlideFx.to; 173 176 test_w = window.myPamoorama.autoScrollFx.to; 177 jQuery("#pamoorama_thumb img").height(47); 174 178 175 179 }); … … 219 223 //===================================================================== 220 224 jQuery("#infoSwitcher").click(function () { 225 221 226 jQuery("#llgbo").trigger("ON"); 222 227 jQuery("#theImage").css({ textAlign: "center" }); … … 270 275 271 276 wx = parseInt(nw[0]); 272 //wh = parseInt(wx / rapport);277 wh = parseInt(wx / rapport); 273 278 //jQuery("#theImage").css("height", wh + "px"); 274 279 jQuery(theImg).width(wx); 275 //jQuery(theImg).height(wh);280 jQuery(theImg).height(wh); 276 281 } 277 282 } … … 279 284 280 285 }); // fin click #derivativeSwitchBox a 281 //========================================================== 286 282 287 //========================================================================= 283 288 Autosize_init = function (name, value) { … … 313 318 Zone_Affichage = jQuery("#theImage").infos(); 314 319 315 jQuery.c l_cookie('path', cookie_path, { path: cookie_path });316 typeMap = jQuery.c l_cookie('picture_map');317 typeSave = jQuery.c l_cookie('picture_deriv');318 old_img = jQuery.c l_cookie('img');319 old_img_h = jQuery.c l_cookie('img_h');320 old_img_w = jQuery.c l_cookie('img_w');321 old_window_height = jQuery.c l_cookie('window_height');322 old_window_width = jQuery.c l_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'); 323 328 //============================================================ 324 329 img_init = { height: img_height, width: img_width }; // taille initiale … … 337 342 //=========================================================================== 338 343 Autosize_resize = function (force, parametres) { 339 344 if (typeof rapport == "undefined") return; 340 345 if (force && force == true) old_window.width = 0; 341 346 id_map = jQuery(theMainImage_obj).attr("usemap"); … … 367 372 //============================================================= 368 373 if (Type_Img == "pamoorama") { 369 if (theMainImage_obj == "#pamoorama") {374 theMainImage_obj = "#pamoorama" 370 375 Set_Pamoorama(); 371 } 376 372 377 } 373 378 if (Type_Img == "map") { … … 493 498 img_reelle.height = img_height; 494 499 img_reelle.width = Zone_Affichage.width; 495 if ( myPamoorama) theMainImage_obj = myPamoorama.image;500 if (typeof myPamoorama != "undifened") theMainImage_obj = myPamoorama.image; 496 501 infos_theImage = jQuery("#pamoorama").infos(); 497 502 infos_theImage.height = infos_theImage.height; … … 1085 1090 if (typeof theMainImage_obj != "undefined") { 1086 1091 var theImg = document.getElementById("theMainImage"); 1087 jQuery.c l_cookie('img', theImg.src, cookie_path); // créer un cookie avec une valeur1092 jQuery.cookie('img', theImg.src, cookie_path); // créer un cookie avec une valeur 1088 1093 theImg.useMap = theImg.useMap || "autosize"; 1089 1094 1090 jQuery.c l_cookie('picture_map', theImg.useMap, { path: cookie_path });1091 jQuery.c l_cookie('img_h', jQuery(theMainImage_obj).height(), { path: cookie_path });1092 jQuery.c l_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 }); 1093 1098 1094 1099 if (typeof Window_Affichage != "undefined") { 1095 jQuery.c l_cookie('window_height', Window_Affichage.height, { path: cookie_path });1096 jQuery.c l_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 }); 1097 1102 } 1098 1103 } … … 1207 1212 1208 1213 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 }); 1211 1216 theImg.src = url; // charge Image 1212 1217 … … 1977 1982 } 1978 1983 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 });1992 1984 jQuery("#pamoorama_inner").css({ width: new_image.width, height: new_image.height, "background-size": "100%" 1993 1985 }); … … 2011 2003 2012 2004 // jQuery("#pamoorama_thumb").width(200 / Zone_image.zoom); 2013 jQuery("#pamoorama_thumb").css({ "width": "" }); 2005 2014 2006 jQuery("#pamoorama_outter").css({ 2015 2007 … … 2024 2016 }); 2025 2017 2026 2027 jQuery("#pamoorama_thumb").width(200);2028 2018 window.myPamoorama.options.width = Math.ceil(Zone_image.container.width); 2029 2019 //================================================================== … … 2041 2031 window.myPamoorama.imageHeight = new_image.height; 2042 2032 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 2053 2034 } // test img 2054 2035 } // Set_Pamoorama … … 2079 2060 src_infos_1 = src5; 2080 2061 } 2062 jQuery("#theMainImage").height(jQuery("#theMainImage").width() / rapport); 2063 2081 2064 Zone_image.zoom = (Zone_image.image.height / Zone_image.height_init); 2065 2082 2066 zoom_cl = parseInt(100 * Zone_image.zoom); 2067 zoom_cl = Zone_image.zoom; 2083 2068 jQuery('#zoom ').val(zoom_cl); 2069 2084 2070 zoom_cl = jQuery('#zoom ').val(); 2085 2071 jQuery('#bp_cla').attr('alt', src_info); … … 2218 2204 } 2219 2205 } 2220 retrait_h += (b * 2) 2206 retrait_h += (b * 2) - 5; 2207 retrait_img += 5; 2208 2221 2209 height_theImage = jQuery(window).height() - retrait_h; 2222 2210 width_theImage -= retrait_w; 2223 2211 //=============================================================== 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); 2226 2214 2227 2215 //=============================================================== … … 2249 2237 height_theImage += (b * 2); 2250 2238 if (height_theImage > height_theMainImage + retrait_h) { 2239 if (Type_Img != "pamoorama") { 2251 2240 height_theImage = height_theMainImage + retrait_h; 2252 2241 } 2242 } 2243 height_theMainImage = width_theMainImage / rapport; 2253 2244 2254 2245 Zone_image = { -
extensions/Autosize/js/autosize.cookie.js
r16579 r16589 54 54 * @author Klaus Hartl/klaus.hartl@stilbuero.de 55 55 */ 56 jQuery.c l_cookie = function(name, value, options) {56 jQuery.cookie = function(name, value, options) { 57 57 if (typeof value != 'undefined') { // name and value given, set cookie 58 58 options = options || {}; … … 96 96 }; 97 97 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 } 98 103 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\"> </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\"> </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\"> </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 }
Note: See TracChangeset
for help on using the changeset viewer.