From a07a6c2bb4d6552c498dee3e6b1876a9d5d30bc6 Mon Sep 17 00:00:00 2001 From: Ivan Tyagov <ivan@nexedi.com> Date: Tue, 17 Apr 2012 11:36:49 +0300 Subject: [PATCH] We should have a way to 'purge' localStorage by setting a ROOT_CACHE_ID (which can be changed server side) --- .../jquery/plugin/renderjs/renderjs.js.xml | 16 ++++++++++++++-- bt5/erp5_jquery_plugin_renderjs/bt/revision | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bt5/erp5_jquery_plugin_renderjs/PathTemplateItem/portal_skins/erp5_jquery/jquery/plugin/renderjs/renderjs.js.xml b/bt5/erp5_jquery_plugin_renderjs/PathTemplateItem/portal_skins/erp5_jquery/jquery/plugin/renderjs/renderjs.js.xml index 4b99531182..f3cbd2b395 100644 --- a/bt5/erp5_jquery_plugin_renderjs/PathTemplateItem/portal_skins/erp5_jquery/jquery/plugin/renderjs/renderjs.js.xml +++ b/bt5/erp5_jquery_plugin_renderjs/PathTemplateItem/portal_skins/erp5_jquery/jquery/plugin/renderjs/renderjs.js.xml @@ -12,7 +12,7 @@ </item> <item> <key> <string>_EtagSupport__etag</string> </key> - <value> <string>ts34237877.11</string> </value> + <value> <string>ts34651695.58</string> </value> </item> <item> <key> <string>__name__</string> </key> @@ -75,6 +75,16 @@ var LocalStorageCachePlugin = {\n }\n \n var Cache = {\n + \n + ROOT_CACHE_ID: \'APP_CACHE\',\n +\n + getCacheId: function(cache_id) {\n + /* We should have a way to \'purge\' localStorage by setting a ROOT_CACHE_ID in all browser\n + * instances\n + */\n + return Cache.ROOT_CACHE_ID + cache_id; \n + \n + },\n \n hasLocalStorage: function() {\n /*\n @@ -91,6 +101,7 @@ var Cache = {\n \n get: function(cache_id, default_value){\n /* Get cache key value */\n + cache_id = Cache.getCacheId(cache_id);\n if (Cache.hasLocalStorage()){\n return LocalStorageCachePlugin.get(cache_id, default_value);}\n else{\n @@ -99,6 +110,7 @@ var Cache = {\n \n set: function(cache_id, data){\n /* Set cache key value */\n + cache_id = Cache.getCacheId(cache_id);\n if (Cache.hasLocalStorage()){\n LocalStorageCachePlugin.set(cache_id, data);}\n else{\n @@ -541,7 +553,7 @@ var RenderJs = {\n </item> <item> <key> <string>size</string> </key> - <value> <int>18986</int> </value> + <value> <int>19314</int> </value> </item> <item> <key> <string>title</string> </key> diff --git a/bt5/erp5_jquery_plugin_renderjs/bt/revision b/bt5/erp5_jquery_plugin_renderjs/bt/revision index bf0d87ab1b..7813681f5b 100644 --- a/bt5/erp5_jquery_plugin_renderjs/bt/revision +++ b/bt5/erp5_jquery_plugin_renderjs/bt/revision @@ -1 +1 @@ -4 \ No newline at end of file +5 \ No newline at end of file -- 2.30.9