{combine_script id='jquery.ajaxmanager' load='footer' path='themes/default/js/plugins/jquery.ajaxmanager.js'} {footer_script}{literal} var queuedManager = $.manageAjax.create('queued', { queue: true, cacheResponse: false, maxRequests: 3 }); function processThumbs(width,height,gd_version) { var square=$('input[name="square"]').attr('checked'); var done=0; $('tr.nothumb').each(function() { var file=$(this).find('td.filepath').text(); $(this).find('td.thumbpic').html(''); var td=this; queuedManager.add({ type: 'GET', url: 'ws.php', data: {method: 'pwg.images.createThumbnail',picture:file,format:'json',width: width,height: height, gd_version: gd_version, square: square}, dataType: 'json', success: (function(row) { return function(data) { if (data.stat =='ok') { $(row).find('td.thumbpic').html(''); $(row).find('td.thumbdim').html(""+data.result.tn_width+"X"+data.result.tn_height); $(row).find('td.thumbgentime').html(""+data.result.tn_time); $(row).find('td.thumbsize').html(""+data.result.tn_size); $(row).removeClass("nothumb"); } else { $(row).find('td.thumbpic').html('#ERR#'+data.err+"# : "+data.message); $(row).removeClass("nothumb"); $(row).addClass("error"); } if (done++ == 20) { $('tr.item:not(.nothumb)').remove(); done = 0; } };})(td) }); }); } $(document).ready(function(){ $('input#proceed').click (function () { var width = $('#width')[0].value; var height = $('#height')[0].value; var gd_version=$("input[@name='gd']:checked").val(); $("input:not(.nodisable)").attr("disabled",true); processThumbs(width,height,gd_version); }); $('input#cancel').click (function () { queuedManager.clear(); queuedManager.abort(); $("input:not(.nodisable)").attr("disabled",false); $('tr.nothumb td.thumbpic').html(" "); }); $('input#clear').click (function () { $('tr.item:not(.nothumb)').remove(); }); }); {/literal}{/footer_script}

{'Thumbnail creation'|@translate}

{if isset($params) }
{'Thumbnail creation'|@translate}

{/if} {*isset params*} {if !empty($remainings) }
{$TOTAL_NB_REMAINING} {'Number of thumbnails to create'|@translate}
{foreach from=$remainings item=elt name=remain_loop} {/foreach}
  {'Path'|@translate} {'Filesize'|@translate} {'Dimensions'|@translate} {'Thumbnail'|@translate} {'generated in'|@translate} {'Filesize'|@translate} {'Dimensions'|@translate}
{$smarty.foreach.remain_loop.iteration} {$elt.PATH} {$elt.FILESIZE_IMG} {$elt.WIDTH_IMG} x {$elt.HEIGHT_IMG}        
{else}
[ {'No missing thumbnail'|@translate} ]
{/if}