aboutsummaryrefslogtreecommitdiffstats
path: root/admin/themes/default/template/batch_manager_global.tpl
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2014-05-24 14:18:04 +0000
committermistic100 <mistic@piwigo.org>2014-05-24 14:18:04 +0000
commitfea2a4efd1ad085def7cf84cc444325d0815b62e (patch)
tree892dcb971d34efd7cbff6c31375448a09dfbe73b /admin/themes/default/template/batch_manager_global.tpl
parent59f418f7986594895a2352e8895250069cff336a (diff)
feature 3077 : improve cache invalidation
- add "lastmodified" automatic field for categories, groups, users, tags and images tables - provide a "server key" to the client cache manager git-svn-id: http://piwigo.org/svn/trunk@28532 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/themes/default/template/batch_manager_global.tpl')
-rw-r--r--admin/themes/default/template/batch_manager_global.tpl35
1 files changed, 17 insertions, 18 deletions
diff --git a/admin/themes/default/template/batch_manager_global.tpl b/admin/themes/default/template/batch_manager_global.tpl
index 3e22edb02..087f9916a 100644
--- a/admin/themes/default/template/batch_manager_global.tpl
+++ b/admin/themes/default/template/batch_manager_global.tpl
@@ -68,16 +68,22 @@ jQuery(document).ready(function() {ldelim}
jQuery("a.preview-box").colorbox();
{* <!-- TAGS --> *}
- var tagsCache = new LocalStorageCache('tagsAdminList', 5*60, function(callback) {
- jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.tags.getAdminList', function(data) {
- var tags = data.result.tags;
-
- for (var i=0, l=tags.length; i<l; i++) {
- tags[i].id = '~~' + tags[i].id + '~~';
- }
-
- callback(tags);
- });
+ var tagsCache = new LocalStorageCache({
+ key: 'tagsAdminList',
+ serverKey: '{$CACHE_KEYS.tags}',
+ serverId: '{$CACHE_KEYS._hash}',
+
+ loader: function(callback) {
+ jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.tags.getAdminList', function(data) {
+ var tags = data.result.tags;
+
+ for (var i=0, l=tags.length; i<l; i++) {
+ tags[i].id = '~~' + tags[i].id + '~~';
+ }
+
+ callback(tags);
+ });
+ }
});
jQuery('[data-selectize=tags]').selectize({
@@ -92,14 +98,7 @@ jQuery(document).ready(function() {ldelim}
labelField: 'name',
searchField: ['name'],
plugins: ['remove_button'],
- create: function(input, callback) {
- tagsCache.clear();
-
- callback({
- id: input,
- name: input
- });
- }
+ create: true
});
tagsCache.get(function(tags) {