Changeset 10571


Ignore:
Timestamp:
Apr 22, 2011, 4:22:50 PM (13 years ago)
Author:
patdenice
Message:

feature:2274
Bug corrected with crop option.
Clean code.
Add sentence in thumbnails page for regeneration.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/thumbnail.tpl

    r10570 r10571  
    1212{literal}
    1313var queuedManager = $.manageAjax.create('queued', {
    14         queue: true, 
    15         cacheResponse: false,
    16         maxRequests: 3,
     14  queue: true, 
     15  cacheResponse: false,
     16  maxRequests: 3,
    1717  complete: function() {
    1818    jQuery("#thumb_remaining").text(todo-(++done) + ' ' + remaining);
     
    2424
    2525function processThumbs(width,height,crop,follow_orientation) {
    26         jQuery('tr.nothumb').each(function() {
    27                 var image_path = jQuery(this).find('td.filepath').text();
    28                 var td=this;
    29                 queuedManager.add({
    30                         type: 'GET',
    31                         url: 'ws.php',
    32                         data: {
     26  jQuery('tr.nothumb').each(function() {
     27    var image_path = jQuery(this).find('td.filepath').text();
     28    var td=this;
     29    queuedManager.add({
     30      type: 'GET',
     31      url: 'ws.php',
     32      data: {
    3333        method: 'pwg.images.resize',
    3434        image_path: image_path,
     
    4040        format:'json'
    4141      },
    42                         dataType: 'json',
    43                         success: (function(row) { return function(data) {
    44                                         if (data.stat =='ok') {
     42      dataType: 'json',
     43      success: (function(row) { return function(data) {
     44          if (data.stat =='ok') {
    4545            if (todo < 200)
    4646              jQuery(row).find('td.thumbpic').html('<img src="'+data.result.destination+'"/>');
     
    4949            jQuery(row).find('td.thumbsize').html(""+data.result.size);
    5050            jQuery(row).removeClass("nothumb");
    51                                         } else {
    52             jQuery(row).find('td.thumbpic').html('#ERR#'+data.err+"# : "+data.message);
     51          } else {
     52            jQuery(row).find('td.thumbdim').html('#ERR#'+data.err+"# : "+data.message);
    5353            jQuery(row).removeClass("nothumb");
    5454            jQuery(row).addClass("error");
    55                                         }
    56                                 }
     55          }
     56        }
    5757      })(td)
    58                 });
    59         });
     58    });
     59  });
    6060}
    6161
     
    7777    var width = jQuery('input[name="thumb_maxwidth"]').val();
    7878    var height = jQuery('input[name="thumb_maxheight"]').val();
    79     var crop = jQuery('#crop').is(':checked');
    80     var follow_orientation = jQuery('#follow_orientation').is(':checked');
     79    var crop = jQuery('#thumb_crop').is(':checked');
     80    var follow_orientation = jQuery('#thumb_follow_orientation').is(':checked');
    8181    jQuery(".waiting_bar").toggle();
    8282    if (todo < 200)
     
    114114      <li>
    115115        <span class="property"><label for="thumb_crop">{'Crop'|@translate}</label></span>
    116               <input type="checkbox" name="thumb_crop" id="thumb_crop" {$values.thumb_crop}>
     116        <input type="checkbox" name="thumb_crop" id="thumb_crop" {$values.thumb_crop}>
    117117      </li>
    118118      <li id="thumb_follow_orientation_li">
    119119        <span class="property"><label for="thumb_follow_orientation">{'Follow Orientation'|@translate}</label></span>
    120               <input type="checkbox" name="thumb_follow_orientation" id="thumb_follow_orientation" {$values.thumb_follow_orientation}>
     120        <input type="checkbox" name="thumb_follow_orientation" id="thumb_follow_orientation" {$values.thumb_follow_orientation}>
    121121      </li>
    122122      <li>
    123123        <span class="property"><label for="thumb_maxwidth">{'Maximum Width'|@translate}</label></span>
    124               <input type="text" name="thumb_maxwidth" id="thumb_maxwidth" value="{$values.thumb_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}
     124        <input type="text" name="thumb_maxwidth" id="thumb_maxwidth" value="{$values.thumb_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}
    125125      </li>
    126126      <li>
    127127        <span class="property"><label for="thumb_maxheight">{'Maximum Height'|@translate}</label></span>
    128               <input type="text" name="thumb_maxheight" id="thumb_maxheight" value="{$values.thumb_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}
     128        <input type="text" name="thumb_maxheight" id="thumb_maxheight" value="{$values.thumb_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}
    129129      </li>
    130130      <li>
    131131        <span class="property"><label for="thumb_quality">{'Image Quality'|@translate}</label></span>
    132               <input type="text" name="thumb_quality" id="thumb_quality" value="{$values.thumb_quality}" size="3" maxlength="3"> %
     132        <input type="text" name="thumb_quality" id="thumb_quality" value="{$values.thumb_quality}" size="3" maxlength="3"> %
    133133      </li>
    134134    </ul>
     
    157157    <td>{$elt.FILESIZE_IMG}</td>
    158158    <td>{$elt.WIDTH_IMG} x {$elt.HEIGHT_IMG}</td>
    159         <td class="thumbpic"><img src="admin/themes/default/images/ajax-loader.gif"></td>
    160         <td class="thumbgentime">&nbsp;</td>
    161         <td class="thumbsize">&nbsp;</td>
    162         <td class="thumbdim">&nbsp;</td>
     159  <td class="thumbpic"><img src="admin/themes/default/images/ajax-loader.gif"></td>
     160  <td class="thumbgentime">&nbsp;</td>
     161  <td class="thumbsize">&nbsp;</td>
     162  <td class="thumbdim">&nbsp;</td>
    163163  </tr>
    164164  {/foreach}
    165165</table>
    166166{else}
    167 <div style="text-align:center;font-weight:bold;margin:10px;"> [ {'No missing thumbnail'|@translate} ]</div>
     167<p style="text-align:left;margin:20px;">
     168<b>{'No missing thumbnail'|@translate}</b><br><br>
     169{'If you want to regenerate thumbnails, please go to the <a href="%s">Batch Manager</a>.'|@translate|@sprintf:"admin.php?page=batch_manager"}
     170</p>
    168171{/if}
  • trunk/admin/thumbnail.php

    r10570 r10571  
    101101// |             form & pictures without thumbnails display                |
    102102// +-----------------------------------------------------------------------+
     103$template->set_filenames( array('thumbnail'=>'thumbnail.tpl') );
     104
    103105if (count($wo_thumbnails) > 0)
    104106{
     
    115117        'WIDTH_IMG'=>$width,
    116118        'HEIGHT_IMG'=>$height,
    117         ));
     119      )
     120    );
    118121  }
    119122}
     
    132135    'values' => $form_values,
    133136    'TOTAL_NB_REMAINING' => count($wo_thumbnails),
     137    'U_HELP' => get_root_url().'admin/popuphelp.php?page=thumbnail',
    134138  )
    135139);
    136140
    137 // +-----------------------------------------------------------------------+
    138 // |                           return to admin                             |
    139 // +-----------------------------------------------------------------------+
    140 $template->set_filenames( array('thumbnail'=>'thumbnail.tpl') );
    141 
    142 $template->assign('U_HELP', get_root_url().'admin/popuphelp.php?page=thumbnail');
    143 
    144141$template->assign_var_from_handle('ADMIN_CONTENT', 'thumbnail');
    145142?>
  • trunk/language/en_UK/admin.lang.php

    r10552 r10571  
    830830$lang['Height'] = 'Height';
    831831$lang['Follow Orientation'] = 'Follow Orientation';
     832$lang['If you want to regenerate thumbnails, please go to the <a href="%s">Batch Manager</a>.'] = 'If you want to regenerate thumbnails, please go to the <a href="%s">Batch Manager</a>.';
    832833?>
  • trunk/language/fr_FR/admin.lang.php

    r10552 r10571  
    841841$lang['Height'] = 'Hauteur';
    842842$lang['Follow Orientation'] = "Respecter l'orientation";
     843$lang['If you want to regenerate thumbnails, please go to the <a href="%s">Batch Manager</a>.'] = 'Si vous voulez régénérer des miniatures, merci de vous rendre dans la <a href="%s">Gestion par lot</a>.';
    843844?>
Note: See TracChangeset for help on using the changeset viewer.