Changeset 22292 for extensions/Autosize
- Timestamp:
- Apr 18, 2013, 5:16:42 PM (12 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/js/Affiche_script.js
r22248 r22292 86 86 **************************************************************************/ 87 87 Get_type_img = function (e) { 88 // ====== détection du type d'images ====== 88 // ====== détection du type d'images ====== 89 89 if (jQuery("#charlie").length > 0) { 90 90 Type_Img = "charlie"; … … 104 104 105 105 if (jQuery("#theImage" + " object").length > 0) { 106 107 106 type_src = "object"; 108 109 107 } else if (jQuery("#theImage" + " embed").length > 0) { 110 111 108 type_src = "embed"; 112 113 109 } else { 114 115 110 type_src = "iframe"; 116 111 } 117 nbf = jQuery("#theImage" + " " + type_src).length; 118 frm1 = jQuery("#theImage" + " " + type_src).get(0); 119 Type_Img = "iframe"; 112 iframes = jQuery("#theImage" + " " + type_src); 113 var st_frame = true; 114 nbf = iframes.length; 115 jQuery("#theImage" + " " + type_src).each(function (i) { 116 if (this.src.match(RegExp("http", "gi")) || this.src.match(RegExp("javascript", "gi"))) { 117 118 } else { 119 st_frame = false; 120 frm1 = this; 121 } 122 }); 123 if (!st_frame) { 124 Type_Img = type_src; 125 } else { 126 Type_Img = "img"; 127 type_src = "div"; 128 return; 129 } 120 130 // 'fb - xfbml - like - button 121 131 objs = jQuery("#theImage" + " div").get(0); … … 126 136 } else { 127 137 if (nbf > 1) { 128 jQuery(frm1).attr("id", "charlie");138 frm1.attr("id", "charlie"); 129 139 } else { 130 140 // Type_Img = "img"; … … 332 342 theMainImage_id = "charlie"; 333 343 options.valide = true; 334 335 336 344 } else if (Type_Img == "iframe") { 337 338 345 infos_theMainImage = jQuery("#iframe").infos(true); 339 340 346 options.valide = true; 341 342 347 infos_theMainImage.width = infos_theImage.general.width; 343 348 infos_theMainImage.height = infos_window.height - infos_theImage.top - options.marge_basse; 344 349 jQuery("#iframe").width(infos_theMainImage.width); 345 350 jQuery("#iframe").height(infos_theMainImage.height); 346 347 348 349 351 } else { 350 352 jQuery("img").each(function (i) { … … 465 467 **************************************************************************/ 466 468 jQuery(window).unload(function () { 469 467 470 // return; 468 471 }); … … 509 512 OptionsCookie = jQuery.extend({}, { path: options.COOKIE_PATH, expires: 1 }); 510 513 var cookies = Get_cookies(); 511 512 514 fade_in = options.fade_in || 0; 513 515 imageComment_id = ".imageComment"; … … 518 520 jQuery("#content").css({ marginLeft: 'auto' }); // monblanc 519 521 } 520 Get_type_img(); 522 521 523 var theMainImage_id = "#theMainImage"; 522 524 var theImage_id = "#theImage"; … … 573 575 } 574 576 options.liste_type = new_liste; 575 577 XImg = jQuery(theMainImage_id); 578 if (XImg.length > 0) 579 if (jQuery(theMainImage_id) 580 .html() 581 .match(RegExp("charlie_", "gi")) 582 ) { 583 Xdiv = jQuery(theMainImage_id + " div"); 584 Xid = jQuery(Xdiv).attr("id"); 585 if (typeof Xid == "undefined") { 586 jQuery(Xdiv).attr("id", "charlie"); 587 } 588 } 589 Get_type_img(); 576 590 // auto_details 577 591 // ==== limite affichage selection = select_type ==== … … 864 878 theImg.useMap = useMap; 865 879 } 866 fade_in = parseInt(options.fade_in || 0); 880 867 881 868 882 }; … … 873 887 **************************************************************************/ 874 888 Autosize_resize = function (force, parametres) { 889 875 890 if (!force) { 876 891 cookis = Get_cookies(); … … 933 948 } 934 949 935 // jQuery(theMainImage_id).height(Zone_image.image.height);936 950 } else if (Type_Img == "panorama") { 937 951 // jQuery("#pamoorama").width(img_finale.width); … … 946 960 jQuery(theMainImage_id).height(Zone_image.image.height); 947 961 r1 = infos_theImage.width / infos_theImage.height; 948 // jQuery(theMainImage_id).width(Zone_image.image.width/r1);949 962 jQuery(theMainImage_id).css("margin-top", options.marge_haute); 950 951 952 963 } else { 953 964 jQuery(theMainImage_id).width(Zone_image.image_init.width); 954 965 jQuery(theMainImage_id).height(Zone_image.image_init.height); 955 966 } 956 957 958 967 if (Type_Img == "charlie" || Type_Img == "iframe") { 959 968 init_w1 = Zone_image.image.width; 960 969 init_h1 = Zone_image.image.height; 961 962 970 if (pictureSelType_user != "Autosize" && pictureSelType_user != "SelMaxi") { 963 971 init_w1 = Autosize_options.ideal_size_width; … … 981 989 h01 = Math.ceil(w01 / Zone_image.image.rapport); 982 990 // ==== Zone Affichage ===== 991 if (h01 > png_h) { 992 h01 = png_h; 993 w01 = Math.ceil(h01 * Zone_image.image.rapport); 994 } 983 995 jQuery("#theMainImage").height(png_h); 984 996 jQuery("#theMainImage").width(w01 + wpng); … … 1008 1020 jQuery("#" + Type_Img).attr("height", init_h1 - (infos_theMainImage.borderwidth.top + infos_theMainImage.borderwidth.bottom)); 1009 1021 } 1010 jQuery("#" + Type_Img).show( options.fade_in);1022 jQuery("#" + Type_Img).show(fade_in); 1011 1023 } 1012 1024 … … 1024 1036 * pamoorama 1025 1037 **************************************************************************/ 1026 jQuery("#pamoorama").bind("on", function () { alert($(this).text()); });1027 jQuery("#pamoorama").bind("on", function (e) {1028 myPamoorama = window.myPamoorama;1029 });1030 jQuery("#pamoorama_inner").live("on", function (e) {1031 myPamoorama = window.myPamoorama;1032 });1033 1038 jQuery('#pamoorama').live('ON', function (e) { 1034 1039 jQuery(jQuery('.debug').get(1)).trigger('ON'); 1035 1040 Autosize_resize(true, options); 1041 jQuery("#pamoorama").fadeTo(fade_in + 20, 1); 1036 1042 }); 1037 1043 … … 1072 1078 tempo = 0; 1073 1079 Wait_pamoorama_st = false; 1074 1075 1076 1080 while (Wait_pamoorama_st == false) { 1077 1081 Wait_pamoorama_st = Wait_pamoorama_time(); … … 1084 1088 jQuery.delay(100); 1085 1089 } 1086 1087 1088 1089 } 1090 1090 } 1091 1091 }; 1092 1092 // __________________ Wait_pamoorama ______________________ … … 1101 1101 if (jQuery("#pamoorama").length) { 1102 1102 tempo = tempo + 1; 1103 1104 1103 mypanorama = window.myPamoorama; 1105 1104 if (!mypanorama) { … … 1107 1106 setTimeout("Wait_pamoorama_time()", 500); 1108 1107 return false; 1109 1110 } 1111 1112 if (mypanorama.skipInit == false) { 1108 } 1109 /* if (mypanorama.skipInit == false) { 1113 1110 if (tempo > 500) return true; 1114 setTimeout("Wait_pamoorama_time()", 500); 1111 setTimeout(function () { 1112 Wait_pamoorama_time(); 1113 }, 500); 1115 1114 return false; 1116 } 1115 }*/ 1116 1117 1117 // ============================================================= 1118 if (Math.abs(mypanorama.imageHeight) < 100) { 1119 setTimeout("Wait_pamoorama_time()", 500); 1118 if(typeof mypanorama.imageHeight=="undefined"){ 1119 setTimeout(function () { 1120 Wait_pamoorama_time(); 1121 }, 500); 1120 1122 return false; 1121 1123 } … … 1153 1155 1154 1156 Wait_Affichage_time = function () { 1155 if (typeof fade_in == "undefined") fade_in = 1000;1156 fade_in = parseInt(fade_in);1157 /*1158 * if (!Autosize_resize()) { setTimeout("Wait_Affichage()", 500); return }1159 * nu_img++;1160 */1161 if (typeof fade_in == "undefined") fade_in = 0;1162 1163 1157 // if (nu_img > 1) return; 1164 1158 if (typeof stb != "undefined") … … 1394 1388 return true; 1395 1389 } else { 1396 last_id = IMg.pictureDeriv; 1397 // eval(href_path); 1398 data_src = jQuery(theImg).attr("data-src"); 1399 if (typeof data_src != "undefined") { 1400 changeImgSrc(data_src + "&loadajax=true", 1401 last_id, 1402 IMg.pictureMap, 1403 options.COOKIE_PATH); 1404 } else { 1405 changeImgSrc(imgSrc.replace("./", ""), 1406 last_id, 1407 IMg.pictureMap, 1408 options.COOKIE_PATH); 1409 } 1390 eval(href_path); 1391 1410 1392 } 1411 1393 theImg.useMap = "#map" + IMg.pictureMap; … … 1450 1432 myPamoorama = window.myPamoorama; 1451 1433 if (Type_Img == "pamoorama") { 1452 1453 1434 if (!nopano) { 1454 1435 theMainImage_Id = "#pamoorama"; … … 1456 1437 Wait_pamoorama(); 1457 1438 infos_theMainImage = jQuery(theMainImage_Id).infos(); 1458 // theMainImage_Id = "#pamoorama"; 1459 } 1460 1461 1439 } 1462 1440 if (typeof myPamoorama == "undefined") { 1463 1441 return; … … 1465 1443 // ========================================================= 1466 1444 if (!nopano) { 1467 // theMainImage_Id = "#pamoorama";1468 1445 nopano = false; 1469 1446 Wait_pamoorama(); 1470 1447 infos_theMainImage = jQuery(theMainImage_Id).infos(); 1471 // theMainImage_Id = "#pamoorama";1472 1448 } 1473 1449 … … 1499 1475 }); 1500 1476 // ---------- test largeur image 1501 new_width = Format.width -(options.marge_right + options.marge_left);1477 new_width = Format.width; // -(options.marge_right + options.marge_left); 1502 1478 1503 1479 if (new_width > new_image.width) { … … 1529 1505 window.myPamoorama.imageHeight = new_image.height; 1530 1506 nf = jQuery("#pamoorama_thumb").height(); 1531 jQuery("#pamoorama_thumb img").width( 180);1507 jQuery("#pamoorama_thumb img").width(200); 1532 1508 jQuery("#pamoorama_thumb img").height(nf); 1533 1509 … … 1587 1563 if (Type_Img == "img") { 1588 1564 Zone_image.src = jQuery(theMainImage_id).attr("src"); 1589 if (Zone_image.src.match(RegExp(Zone_image.name, "gi"))) { 1590 Zone_image.path = infos_theMainImage.src; 1591 } else 1592 return "Wait"; 1593 1565 if (typeof Zone_image.src != "undefined") { 1566 if (Zone_image.src.match(RegExp(Zone_image.name, "gi"))) { 1567 Zone_image.path = infos_theMainImage.src; 1568 } else 1569 return "Wait"; 1570 } else { 1571 Zone_image.src = ""; 1572 Zone_image.path = ""; 1573 } 1594 1574 } else { 1595 1575 Zone_image.src = jQuery(theMainImage_id).attr("src"); … … 1677 1657 if (!options.check_desc_v) 1678 1658 options.marge_bottom_2 = 0; 1679 1680 1659 1681 1660 marge_bottom = options.marge_bottom_2 + options.marge_bottom; … … 1757 1736 options.theImageRight = (new_win.width - new_dim.right); 1758 1737 options.marge_bottom_2 = Math.ceil(new_dim.out.bottom - new_img.out.bottom); 1759 1760 if (Type_Img == "iframe") { } 1738 options.marge_top_2 = options.marge_top_2 | 0; 1761 1739 new_dim.out.bottom = new_win.height - options.marge_bottom_2; 1762 1763 1740 options.theImageBottom = new_win.height - new_dim.out.bottom; 1764 1741 if (options.slideshow) { … … 1818 1795 case "charlie": 1819 1796 Zone_image.zoom = 1; 1797 Zone_image.image.width = options.theImageWidth; 1798 Zone_image.image.height = options.theImageHeight; 1820 1799 break; 1821 1800 case "iframe": … … 1900 1879 pos_top = pAll.Top; ; 1901 1880 pos_bottom = pAll.Bottom; ; 1902 1903 1881 if (infos_llgbo.top > 0) { 1904 1882 pos_top = infos_llgbo.top; 1905 1906 1883 options.marge_top = infos_theMainImage.top - infos_theImage.top; 1907 1884 options.marge_bottom = Math.ceil(options.marge_basse + options.marge_top); … … 1913 1890 1914 1891 options.pos_top = pos_top; 1892 new_img = jQuery(theMainImage_id).infos({ absolute: true }); 1893 new_dim = jQuery(theImage_id).infos({ absolute: true }); 1894 options.marge_top += Math.ceil(new_img.top - new_dim.top); 1895 1896 1915 1897 options.marge_left = infos_theImage.general.marges.left + Math.ceil(options.marge_gauche); 1916 1898 options.marge_right = infos_theImage.general.marges.right + Math.ceil(options.marge_droite); … … 1919 1901 Math.ceil(options.marge_haute); 1920 1902 1903 1921 1904 if (options.pictureDeriv == null) 1922 1905 options.first = true; … … 1924 1907 options.first = false; 1925 1908 // =================== Gestion liste photos size 1926 // ============================1927 1909 us = 0; 1928 1910 if (!options.theMainImageWidth) options.theMainImageWidth = options.scaledWidth; … … 1989 1971 Autosize_resize(true, options); 1990 1972 Autosize_resize(true, options); 1991 jQuery("#" + Type_Img).show( options.fade_in);1973 jQuery("#" + Type_Img).show(fade_in); 1992 1974 }; 1993 1975 // _______________________ init_gen _______________________ … … 2183 2165 } // Debug_pos 2184 2166 // ========================================================== 2185 }); // ready2167 }); // ready 2186 2168 jQuery("#derivativeSwitchBox a").click(function (e) { 2187 2169 k1 = 0; -
extensions/Autosize/main.inc.php
r22248 r22292 2 2 /* 3 3 Plugin Name: AutoSize 4 Version: 3.1. 24 Version: 3.1.3 5 5 Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448
Note: See TracChangeset
for help on using the changeset viewer.