Changeset 18723
- Timestamp:
- Oct 23, 2012, 12:08:16 PM (12 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/autosize.inc.php
r18716 r18723 858 858 } // for 859 859 //================================================ 860 860 861 $img_url = $img_select->src_image->get_url(); 862 $imgSizeWH = $img_select->src_image->get_size(); 863 $liste_type["Original"]="Original".",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1] ; 864 861 865 862 866 $retour=(object)'' ; -
extensions/Autosize/js/Affiche_script.js
r18716 r18723 591 591 theMainImage_st = false; 592 592 jQuery("#theMainImage").error(function (e) { 593 jQuery(".infos").show();594 // alert(this.src + ' Image does not exist !!');595 });596 $("#theMainImage").bind('ON', function (event, param1) {597 598 });599 600 jQuery("#theMainImage").live("ON", function (e, data) {601 d = (new Date()).getTime();602 jQuery("#theMainImage").attr("src", this.src + "?" + data.total);603 // jQuery("#infos_succes").text(data.done + " / " + data.total);604 593 jQuery.noop(); 605 if (data.nb == 0) { 606 // jQuery(".infos").empty(); 607 // jQuery(".infos").remove(); 608 if(typeof imageInfos_id == "undefined") return ; 609 610 Autosize_resize(true, options); 611 612 613 } 614 // alert(this.src + ' Image does not exist !!'); 594 }); 595 jQuery("#theMainImage").bind("ON", function (e, data) { 596 if (!data.status != "ok") { 597 return; 598 } 599 600 if (data.done == 1) 601 jQuery("#theMainImage").attr("src", nofile[data.done].file); 602 jQuery.noop(); 603 604 }); 605 jQuery("#theMainImage").bind("Finish", function (e, data) { 606 607 jQuery("#theMainImage").attr("src", nofile[1].file); 608 if (typeof imageInfos_id == "undefined") return; 609 Autosize_resize(true, options); 610 615 611 }); 616 612 … … 909 905 + " IMG: " + img_finale.width 910 906 + " X " + img_finale.height 907 + " mgw : " + Zone_image.marges.width 911 908 , "->") 912 909 }); … … 1063 1060 } 1064 1061 //__________________ Wait_pamoorama ______________________ 1062 jQuery(".pwg-icon-clock-minus, .pwg-icon-clock-plus").click(function (i) { 1063 n = window.myPamoorama; 1064 n = this; 1065 }) 1065 1066 1066 1067 Wait_pamoorama_time = function () { … … 1289 1290 Select_Image = function () { 1290 1291 var pt = options.liste_type; 1292 1293 1291 1294 if (pt.length > 0) { 1292 1295 //===== calcul Image === … … 1295 1298 options.theImageMargeZone = Zone_image.marges; 1296 1299 if (Type_Img != 'charlie') { 1297 if (options.pictureSelType != "SelMaxi" && options.pictureSelType != "Autosize" ) {1300 if (options.pictureSelType != "SelMaxi" && options.pictureSelType != "Autosize" && Type_Img != 'pamoorama') { 1298 1301 IMg = Get_Maxi(Zone_image.image_init); 1299 1302 } else { … … 1485 1488 1486 1489 /****************************************/ 1487 if (typeof imageInfos_id == "undefined") return;1488 infos_imageInfos = jQuery(imageInfos_id).infos( true); // information1489 infos_theMainImage = jQuery(theMainImage_id).infos( true); // Image1490 if (typeof imageInfos_id == "undefined") return; 1491 infos_imageInfos = jQuery(imageInfos_id).infos({ absolute: true }); // information 1492 infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true }); // Image 1490 1493 // commentContent 1491 1494 // copyright 1495 1492 1496 1493 1497 … … 1498 1502 infos_theImage = jQuery(theImage_id).infos(true); // container 1499 1503 infos_window = jQuery(window).infos(true); // window 1504 w = infos_theImage.general.marges.width 1500 1505 1501 1506 container = { … … 1559 1564 //=============================================================== 1560 1565 retrait_img.width = Math.ceil(infos_theMainImage.general.marges.width); // borderwidth+padding 1566 retrait_img.width = Math.ceil(infos_theImage.general.marges.width); // borderwidth+padding 1561 1567 retrait_img.width += Math.ceil(options.marges_llgbo || 0); 1562 1568 retrait_img.width += 2; … … 1588 1594 } else if (Type_Img == "pamoorama") { 1589 1595 if (height_theMainImage > container.height_interne) { 1590 1596 n = options.pictureSelType; 1591 1597 } 1592 1598 } else { … … 2133 2139 2134 2140 2135 }); // ready2141 }); // ready 2136 2142 2137 2143 -
extensions/Autosize/js/autosize_ajax.js
r18716 r18723 1 2 1 jQuery(document).ready( 3 2 function (jQuery) { … … 12 11 total: 0, 13 12 finished: function() { 13 derivatives.elements.splice(0, 1); 14 14 return derivatives.done == derivatives.total && derivatives.elements && derivatives.elements.length==0; 15 15 } 16 16 }; 17 17 18 function progress(success ) {18 function progress(success,data) { 19 19 if (success) { 20 jQuery("#theMainImage").trigger("ON", [{ nb: derivatives.total - derivatives.done, total: derivatives.total, done: derivatives.done,status:"ok" }]);20 jQuery("#theMainImage").trigger("ON", [{ nb: derivatives.total - derivatives.done, total: derivatives.total, done: derivatives.done,status:"ok",src:data.url}]); 21 21 } else { 22 jQuery("#theMainImage").trigger("ON", [{ nb: derivatives.total - derivatives.done, total: derivatives.total, done: derivatives.done, status: "Nok" }]);22 jQuery("#theMainImage").trigger("ON", [{ nb: derivatives.total - derivatives.done, total: derivatives.total, done: derivatives.done, status: "Nok", src: data.url}]); 23 23 } 24 25 if (derivatives.finished()) { 26 jQuery("#theMainImage").trigger("Finish", [derivatives]); 27 } 28 24 29 } 25 30 26 31 derivatives.elements = []; 27 32 var ids = derivatives.elements.splice(0, 500); 28 var params = { max_urls: 10, ids: ids, types: [] };33 var params = { max_urls: 10, ids: ids, types: [], src: [] }; 29 34 30 35 function getDerivativeUrls(nofile) { 31 var ids = derivatives.elements.splice(0, 500); 32 33 34 var params = { max_urls: nofile.length, ids: ids, types: [], src: [] }; 36 params.max_urls = nofile.length; 35 37 popup = jQuery(".infos"); 36 38 if (popup.length == 0) { … … 39 41 40 42 jQuery(nofile).each(function (i, t) { 43 if (typeof t.file != "undefined") { 44 nbsrc = params.src.length; 45 if (nbsrc == 0) { 46 params.ids.push(t.id); 47 params.types.push(t.type); 48 params.src.push(t.file); 49 }else if (~jQuery.inArray( t.file,params.src )) { 50 jQuery.noop(); 51 } else { 52 params.ids.push(t.id); 53 params.types.push(t.type); 54 params.src.push(t.file); 55 56 } 57 } 58 }); 59 if(derivatives.elements.length==0) 60 derivatives.elements = params.ids; 41 61 42 62 43 if (typeof t.file != "undefined") {44 45 params.ids.push(t.id);46 params.types.push(t.type);47 params.src.push(t.file);48 49 }50 51 });52 63 jQuery.ajax({ 53 64 type: "POST", … … 62 73 if (typeof jQuery.manageAjax != "undefined") { 63 74 for (var i = 0; i < data.result.urls.length; i++) { 64 // jQuery(".infos").append("<span>" + data.result.urls[i] + "<br></span>");75 65 76 jQuery.manageAjax.add("queued", { 66 77 type: 'GET', … … 68 79 dataType: 'json', 69 80 success: (function (data) { 70 derivatives.done++; progress(true) 71 }), 72 error: (function (data) { 73 derivatives.done++; progress(false) 74 }) 75 }); 81 derivatives.done++; 82 progress(true, data); 83 }), 84 error: (function (data) { 85 derivatives.done++; 86 progress(false, data); 87 }) 88 }); 76 89 } 77 if (derivatives.elements.length != 0) { 78 progress(false); 79 setTimeout( "getDerivativeUrls(nofile)" , 10 * (derivatives.total - derivatives.done)); 80 } else { 81 progress(true); 90 if (derivatives.elements.length) { 91 if(derivatives.total - derivatives.done > 0 ) 92 setTimeout("getDerivativeUrls(nofile)", 100 * (derivatives.total - derivatives.done)); 82 93 } 83 94 } … … 85 96 error: function (data) { 86 97 progress(false); 87 } 98 } 88 99 }); 89 100 }
Note: See TracChangeset
for help on using the changeset viewer.