Ignore:
Timestamp:
Mar 29, 2011, 11:35:00 PM (13 years ago)
Author:
patdenice
Message:

Update configuration after regeneration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/regenerateThumbnails/element_set_global_action.tpl

    r9922 r9931  
    33
    44{footer_script require='jquery.progressBar,jquery.ajaxmanager'}
     5var elements = new Array();
    56var all_elements = [{','|@implode:$all_elements}];
    67var redirect = '{$redirect_url}';
     
    1314});
    1415
     16function progress(val, max, success) {
     17  jQuery('#progressBar').progressBar(val, {
     18    max: max,
     19    textFormat: 'fraction',
     20    boxImage: 'plugins/regenerateThumbnails/images/progressbar.gif',
     21    barImage: 'plugins/regenerateThumbnails/images/progressbg_orange.gif'
     22  });
     23  type = success ? 'regenerateThumbnailsSuccess': 'regenerateThumbnailsError'
     24  s = jQuery('[name="'+type+'"]').val();
     25  jQuery('[name="'+type+'"]').val(++s);
     26
     27  if (val == max)
     28    jQuery('#applyAction').click();
     29}
     30
    1531jQuery(document).ready(function() {
    1632  jQuery('#applyAction').click(function() {
    1733    if (jQuery('[name="selectAction"]').val() == 'regenerateThumbnails') {
    18       elements = new Array();
     34      if (elements.length != 0)
     35        return true;
     36
    1937      if (jQuery('input[name="setSelected"]').attr('checked'))
    2038        elements = all_elements;
     
    5068          },
    5169          dataType: 'json',
    52           success: ( function(data) {
    53             if (data.stat =='ok')
    54               jQuery('#progressBar').progressBar(++todo, {
    55                 max: progressBar_max,
    56                 textFormat: 'fraction',
    57                 boxImage: 'plugins/regenerateThumbnails/images/progressbar.gif',
    58                 barImage: 'plugins/regenerateThumbnails/images/progressbg_orange.gif'
    59               });
    60             if (todo == progressBar_max)
    61               window.location = redirect;
    62           })
     70          success: ( function(data) { progress(++todo, progressBar_max, true) }),
     71          error: ( function(data) { progress(++todo, progressBar_max, false) })
    6372        });
    6473      }
     
    112121<span class="progressBar" id="progressBar"></span>
    113122</div>
     123
     124<input type="hidden" name="regenerateThumbnailsSuccess" value="0">
     125<input type="hidden" name="regenerateThumbnailsError" value="0">
Note: See TracChangeset for help on using the changeset viewer.