Changeset 16610
- Timestamp:
- Jul 11, 2012, 2:47:45 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/js/Affiche_script.js
r16594 r16610 135 135 theImg = this; 136 136 name_src = theImg.src; 137 img_init.width = jQuery(this).width(); 138 img_init.height = jQuery(this).height(); 137 139 if (theImg.naturalWidth) 138 140 img_init.width = theImg.naturalWidth; 139 141 if (theImg.naturalHeight) 140 142 img_init.height = theImg.naturalHeight; 141 143 img_init.rapport = theImg.naturalWidth / theImg.naturalHeight; 144 nu_img = 0; 142 145 theMainImage_obj = "#theMainImage"; 143 144 nds = jQuery("#imageInfos").css("display"); //inline-block 145 Zone_image = Calcul_Image(nds == "none"); 146 147 jQuery("#theImage").width(Zone_image.container.width); 148 jQuery("#theImage").height(Zone_image.image.height + 5); 149 150 jQuery(theMainImage_obj).width(Zone_image.image.width); 151 jQuery(theMainImage_obj).height(Zone_image.image.height); 152 153 146 Autosize_resize(true); 154 147 }); 155 148 … … 163 156 // jQuery("#theImage").trigger("OK"); 164 157 jQuery("#theImage").live('Start_right', function (e) { 158 if (typeof Zone_image == "undefined") return 165 159 if (nu_img == "") nu_img = 7; 166 160 jQuery(jQuery('.debug').get(nu_img)).trigger('ON'); 167 161 test_w = window.myPamoorama.autoSlideFx.to; 168 162 test_w = window.myPamoorama.autoScrollFx.to; 169 jQuery("#pamoorama_thumb img").height(47); 163 nf = jQuery("#pamoorama_thumb").height(); 164 jQuery("#pamoorama_thumb img").width(200); 165 jQuery("#pamoorama_thumb img").height(nf); 166 // 200=window.myPamoorama.imageWidth 167 // frame = Zone_image.container.width 168 169 nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth; 170 jQuery("#pamoorama_frame").width(nw); 171 172 173 170 174 }); 171 175 172 176 jQuery("#theImage").live('Start_left', function (e) { 177 if (typeof Zone_image == "undefined") return 173 178 if (nu_img == "") nu_img = 7; 174 179 jQuery(jQuery('.debug').get(nu_img)).trigger('ON'); 175 180 test_w = window.myPamoorama.autoSlideFx.to; 176 181 test_w = window.myPamoorama.autoScrollFx.to; 177 jQuery("#pamoorama_thumb img").height(47); 182 nf = jQuery("#pamoorama_thumb").height(); 183 jQuery("#pamoorama_thumb img").width(200); 184 jQuery("#pamoorama_thumb img").height(nf); 185 186 nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth; 187 jQuery("#pamoorama_frame").width(nw); 178 188 179 189 }); … … 214 224 215 225 216 //=========================================== ==========================226 //=========================================== 217 227 // jQuery("#theImageAndInfos").trigger("ON"); 228 //=========================================== 218 229 jQuery("#theImageAndInfos").live('ON', function (e) { 219 230 infos_theImageAndInfos = jQuery("#theImageAndInfos").infos(); … … 221 232 222 233 }); // fin click #theImageAndInfos ON 223 //===================================================================== 224 jQuery("#infoSwitcher").click(function () { 225 234 235 //========================================== 236 // 237 //========================================== 238 jQuery("#infoSwitcher, #menuSwitcher").click(function () { 226 239 jQuery("#llgbo").trigger("ON"); 227 240 jQuery("#theImage").css({ textAlign: "center" }); 228 241 nu_img = 0; 242 theImage_init("#theImage"); 229 243 Autosize_resize(true); 230 231 244 }); // fin click infoSwitcher 232 //==================================================== 233 234 //piwigo 2.4 235 // Add another debug to the DOM 245 //================================== 246 // 247 //=================================== 236 248 jQuery('#derivativeCheckedAutosize').click(function () { 237 249 pathnames = jQuery(this).attr("href").split(":"); … … 366 378 if (chk == "") { return true; } 367 379 //================================================================= 368 var winwidth = jQuery(window).width();369 var winheight = jQuery(window).height();380 var winwidth = infos_body.width; 381 var winheight = infos_body.height; 370 382 nds = jQuery("#imageInfos").css("display"); //inline-block //block simple 383 nds1 = jQuery("#menubar").css("display"); //inline 384 if (Type_Img == "pamoorama") { 385 theMainImage_obj = "#pamoorama"; 386 } 371 387 Zone_image = Calcul_Image(nds == "none"); 372 //=============================================================373 if (Type_Img == "pamoorama") {374 theMainImage_obj = "#pamoorama"375 Set_Pamoorama();376 377 }378 if (Type_Img == "map") {379 380 Set_Map();381 382 }383 384 388 //================================================================= 385 set_cl();386 jQuery("#theImage").width(Zone_image.container.width);387 jQuery("#theImage").height(Zone_image.container.height);388 n = winwidth - old_window.width;389 if (Math.abs(n) < 1) {390 n = winheight - old_window.height;391 if (Math.abs(n) < 1) {392 return false;393 }394 }395 396 if (Math.abs(n) > 30) nu_img = 0;397 nu_img++;398 if (nu_img > 10) return true;399 400 389 old_window = jQuery(window).infos(); 401 390 //========= Récupération des informations ============= 402 403 404 391 var Licence = jQuery(".licencetag"); 405 392 infos_Licence = jQuery(".licencetag").infos(); 406 407 408 393 //================================================================= 409 410 394 switch (Type_Img) { 411 395 case "map": 412 413 396 Set_Map(true); 414 415 ;416 417 397 break 418 398 case "panorama": … … 432 412 jQuery("#theImage").height(infos_theImage.height); 433 413 img_finale.height = infos_theImage.height; 434 435 414 break 436 415 case "img": … … 482 461 break 483 462 case "charlie": 484 infos_theImage = infos_img; 463 img_reelle = { height: img_height, width: img_width }; 464 infos_img = jQuery(theMainImage_obj).infos(); ; 485 465 infos_the_page = jQuery("#the_page").infos(); 486 466 if (rapport < 0) { … … 498 478 img_reelle.height = img_height; 499 479 img_reelle.width = Zone_Affichage.width; 500 if (typeof myPamoorama != "und ifened") theMainImage_obj = myPamoorama.image;480 if (typeof myPamoorama != "undefined") theMainImage_obj = myPamoorama.image; 501 481 infos_theImage = jQuery("#pamoorama").infos(); 502 482 infos_theImage.height = infos_theImage.height; … … 539 519 if (img_reelle.height < parseInt(mini_height)) 540 520 return true; 541 //======================================================================542 set_cl();543 Set_Pamoorama();544 545 546 521 547 522 //=============== Zone d'affichage ============================ … … 565 540 Zone_Affichage.width = mini_width2; 566 541 //================================================= 567 568 569 570 //=============================================================571 542 var height_user = eval(user_status + "_height"); 572 543 var width_user = eval(user_status + "_width"); 573 544 var reg1 = new RegExp("%", "g"); 545 //============================================================= 574 546 if (height_user.match(reg1)) 575 547 Image_height = img_reelle.height * parseInt(height_user) / 100; … … 582 554 583 555 Image_height = parseInt(img_reelle.height * echelle); 584 585 var widthmin = winwidth; 556 Image_width = parseInt(img_reelle.width * echelle); 586 557 587 558 if (check_auto_w == 'checked="checked"') { 588 589 559 //==== largeur à atteindre === 590 560 var width_user = eval(user_status + "_width"); … … 592 562 if (width_user.match(reg1)) 593 563 // pourcentage 594 Image_width = widthmin* parseInt(width_user) / 100;564 Image_width = Zone_image.container.width * parseInt(width_user) / 100; 595 565 else 596 566 Image_width = parseInt(width_user); 597 567 598 }599 568 Image_height = parseInt(Image_width / rapport); 569 } else { 600 570 Image_width = parseInt(Image_height * rapport); 571 } 601 572 //==================================================== 602 573 // Zone_image.image.height = Image_height; 603 574 // Zone_image.image.width = Image_width; 604 575 //====================================================================== 576 set_cl(); 605 577 Set_Pamoorama(); 606 set_cl();607 jQuery(theMainImage_obj).height(Zone_image.image.height);608 578 jQuery("#theImage").width(Zone_image.container.width); 609 579 jQuery("#theImage").height(Zone_image.container.height); 610 580 jQuery(theMainImage_obj).height(Zone_image.image.height); 581 jQuery(theMainImage_obj).width(Zone_image.image.width); 611 582 return true; 612 583 … … 1132 1103 }); 1133 1104 */ 1134 // jQuery(':Set_Class');1105 //========================================================= 1135 1106 if (typeof img_width == "undefined") { 1136 1107 if (List_autosize.length == 0) return; … … 1139 1110 return true; 1140 1111 } 1141 //=========================================================1142 1143 1144 1145 1146 1112 //============================================================ 1147 1113 Autosize_init(); … … 1149 1115 if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top; 1150 1116 else Bandeau = 0; 1151 1152 theMainImage_obj = theMainImage_obj;1153 1117 Wait_Affichage(); 1154 1118 Autosize_resize(true, { id_map: "autosize" }); 1155 1156 1157 1119 }); // window.onload 1158 1120 /*********************************************************** … … 1848 1810 tw = jQuery(window).width(); 1849 1811 1812 th = infos_body.height; 1813 tw = infos_body.width; 1814 1850 1815 nds = jQuery("#imageInfos").css("display"); //inline-block 1851 Zone_image = Calcul_Image( false);1816 Zone_image = Calcul_Image(nds == "none"); 1852 1817 n0 = 0; 1853 1818 n1 = 0; 1854 1819 t0 = 0; 1855 th = th - Zone_image.top;1856 1820 tw = Zone_image.container.width; 1857 1821 th = Zone_image.container.height; … … 2010 1974 2011 1975 2012 2013 1976 window.myPamoorama.outter.scrollTo(new_max_left, 0); 2014 1977 … … 2017 1980 window.myPamoorama.imageWidth = new_image.width; 2018 1981 window.myPamoorama.imageHeight = new_image.height; 2019 1982 nf = jQuery("#pamoorama_thumb").height(); 1983 jQuery("#pamoorama_thumb img").width(200); 1984 jQuery("#pamoorama_thumb img").height(nf); 1985 // 200=window.myPamoorama.width 1986 // frame = Zone_image.container.width 1987 1988 nw = (window.myPamoorama.image.width * Zone_image.container.width) / window.myPamoorama.imageWidth; 1989 jQuery("#pamoorama_frame").width(nw); 1990 jQuery("#pamoorama").css({ 1991 width:"auto",height:"auto" 1992 }); 2020 1993 2021 1994 } // test img … … 2047 2020 src_infos_1 = src5; 2048 2021 } 2049 jQuery("#theMainImage").height(jQuery("#theMainImage").width() / rapport); 2022 2050 2023 Zone_image.zoom = (Zone_image.image.height / Zone_image.height_init); 2051 2024 zoom_cl = parseInt(100 * Zone_image.zoom); … … 2114 2087 + infos_theImage.padding.right); 2115 2088 2089 2116 2090 retrait_w += Math.ceil(infos_the_page.margin.left 2117 2091 + infos_the_page.margin.right … … 2124 2098 infos_body.margin.right); 2125 2099 2100 retrait_w += Math.ceil(infos_content.margin.left + 2101 infos_content.margin.right); 2126 2102 2127 2103 … … 2152 2128 retrait_img += Math.ceil(infos_llgbo.borderwidth.right + infos_llgbo.borderwidth.right); 2153 2129 2130 2131 2132 2133 // menuSwitcherwidth+padding 2134 2154 2135 if (theme.match(RegExp("elegant", "gi"))) { 2155 2136 if (all_width != true) { 2156 new_width = Math.ceil( 8 +2137 new_width = Math.ceil( 2157 2138 infos_imageInfos.width + 2158 2139 infos_imageInfos.borderwidth.left + … … 2162 2143 infos_imageInfos.padding.left + 2163 2144 infos_imageInfos.padding.right); 2145 2164 2146 } else { 2165 2147 new_width = 0; 2166 2148 } 2167 width_theImage = ( jQuery(window).width()- new_width)2149 width_theImage = (infos_body.width - new_width) 2168 2150 2169 2151 } else if (theme.match(RegExp("stripped", "gi"))) { … … 2174 2156 2175 2157 } else { 2176 width_theImage = ( jQuery(window).width());2158 width_theImage = (infos_body.width); 2177 2159 } 2178 2160 … … 2190 2172 retrait_h += (b * 2) - 5; 2191 2173 retrait_img += 5; 2174 retrait_w += 20; //??? 2192 2175 2193 2176 height_theImage = jQuery(window).height() - retrait_h; … … 2256 2239 } 2257 2240 2258 2259 /**************************************************2260 * onProperty2261 **************************************************/2262 onPropertyChange = function (e, obj) {2263 var el = obj;2264 attributs = el.attributes;2265 type_action = e.type;2266 style = "";2267 alt = "";2268 src = "";2269 2270 if (attributs.id) id = attributs.id.value;2271 if (attributs.style) style = attributs.style.value;2272 if (attributs.alt) alt = attributs.alt.value;2273 /* Image */2274 if (attributs.src) {2275 src = attributs.src.value;2276 if (attributs.width) width = attributs.width.value;2277 if (attributs.height) height = attributs.height.value;2278 }2279 affiche_debug({2280 Debug1: Debug_info(1, type_action + " : " + src, id + " action ")2281 2282 });2283 2284 2285 if (style)2286 switch (style) {2287 case "style.opacity":2288 2289 break;2290 case "style.transform":2291 2292 break;2293 case "style.display":2294 2295 break;2296 case "style.color":2297 2298 break;2299 case "style.width":2300 width = el.style.width;2301 break;2302 case "style.height":2303 height = el.style.height;2304 break;2305 2306 case 'width':2307 2308 break;2309 case 'height':2310 2311 el.style.height = el.attributes.height.nodeValue + 'px';2312 el.firstChild.style.height = el.clientHeight + 'px';2313 break;2314 }2315 }2316 2241 2317 2242 … … 2498 2423 * TEST 2499 2424 **************************************************/ 2425 2426 jQuery(document).ready(function () { 2500 2427 /* 2501 var y = 3; 2502 var txtTestBox = document.getElementById('testBox'); 2503 XBrowserAddHandler(txtTestBox, 'keyup', function() { 2504 myFunctionRef(y) 2428 var txtTestBox = document.getElementById('menubar'); 2429 XBrowserAddHandler(txtTestBox, 'propertychange', function () { 2430 onPropertyChange(txtTestBox); 2505 2431 }); 2506 var myFunctionRef = function myFunction(x, e) { 2507 var keyCode; 2508 if (!e && window.event) 2509 e = window.event; 2510 if (e) 2511 keyCode = (window.Event) ? e.which : e.keyCode; 2512 alert('You pressed: ' + keyCode + '. Event object is :' + e + '. x is: ' + x); 2513 } 2514 2515 */ 2432 var txtTestBox2 = document.getElementById('imageInfos'); 2433 XBrowserAddHandler(txtTestBox2, 'propertychange', function () { 2434 onPropertyChange(txtTestBox2); 2435 }); 2436 */ 2437 2438 /**/ 2516 2439 /************************************************** 2517 2440 * XBrowserAddHandler … … 2524 2447 else 2525 2448 target["on" + eventName] = handlerName; 2449 2450 } 2451 2452 /************************************************** 2453 * onProperty 2454 **************************************************/ 2455 function onPropertyChange(obj,e) { 2456 if (!e && window.event) 2457 e = window.event; 2458 if (e) 2459 keyCode = (window.Event) ? e.which : e.keyCode; 2460 var el = obj; 2461 attributs = el.attributes; 2462 type_action = e.type; 2463 style = ""; 2464 alt = ""; 2465 src = ""; 2466 if (attributs.id) id = attributs.id.value; 2467 if (attributs.style) style = attributs.style.value; 2468 if (attributs.alt) alt = attributs.alt.value; 2469 /* Image */ 2470 if (attributs.src) { 2471 src = attributs.src.value; 2472 if (attributs.width) width = attributs.width.value; 2473 if (attributs.height) height = attributs.height.value; 2474 } 2475 affiche_debug({ 2476 Debug1: Debug_info(1, type_action + " : " + src, id + " action ") 2477 2478 }); 2479 2480 2481 if (style) 2482 switch (style) { 2483 case "style.opacity": 2484 2485 break; 2486 case "style.transform": 2487 2488 break; 2489 case "style.display": 2490 2491 break; 2492 case "style.color": 2493 2494 break; 2495 case "style.width": 2496 width = el.style.width; 2497 break; 2498 case "style.height": 2499 height = el.style.height; 2500 break; 2501 2502 case 'width': 2503 2504 break; 2505 case 'height': 2506 2507 el.style.height = el.attributes.height.nodeValue + 'px'; 2508 el.firstChild.style.height = el.clientHeight + 'px'; 2509 break; 2526 2510 } 2511 } 2512 2513 2514 /************************************************** 2515 * TEST 2516 **************************************************/ 2517 2518 }); 2527 2519 2528 2520 /******************************************************** … … 2541 2533 } 2542 2534 2535 /**/
Note: See TracChangeset
for help on using the changeset viewer.