From b6ee3e5cb9a34a99e387b0c47f8a76320c38b292 Mon Sep 17 00:00:00 2001 From: anekos Date: Tue, 13 Sep 2011 01:09:34 +0900 Subject: libly.Request.addEventListener のイベント名引数の変更に対応 --- atnd.js | 8 ++++---- hatebuWatchDog.js | 4 ++-- multi_requester.js | 12 ++++++------ nextlink.js | 6 +++--- notifier.js | 8 ++++---- pino.js | 8 ++++---- readitlater.js | 24 ++++++++++++------------ subscldr.js | 6 +++--- tada.js | 16 ++++++++-------- vimp_to_android_phone.js | 4 ++-- 10 files changed, 48 insertions(+), 48 deletions(-) diff --git a/atnd.js b/atnd.js index 78ede2b..86d802f 100644 --- a/atnd.js +++ b/atnd.js @@ -68,7 +68,7 @@ let INFO = } ); - req.addEventListener("onSuccess",function(data){ + req.addEventListener("success",function(data){ let res = libly.$U.evalJson(data.responseText); if(res.results_returned == 0){ liberator.echo("keyword: " + keyword + " was no result"); @@ -104,7 +104,7 @@ let INFO = } }); - req.addEventListener("onFailure",function(data){ + req.addEventListener("failure",function(data){ liberator.echoerr(data.statusText); }); @@ -124,7 +124,7 @@ let INFO = asynchronous:true, } ); - req.addEventListener("onSuccess",function(data){ + req.addEventListener("success",function(data){ let res = libly.$U.evalJson(data.responseText); if(res.results_returned == 0){ return ; @@ -144,7 +144,7 @@ let INFO = } }); - req.addEventListener("onFailure",function(data){ + req.addEventListener("failure",function(data){ context.incomplete = false; liberator.echoerr(data.statusText); }); diff --git a/hatebuWatchDog.js b/hatebuWatchDog.js index 476cbf4..0a683e4 100644 --- a/hatebuWatchDog.js +++ b/hatebuWatchDog.js @@ -119,13 +119,13 @@ let publics = plugins.hatebuWatchDog = (function() { ); let currentValue; - req.addEventListener("onSuccess", function(data) { + req.addEventListener("success", function(data) { liberator.log("XML-RPC request was succeeded."); let resXml = new XML(data.responseText.replace(/^<\?xml version[^>]+?>/, '')); currentValue = window.eval(resXml..int.toString()); onSuccess(currentValue); }); - req.addEventListener("onFailure", function(data) { + req.addEventListener("failure", function(data) { onFailure(); }); liberator.log("reauest..."); diff --git a/multi_requester.js b/multi_requester.js index 305006f..1165edf 100644 --- a/multi_requester.js +++ b/multi_requester.js @@ -332,9 +332,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 +394,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; diff --git a/nextlink.js b/nextlink.js index 9149966..e96ea1c 100644 --- a/nextlink.js +++ b/nextlink.js @@ -264,9 +264,9 @@ Autopager.prototype = { return true; } - req.addEventListener("onSuccess", $U.bind(this, this.onSuccess)); - req.addEventListener("onFailure", $U.bind(this, this.onFailure)); - req.addEventListener("onException", $U.bind(this, this.onFailure)); + req.addEventListener("success", $U.bind(this, this.onSuccess)); + req.addEventListener("failure", $U.bind(this, this.onFailure)); + req.addEventListener("exception", $U.bind(this, this.onFailure)); req.get(); }, onSuccess: function(res) { diff --git a/notifier.js b/notifier.js index 07784eb..cb78c9d 100644 --- a/notifier.js +++ b/notifier.js @@ -255,14 +255,14 @@ function bootstrap() { this.options.headers, $U.extend({ asynchronous: true }, this.options.extra) ); - req.addEventListener("onSuccess", $U.bind(this, function(res) { + req.addEventListener("success", $U.bind(this, function(res) { logger.log("initialized"); if (typeof this.parse == "function") this.cache = this.parse(res); if (this.cache) this.initialized = true; })); - req.addEventListener("onFailure", function(res) { logger.log(res); }); - req.addEventListener("onException", function(res) { logger.log(res); }); + req.addEventListener("failure", function(res) { logger.log(res); }); + req.addEventListener("exception", function(res) { logger.log(res); }); if (this.method == "POST") req.post(); else @@ -277,7 +277,7 @@ function bootstrap() { this.options.headers, $U.extend({ asynchronous: true }, this.options.extra) ); - req.addEventListener("onSuccess", $U.bind(this, function(res) { + req.addEventListener("success", $U.bind(this, function(res) { var parsed, diff; if (typeof this.parse == "function") parsed = this.parse(res); if (parsed && typeof this.diff == "function") diff = this.diff(this.cache, parsed); diff --git a/pino.js b/pino.js index 375a55f..ca8cd47 100644 --- a/pino.js +++ b/pino.js @@ -259,10 +259,10 @@ let self = liberator.plugins.pino = (function() { } ); - request.addEventListener("onSuccess", function(data) { + request.addEventListener("success", function(data) { liberator.log("Removed pin from '" + link + "' was succeeded."); }); - request.addEventListener("onFailure", function(data) { + request.addEventListener("failure", function(data) { liberator.echoerr("Cannot remove pin"); }); request.post(); @@ -279,14 +279,14 @@ let self = liberator.plugins.pino = (function() { } ); - request.addEventListener("onSuccess", function(data) { + request.addEventListener("success", function(data) { if (isLoginPage(data)) { liberator.echoerr("Can't get pinned list. Maybe you should login to livedoor."); return; } result = unentifyObjectValues(liberator.eval(data.responseText)); }); - request.addEventListener("onFailure", function(data) { + request.addEventListener("failure", function(data) { liberator.echoerr("Can't get pinned list!!!"); }); request.post(); diff --git a/readitlater.js b/readitlater.js index b6c20aa..8d87fb7 100644 --- a/readitlater.js +++ b/readitlater.js @@ -215,11 +215,11 @@ let PLUGIN_INFO = ); - req.addEventListener("onSuccess",function(data){ + req.addEventListener("success",function(data){ e(data.responseText) }); - req.addEventListener("onFailure",function(data){ + req.addEventListener("failure",function(data){ liberator.echoerr(data.statusText); liberator.echoerr(data.responseText); }); @@ -255,8 +255,8 @@ let PLUGIN_INFO = ); - req.addEventListener("onSuccess",function(data) callback(libly.$U.evalJson(data.responseText))); - req.addEventListener("onFailure",function(data){ + req.addEventListener("success",function(data) callback(libly.$U.evalJson(data.responseText))); + req.addEventListener("failure",function(data){ liberator.echoerr(data.statusText); liberator.echoerr(data.responseText); }); @@ -286,9 +286,9 @@ let PLUGIN_INFO = } ); - req.addEventListener("onSuccess",callback); + req.addEventListener("success",callback); - req.addEventListener("onFailure",function(data){ + req.addEventListener("failure",function(data){ liberator.echoerr(data.statusText); liberator.echoerr(data.responseText); }); @@ -328,9 +328,9 @@ let PLUGIN_INFO = ); var ref = this; - req.addEventListener("onSuccess",callback); + req.addEventListener("success",callback); - req.addEventListener("onFailure",function(data){ + req.addEventListener("failure",function(data){ liberator.echoerr(data.statusText); liberator.echoerr(data.responseText); }); @@ -361,7 +361,7 @@ let PLUGIN_INFO = ); - req.addEventListener("onSuccess",function(data){ + req.addEventListener("success",function(data){ let res = libly.$U.evalJson(data.responseText); liberator.echo(