aboutsummaryrefslogtreecommitdiffstats
path: root/_libly.js
diff options
context:
space:
mode:
authordrry2009-01-04 16:44:41 +0000
committerdrry2009-01-04 16:44:41 +0000
commiteedccef4a1da859fb5f6382a4ee34c059a4c42cb (patch)
treee050c2d5c3e90f626cc0de979f8f73c5cef5eaa1 /_libly.js
parent274755d24c7024b110ec67d4a86699e16db09ae7 (diff)
downloadvimperator-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.js10
1 files changed, 5 insertions, 5 deletions
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();
}
};