Changeset 12759 for extensions/GThumb


Ignore:
Timestamp:
Dec 17, 2011, 7:42:14 PM (13 years ago)
Author:
patdenice
Message:

Add a cancel button

Location:
extensions/GThumb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/GThumb/language/en_UK/plugin.lang.php

    r12733 r12759  
    1212$lang['Cache have been generated'] = 'Cache have been generated';
    1313$lang['Pre-cache thumbnails'] = 'Pre-cache thumbnails';
     14$lang['Delete images in GThumb+ cache.'] = 'Delete images in GThumb+ cache.';
     15$lang['Finds images that have not been cached and creates the cached version.'] = 'Finds images that have not been cached and creates the cached version.';
    1416
    1517?>
  • extensions/GThumb/language/fr_FR/plugin.lang.php

    r12733 r12759  
    1212$lang['Cache have been generated'] = 'Le cache a été généré';
    1313$lang['Pre-cache thumbnails'] = 'Mettre en cache les miniatures';
     14$lang['Delete images in GThumb+ cache.'] = 'Efface les images du cache de GThumb+.';
     15$lang['Finds images that have not been cached and creates the cached version.'] = "Met en cache les images qui n'ont pas encore été crées.";
    1416
    1517?>
  • extensions/GThumb/template/admin.tpl

    r12733 r12759  
    5454<p id="cache_data">&nbsp;</p>
    5555<p id="GThumbAction">
    56   <button onclick="GThumb.deletecache();">{'Purge thumbnails cache'|@translate}</button>
    57   <button onclick="GThumb.generatecache();">{'Pre-cache thumbnails'|@translate}</button>
     56  <button onclick="GThumb.deletecache();" title="{'Delete images in GThumb+ cache.'|@translate}">{'Purge thumbnails cache'|@translate}</button>
     57  <button onclick="GThumb.generatecache();" title="{'Finds images that have not been cached and creates the cached version.'|@translate}">{'Pre-cache thumbnails'|@translate}</button>
    5858</p>
    5959<div id="GThumbProgressbar" style="display:none;">
    6060  {'Generating cache, please wait...'|@translate}<br>
    6161  <div id="progressbar"></div>
     62  <p><button onclick="GThumb.abort();">{'Cacncel'|@translate}</button></p>
    6263</div>
    6364</fieldset>
     
    102103
    103104  generatecache: function() {
    104     jQuery("#progressbar").progressbar({value: 0});
     105    GThumb.total = nb_files;
     106    GThumb.done = nb_files;
     107    jQuery("#progressbar").progressbar({value: 1});
    105108    jQuery.ajax({
    106109      url: 'admin.php?page=plugin-GThumb&generatecache=request',
     
    109112        if (data.length > 0) {
    110113          jQuery("#GThumbProgressbar, #GThumbAction").toggle();
    111           GThumb.total = data.length;
     114          GThumb.total = data.length + GThumb.done;
     115          jQuery("#progressbar").progressbar({value: Math.ceil(GThumb.done * 100 / GThumb.total)});
    112116          for (i=0;i<data.length;i++) {
    113117            GThumb.queue.add({
     
    142146  progressbar: function() {
    143147    jQuery( "#progressbar" ).progressbar({
    144       value: Math.round(++GThumb.done * 100 / GThumb.total)
     148      value: Math.ceil(++GThumb.done * 100 / GThumb.total)
    145149    });
    146150    if (GThumb.done == GThumb.total) {
    147151      window.location = 'admin.php?page=plugin-GThumb&generatecache=complete';
    148152    }
     153  },
     154
     155  abort: function() {
     156    GThumb.queue.clear();
     157    GThumb.queue.abort();
     158    jQuery("#GThumbProgressbar, #GThumbAction").toggle();
    149159  }
    150160};
     
    169179
    170180updateCacheSizeAndFiles();
     181
     182jQuery('#GThumbAction button').tipTip({'delay' : 0, 'fadeIn' : 200, 'fadeOut' : 200});
    171183{/literal}{/footer_script}
Note: See TracChangeset for help on using the changeset viewer.