Changeset 27459
- Timestamp:
- 12/26/08 22:20:40 (4 years ago)
- Location:
- lang/javascript/vimperator-plugins/trunk
- Files:
-
- 3 modified
-
_libly.js (modified) (3 diffs)
-
multi_requester.js (modified) (1 diff)
-
nextlink.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/_libly.js
r27457 r27459 524 524 if (store && store.get('data') && new Date(store.get('expire')) > new Date()) { 525 525 logger.log('return cache. '); 526 store.get('data').forEach(function(item) itemCallback(item)); 527 finalCallback(true, store.get('data')); 526 store.get('data').forEach(function(item) { if (typeof itemCallback == 'function') itemCallback(item); }); 527 if (typeof finalCallback == 'function') 528 finalCallback(true, store.get('data')); 528 529 return; 529 530 } … … 532 533 if (cache) { 533 534 logger.log('return cache. -> ' + msg); 534 cache.forEach(function(item) itemCallback(item)); 535 finalCallback(true, cache); 535 cache.forEach(function(item) { if (typeof itemCallback == 'function') itemCallback(item); }); 536 if (typeof finalCallback == 'function') 537 finalCallback(true, cache); 536 538 } else { 537 finalCallback(false, msg); 539 if (typeof finalCallback == 'function') 540 finalCallback(false, msg); 538 541 } 539 542 } … … 554 557 store.set('data', json); 555 558 store.save(); 556 json.forEach(function(item) itemCallback(item)); 557 finalCallback(true, json); 559 json.forEach(function(item) { if (typeof itemCallback == 'function') itemCallback(item); }); 560 if (typeof finalCallback == 'function') 561 finalCallback(true, json); 558 562 })); 559 563 req.addEventListener('onFailure', function() errDispatcher('onFailure')); -
lang/javascript/vimperator-plugins/trunk/multi_requester.js
r27456 r27459 19 19 <detail><![CDATA[ 20 20 == Needs Library == 21 - _libly.js(ver.0.1.1 1)21 - _libly.js(ver.0.1.15) 22 22 @see http://coderepos.org/share/browser/lang/javascript/vimperator-plugins/trunk/_libly.js 23 23 -
lang/javascript/vimperator-plugins/trunk/nextlink.js
r27241 r27459 12 12 <description lang="ja">AutoPagerize 用の XPath より "[[", "]]" をマッピングします。</description> 13 13 <author mail="suvene@zeromemory.info" homepage="http://zeromemory.sblo.jp/">suVene</author> 14 <version>0.2. 9</version>14 <version>0.2.10</version> 15 15 <license>MIT</license> 16 16 <minVersion>1.2</minVersion> … … 19 19 <detail><![CDATA[ 20 20 == Needs Library == 21 - _libly.js(ver.0.1.1 1)21 - _libly.js(ver.0.1.15) 22 22 @see http://coderepos.org/share/browser/lang/javascript/vimperator-plugins/trunk/_libly.js 23 23 … … 78 78 initialize: function(pager) { 79 79 80 this.WEDATA_AUTOPAGERIZE = 'http://wedata.net/databases/AutoPagerize/items.json';81 80 this.initialized = false; 82 81 this.isCurOriginalMap = true; … … 87 86 this.is2_0later = config.autocommands.some(function ([k, v]) k == 'DOMLoad'); // toriaezu 88 87 89 var req = new libly.Request(this.WEDATA_AUTOPAGERIZE); 90 req.addEventListener('onSuccess', $U.bind(this, 91 function(res) { 92 var json = $U.evalJson(res.responseText); 93 if (!json) return; 94 this.siteinfo = json.map(function(item) item.data) 88 var wedata = new libly.Wedata('AutoPagerize'); 89 wedata.getItems(24 * 60 * 60 * 1000, null, 90 $U.bind(this, function(isSuccess, data) { 91 if (!isSuccess) return; 92 this.siteinfo = data.map(function(item) item.data) 95 93 .sort(function(a, b) b.url.length - a.url.length); // sort url.length desc 96 94 this.initialized = true; 97 } 98 )); 99 req.get(); 95 }) 96 ); 100 97 // for debug 101 98 /*
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)