From ef00110fe75a3036908602d3f4c8e54df43dd72d Mon Sep 17 00:00:00 2001 From: patdenice Date: Fri, 22 Apr 2011 14:22:50 +0000 Subject: feature:2274 Bug corrected with crop option. Clean code. Add sentence in thumbnails page for regeneration. git-svn-id: http://piwigo.org/svn/trunk@10571 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/themes/default/template/thumbnail.tpl | 65 +++++++++++++++-------------- 1 file changed, 34 insertions(+), 31 deletions(-) (limited to 'admin/themes') diff --git a/admin/themes/default/template/thumbnail.tpl b/admin/themes/default/template/thumbnail.tpl index 3c46b2c2e..5e981c3ef 100644 --- a/admin/themes/default/template/thumbnail.tpl +++ b/admin/themes/default/template/thumbnail.tpl @@ -11,9 +11,9 @@ var done = 0; {literal} var queuedManager = $.manageAjax.create('queued', { - queue: true, - cacheResponse: false, - maxRequests: 3, + queue: true, + cacheResponse: false, + maxRequests: 3, complete: function() { jQuery("#thumb_remaining").text(todo-(++done) + ' ' + remaining); if (todo == done) { @@ -23,13 +23,13 @@ var queuedManager = $.manageAjax.create('queued', { }); function processThumbs(width,height,crop,follow_orientation) { - jQuery('tr.nothumb').each(function() { - var image_path = jQuery(this).find('td.filepath').text(); - var td=this; - queuedManager.add({ - type: 'GET', - url: 'ws.php', - data: { + jQuery('tr.nothumb').each(function() { + var image_path = jQuery(this).find('td.filepath').text(); + var td=this; + queuedManager.add({ + type: 'GET', + url: 'ws.php', + data: { method: 'pwg.images.resize', image_path: image_path, type: 'thumbnail', @@ -39,24 +39,24 @@ function processThumbs(width,height,crop,follow_orientation) { follow_orientation: follow_orientation, format:'json' }, - dataType: 'json', - success: (function(row) { return function(data) { - if (data.stat =='ok') { + dataType: 'json', + success: (function(row) { return function(data) { + if (data.stat =='ok') { if (todo < 200) jQuery(row).find('td.thumbpic').html(''); jQuery(row).find('td.thumbdim').html(""+data.result.width+" x "+data.result.height); jQuery(row).find('td.thumbgentime').html(""+data.result.time); jQuery(row).find('td.thumbsize').html(""+data.result.size); jQuery(row).removeClass("nothumb"); - } else { - jQuery(row).find('td.thumbpic').html('#ERR#'+data.err+"# : "+data.message); + } else { + jQuery(row).find('td.thumbdim').html('#ERR#'+data.err+"# : "+data.message); jQuery(row).removeClass("nothumb"); jQuery(row).addClass("error"); - } - } + } + } })(td) - }); - }); + }); + }); } function toggleCropFields() { @@ -76,8 +76,8 @@ jQuery(document).ready(function(){ jQuery('input#proceed').click (function () { var width = jQuery('input[name="thumb_maxwidth"]').val(); var height = jQuery('input[name="thumb_maxheight"]').val(); - var crop = jQuery('#crop').is(':checked'); - var follow_orientation = jQuery('#follow_orientation').is(':checked'); + var crop = jQuery('#thumb_crop').is(':checked'); + var follow_orientation = jQuery('#thumb_follow_orientation').is(':checked'); jQuery(".waiting_bar").toggle(); if (todo < 200) jQuery('.thumbpic').show(); @@ -113,23 +113,23 @@ jQuery(document).ready(function(){ @@ -156,13 +156,16 @@ jQuery(document).ready(function(){ {$elt.PATH} {$elt.FILESIZE_IMG} {$elt.WIDTH_IMG} x {$elt.HEIGHT_IMG} - -   -   -   + +   +   +   {/foreach} {else} -
[ {'No missing thumbnail'|@translate} ]
+

+{'No missing thumbnail'|@translate}

+{'If you want to regenerate thumbnails, please go to the Batch Manager.'|@translate|@sprintf:"admin.php?page=batch_manager"} +

{/if} \ No newline at end of file -- cgit v1.2.3