]> gitweb @ CieloNegro.org - sugar.git/blobdiff - dot-files/_vimperator/plugin/multi_requester_js
Auto commit by The Sugar System.
[sugar.git] / dot-files / _vimperator / plugin / multi_requester_js
index 88f24e035308e81f24e892d36e622f584b944c66..4b9c9f9b7765edc00cc45264f42c42f65ba33353 100644 (file)
@@ -5,18 +5,16 @@
   http://www.opensource.jp/licenses/mit-license.html
 }}}  END LICENSE BLOCK ***/
 // PLUGIN_INFO//{{{
-var PLUGIN_INFO =
-<VimperatorPlugin>
-  <name>{NAME}</name>
-  <description>request, and the result is displayed to the buffer.</description>
-  <description lang="ja">リクエストの結果をバッファに出力する。</description>
-  <author mail="suvene@zeromemory.info" homepage="http://zeromemory.sblo.jp/">suVene</author>
-  <version>0.4.15</version>
-  <license>MIT</license>
-  <minVersion>2.0pre</minVersion>
-  <maxVersion>2.1pre</maxVersion>
-  <updateURL>http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/multi_requester.js</updateURL>
-  <detail><![CDATA[
+var INFO = xml`
+<plugin name="multi_requester" version="0.4.16"
+        href="https://github.com/vimpr/vimperator-plugins/raw/master/multi_requester.js"
+        summary="request, and the result is displayed to the buffer."
+        xmlns="http://vimperator.org/namespaces/liberator">
+    <author href="http://zeromemory.sblo.jp/">suVene</author>
+    <license>MIT</license>
+    <project name="Vimperator" minVersion="3.6"/>
+    <p>
+      <code><![CDATA[
 == Needs Library ==
 - _libly.js(ver.0.1.19)
   @see http://coderepos.org/share/browser/lang/javascript/vimperator-plugins/trunk/_libly.js
@@ -99,9 +97,9 @@ let g:multi_requester_order = 'count'; // date by default
 ||<
 補完の順番を設定します。(大きい順に並びます)
 "count" または "date" を設定してください。
-
-   ]]></detail>
-</VimperatorPlugin>;
+      ]]></code>
+    </p>
+</plugin>`;
 //}}}
 (function() {
 if (!liberator.plugins.libly) {
@@ -116,14 +114,14 @@ var SITEINFO = [
     name: "alc",
     description: "SPACE ALC (\u82F1\u8F9E\u6717 on the Web)",
     url: "http://eow.alc.co.jp/%s/UTF-8/",
-    xpath: 'id("resultList")'
+    xpath: 'id("resultsList")'
   }
 ];
 var libly = liberator.plugins.libly;
 var $U = libly.$U;
 var logger = $U.getLogger("multi_requester");
 var mergedSiteinfo = {};
-var store = storage.newMap('plugins-multi_requester', true);
+var store = storage.newMap('plugins-multi_requester', {store: true});
 //}}}
 
 // Vimperator plugin command register {{{
@@ -242,7 +240,7 @@ var DataAccess = {
 
     if (useWedata) {
       logger.log("use wedata");
-      var wedata = new libly.Wedata("Multi%20Requester");
+      var wedata = new libly.Wedata("Multi Requester");
       wedata.getItems(24 * 60 * 60 * 1000,
         function(item) {
           var site = item.data;
@@ -306,7 +304,8 @@ var MultiRequester = {
       let srcEncode = info.srcEncode || "UTF-8";
       let urlEncode = info.urlEncode || srcEncode;
 
-      let repStrCount = let (m = url.match(/%s/g)) (m && m.length);
+      let m = url.match(/%s/g);
+      let repStrCount = m && m.length;
       if (repStrCount && !parsedArgs.strs.length) continue;
 
       // via. lookupDictionary.js
@@ -332,9 +331,9 @@ var MultiRequester = {
             count: count
           }
         });
-        req.addEventListener("onException", $U.bind(this, this.onException));
-        req.addEventListener("onSuccess", $U.bind(this, this.onSuccess));
-        req.addEventListener("onFailure", $U.bind(this, this.onFailure));
+        req.addEventListener("exception", $U.bind(this, this.onException));
+        req.addEventListener("success", $U.bind(this, this.onSuccess));
+        req.addEventListener("failure", $U.bind(this, this.onFailure));
         req.get();
         MultiRequester.requestCount++;
       }
@@ -394,9 +393,9 @@ var MultiRequester = {
     if (!el) throw "extract link failed.: extractLink -> " + extractLink;
     var url = $U.pathToURL(el[0], res.req.url);
     var req = new libly.Request(url, null, $U.extend(res.req.options, { extractLink: true }));
-    req.addEventListener("onException", $U.bind(this, this.onException));
-    req.addEventListener("onSuccess", $U.bind(this, this.onSuccess));
-    req.addEventListener("onFailure", $U.bind(this, this.onFailure));
+    req.addEventListener("exception", $U.bind(this, this.onException));
+    req.addEventListener("success", $U.bind(this, this.onSuccess));
+    req.addEventListener("failure", $U.bind(this, this.onFailure));
     req.get();
     MultiRequester.requestCount++;
     MultiRequester.doProcess = true;