diff options
author | drry | 2009-01-04 16:44:41 +0000 |
---|---|---|
committer | drry | 2009-01-04 16:44:41 +0000 |
commit | eedccef4a1da859fb5f6382a4ee34c059a4c42cb (patch) | |
tree | e050c2d5c3e90f626cc0de979f8f73c5cef5eaa1 /_libly.js | |
parent | 274755d24c7024b110ec67d4a86699e16db09ae7 (diff) | |
download | vimperator-plugins-eedccef4a1da859fb5f6382a4ee34c059a4c42cb.tar.bz2 |
* fixed missing `var` statements.
* fixed a regex.
* removed subversion props.
* et cetera.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@27924 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to '_libly.js')
-rw-r--r-- | _libly.js | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -522,8 +522,6 @@ libly.Wedata.prototype = { var STORE_KEY = 'plugins-libly-wedata-' + this.dbname + '-items'; var store = storage.newMap(STORE_KEY, true); - expire = expire || 0; - if (store && store.get('data') && new Date(store.get('expire')) > new Date()) { logger.log('return cache. '); store.get('data').forEach(function(item) { if (typeof itemCallback == 'function') itemCallback(item); }); @@ -532,6 +530,8 @@ libly.Wedata.prototype = { return; } + expire = expire || 0; + function errDispatcher(msg, cache) { if (cache) { logger.log('return cache. -> ' + msg); @@ -550,12 +550,12 @@ libly.Wedata.prototype = { if (!text) { errDispatcher('respons is null.', store.get('data')); return; - }; + } var json = libly.$U.evalJson(text); if (!json) { errDispatcher('uailed eval json.', store.get('data')); return; - }; + } store.set('expire', new Date(new Date().getTime() + expire).toString()); store.set('data', json); store.save(); @@ -564,7 +564,7 @@ libly.Wedata.prototype = { finalCallback(true, json); })); req.addEventListener('onFailure', function() errDispatcher('onFailure')); - req.addEventListener('onException', function() errDispatcher('onException') ); + req.addEventListener('onException', function() errDispatcher('onException')); req.get(); } }; |