Changeset 18325 for extensions/Autosize/js/Affiche_script.js
- Timestamp:
- Sep 28, 2012, 11:13:50 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/js/Affiche_script.js
r18234 r18325 9 9 10 10 jQuery(document).ready(function (jQuery) { 11 12 13 14 15 11 var Type_Img; 16 12 var theImg; … … 71 67 } else if (jQuery("#Panorama").length) { 72 68 Type_Img = "panorama"; 69 73 70 } else if (jQuery("#pamoorama").length) { 74 71 Type_Img = "pamoorama"; 72 options.valide = true; 73 75 74 } else if (jQuery("#map").length) { 76 75 Type_Img = "map"; … … 276 275 infos_theMainImage = jQuery("#pamoorama").infos(true); 277 276 theMainImage_id = "#pamoorama"; 277 options.valide = true; 278 278 279 279 } else { … … 311 311 312 312 jQuery("#loading").show(0); 313 zheight = infos_window.height - (infos_theImage.top); 313 if (infos_theImage.top > infos_window.height) { 314 zheight = infos_window.height - infos_content.top; 315 } else { 316 zheight = infos_window.height - (infos_theImage.top); 317 } 314 318 h01 = 0; 315 319 h02 = 0; … … 332 336 333 337 } else { 334 options.marge_basse += Math.max(h01, h02); 338 if (test_theme("stripped")) { 339 340 } else 341 options.marge_basse += Math.max(h01, h02); 342 335 343 if (test_theme("blanc , pure, hr_ ")) { 336 344 options.marge_gauche += 10; … … 363 371 jQuery(theImage_id).width(Zone_image.container.width); 364 372 jQuery(theImage_id).height(Zone_image.container.height); 373 365 374 } 366 375 … … 369 378 ***********************************************************/ 370 379 jQuery(window).resize(function (event, ui) { 380 if (!options.valide) { 381 jQuery("#loading").hide(fade_in); 382 return true; 383 } 384 371 385 infos_window = jQuery(window).infos(); 372 386 infos_imageInfos = jQuery("#imageInfos").infos(true); 373 387 old_w = infos_theImage.width; 374 388 infos_theImage = jQuery(theImage_id).infos(true); 375 if (options.set_sw) {376 if (Type_Img == "pamoorama") {377 if (options.set_sw == "menuSwitcher") {378 379 } else {380 p_width = jQuery(theImage_id).width();381 }382 if (infos_imageInfos.visible)383 p_width = infos_window.width - infos_theImage.left - infos_imageInfos.width - 20;384 else385 p_width = infos_window.width - infos_theImage.left - 20;386 jQuery(theImage_id).width(p_width);387 infos_theImage = jQuery(theImage_id).infos(true);388 389 390 }391 }392 393 389 if (test_theme("simple")) { 394 390 jQuery(theMainImage_id).css({ maxWidth: "none" }); … … 421 417 422 418 jQuery(theImage_id).height(Zone_image.container.height + 2); 423 424 425 426 427 if (DEBUG_autosize == "no") return; 428 429 Autosize_resize(true, options); 419 if (options.valide && DEBUG_autosize != "no") { 420 421 Autosize_resize(true, options); 422 } 430 423 jQuery("#loading").hide(fade_in); 431 424 }); … … 443 436 marges_llgbo = 0; 444 437 //========================================================================================== 445 446 init_gen(); 447 jQuery(window).resize(); 448 jQuery(window).resize(); 449 438 if (options.valide) { 439 440 init_gen(); 441 jQuery(window).resize(); 442 jQuery(window).resize(); 443 444 } 445 jQuery("#loading").hide(fade_in); 450 446 }); 451 447 //__________________window.onload_________________ … … 509 505 } 510 506 511 jQuery("#form_autosize_picture").addClass("Autosize _margin");507 jQuery("#form_autosize_picture").addClass("Autosize"); 512 508 //===== marges suplémentaires en fonction theme === 513 options.valide = jQuery(".Autosize_margin").css("display"); 514 options.marge_haute = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("top")); 515 options.marge_basse = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("bottom")); 516 options.marge_gauche = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("left")); 517 options.marge_droite = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("right")); 509 options.valide = jQuery(".Autosize").css("display") != "none"; 510 511 options.marge_haute = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("top")); 512 options.marge_basse = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("bottom")); 513 options.marge_gauche = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("left")); 514 options.marge_droite = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("right")); 518 515 fade_in = options.fade_in || 0; 519 516 imageComment_id = ".imageComment"; … … 558 555 pictureDeriv_maxi = pictureDeriv; 559 556 } 560 557 if (!options.valide) { 558 559 pictureDeriv = "medium"; 560 pictureDeriv_maxi = pictureDeriv; 561 cookies.pictureDeriv = pictureDeriv; 562 jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden'); 563 jQuery('#derivativeChecked' + options.pictureDeriv).css('visibility', 'visible'); 564 jQuery('#derivativeCheckedSelMaxi').hide(); 565 jQuery('#derivativeCheckedSelMaxi').next().hide(); 566 jQuery('#derivativeCheckedSelMaxi').next().next().hide(); 567 jQuery('#derivativeCheckedAutosize').hide(); 568 jQuery('#derivativeCheckedAutosize').next().hide(); 569 jQuery('#derivativeCheckedAutosize').next().next().hide(); 570 } 561 571 562 572 if (DEBUG_autosize == "no") return; … … 882 892 ***************************/ 883 893 Autosize_resize = function (force, parametres) { 894 sav_container = Zone_image.container; 884 895 if (Get_dimensions(force, parametres)) { 885 896 jQuery(theImageAndInfos_id).css({ height: "auto" }); 897 jQuery(theMainImage_id).removeAttr("width"); 898 jQuery(theMainImage_id).removeAttr("height"); 899 886 900 if (Type_Img == "pamoorama") { 887 Set_Pamoorama({ width: Zone_image.container.width, height: Zone_image. image.height });901 Set_Pamoorama({ width: Zone_image.container.width, height: Zone_image.container.height }); 888 902 if (nopano) 889 903 if (window.myPamoorama.options.autoscrollOnLoad) { 890 904 window.myPamoorama.startAnimRight(); 891 905 } 892 } else {893 894 jQuery(theMainImage_id).height(Zone_image.image.height);906 } else { 907 908 if (!options.slideshow) { jQuery(theMainImage_id).height(Zone_image.image.height); }; 895 909 jQuery(theMainImage_id).width(Zone_image.image.width); 896 897 if (test_theme("xxxxxxx")) { 898 jQuery(theImage_id).css({ height: "auto" }); 899 jQuery(theImage_id).height(Zone_image.image.height + Zone_image.marges.height); 900 jQuery(theImage_id).width(Zone_image.image.width + Zone_image.marges.width); 901 902 } 910 911 903 912 } 904 913 … … 906 915 set_cl(true); 907 916 } else { 908 // jQuery(theImage_id).height(Zone_image.image.height + Zone_image.marges.height); 917 909 918 Set_Pamoorama({ width: Zone_image.container.width, height: Zone_image.image.height }); 910 919 set_cl(false); … … 1356 1365 1357 1366 if (options.select_type != "SelMaxi" && options.select_type != "Autosize") { 1358 1359 1367 1368 IMg = Get_Maxi(Zone_image.image_init); 1360 1369 } else { 1361 1370 IMg = Get_Maxi(Zone_image.image); … … 1481 1490 1482 1491 //---------- test largeur image 1483 new_width = Format.width ;1492 new_width = Format.width - (options.marge_right + options.marge_left); 1484 1493 1485 1494 if (new_width > new_image.width) { … … 1715 1724 1716 1725 if (options.imageAutosize) { 1717 return ; //stripped1726 return true; //stripped 1718 1727 } 1719 1728 … … 1992 2001 //_______________________ init_gen _______________________ 1993 2002 1994 }); // ready2003 }); // ready 1995 2004 1996 2005
Note: See TracChangeset
for help on using the changeset viewer.