From eedccef4a1da859fb5f6382a4ee34c059a4c42cb Mon Sep 17 00:00:00 2001 From: drry Date: Sun, 4 Jan 2009 16:44:41 +0000 Subject: * 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 --- _libly.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '_libly.js') diff --git a/_libly.js b/_libly.js index 54bb042..fcdff1f 100644 --- a/_libly.js +++ b/_libly.js @@ -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(); } }; -- cgit v1.2.3