From b6ee3e5cb9a34a99e387b0c47f8a76320c38b292 Mon Sep 17 00:00:00 2001 From: anekos Date: Tue, 13 Sep 2011 01:09:34 +0900 Subject: libly.Request.addEventListener のイベント名引数の変更に対応 --- tada.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tada.js') diff --git a/tada.js b/tada.js index 96e89e5..b1a9cf9 100644 --- a/tada.js +++ b/tada.js @@ -260,7 +260,7 @@ liberator.plugins.tada = (function(){ let result = []; var req = new libly.Request(getURI(), null, {asynchronous: false}); - req.addEventListener('onSuccess', function(data) { + req.addEventListener('success', function(data) { liberator.log("success"); data.getHTMLDocument("//div[@id='Container']/div[2]/div/div/ul/li/a").forEach(function(item){ var left = $LX("../span/strong[text()]", item); @@ -291,7 +291,7 @@ liberator.plugins.tada = (function(){ let result = []; var req = new libly.Request(getURI() + listId.toString(), null, {asynchronous: false}); - req.addEventListener('onSuccess', function(res) { + req.addEventListener('success', function(res) { liberator.log("success"); res.getHTMLDocument("//ul[@id='incomplete_items']/li/form").forEach(function(item) { result.push({ @@ -315,12 +315,12 @@ liberator.plugins.tada = (function(){ } ); - req.addEventListener('onSuccess', function(data) { + req.addEventListener('success', function(data) { liberator.echo("Posted[" + listName + "]:" + content); liberator.plugins.posted = data; }); - req.addEventListener('onFailure', function(data) { + req.addEventListener('failure', function(data) { liberator.echoerr("POST FAILURE: " + content); }); @@ -332,10 +332,10 @@ liberator.plugins.tada = (function(){ liberator.log("endpoint:" + endpoint); var req = new libly.Request(endpoint, null, {postBody: "dummy=hoge"}); - req.addEventListener('onSuccess', function(data) { + req.addEventListener('success', function(data) { liberator.echo("Send Ta-Da list '" + listName + "' to your email address."); }); - req.addEventListener('onFailure', function(data) { + req.addEventListener('failure', function(data) { liberator.echoerr("EMAIL SENDING ERROR."); liberator.log(data.responseText); }); @@ -354,10 +354,10 @@ liberator.plugins.tada = (function(){ }) } ); - req.addEventListener('onSuccess', function(data) { + req.addEventListener('success', function(data) { liberator.echo("Done: " + itemId); }); - req.addEventListener('onFailure', function(data) { + req.addEventListener('failure', function(data) { liberator.echoerr("Done item failed."); liberator.log(data.responseText); }); -- cgit v1.2.3