From 7eaf3037a993b72d95f630902a2c19d929ada602 Mon Sep 17 00:00:00 2001 From: anekos Date: Tue, 7 Jun 2011 04:07:34 +0900 Subject: RegExp の関数的な呼び出しができなくなったので修正 for Firefox5 --- twittperator.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'twittperator.js') diff --git a/twittperator.js b/twittperator.js index e09a273..fc439db 100644 --- a/twittperator.js +++ b/twittperator.js @@ -1273,7 +1273,7 @@ let PLUGIN_INFO = } for (let [n, v] in Iterator(options)) { - if (/^on[A-Z]/(n) && (v instanceof Function)) + if (/^on[A-Z]/.test(n) && (v instanceof Function)) this.events[n.toLowerCase()] = v; } @@ -1409,7 +1409,7 @@ let PLUGIN_INFO = lines[0] = buf + lines[0]; for (let [, line] in Iterator(lines.slice(0, -1))) { try { - if (/^\s*\{/(line)) + if (/^\s*\{/.test(line)) onMsg(Utils.fixStatusObject(JSON.parse(line)), line); } catch (e) { liberator.log(e); } } @@ -1560,7 +1560,7 @@ let PLUGIN_INFO = } for (let [n, v] in Iterator(st)) { - if (/(^|_)id$/(n)) + if (/(^|_)id$/.test(n)) fixId(result, n); } @@ -1636,7 +1636,7 @@ let PLUGIN_INFO = function loadPluginFromDir(checkGV) { return function(dir) { dir.readDirectory().forEach(function(file) { - if (/\.tw$/(file.path) && (!checkGV || isEnabled(file))) + if (/\.tw$/.test(file.path) && (!checkGV || isEnabled(file))) Twittperator.sourceScriptFile(file); }); } @@ -2004,7 +2004,7 @@ let PLUGIN_INFO = "^" + this.command.map(function(c) let (r = util.escapeRegex(c)) - (/^\W$/(c) ? r : r + "( |$)") + (/^\W$/.test(c) ? r : r + "( |$)") ).join("|") ); }, @@ -2069,7 +2069,7 @@ let PLUGIN_INFO = description: "Open link", action: function(arg) Twittperator.openLink(arg), timelineCompleter: true, - completer: Completers.text(function(s) /https?:\/\//(s.text)) + completer: Completers.text(function(s) /https?:\/\//.test(s.text)) }), SubCommand({ command: ["delete"], -- cgit v1.2.3 From 04462e4bee76682f39f70748e1f0a1909d57e97b Mon Sep 17 00:00:00 2001 From: anekos Date: Wed, 22 Jun 2011 18:22:12 +0900 Subject: callback でのエラーは捕まえないようにした --- twittperator.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'twittperator.js') diff --git a/twittperator.js b/twittperator.js index fc439db..969bd56 100644 --- a/twittperator.js +++ b/twittperator.js @@ -1237,8 +1237,9 @@ let PLUGIN_INFO = url + '.json', query, function (text) { + let json; try { - return callback(JSON.parse(text)); + json = JSON.parse(text); } catch (e) { (onError || @@ -1248,6 +1249,7 @@ let PLUGIN_INFO = throw e; })(e); } + return callback(json); } ); }; -- cgit v1.2.3 From d4e2c5327d707808086d3c1f020e884972698b21 Mon Sep 17 00:00:00 2001 From: anekos Date: Thu, 23 Jun 2011 23:43:36 +0900 Subject: プロテクトユーザ確認時のプロンプトにスクリーンネームがでていなかったのを修正 --- twittperator.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'twittperator.js') diff --git a/twittperator.js b/twittperator.js index 969bd56..7b6da40 100644 --- a/twittperator.js +++ b/twittperator.js @@ -1855,10 +1855,9 @@ let PLUGIN_INFO = } }, // }}} withProtectedUserConfirmation: function(check, actionName, action) { // {{{ - let protectedUserName = Twittperator.isProtected(check); - if (protectedUserName) { + if (Twittperator.isProtected(check)) { Twittperator.confirm( - protectedUserName + " is protected user! Do you really want to " + actionName + '?', + check.screenName + " is protected user! Do you really want to " + actionName + '?', action ); } else { -- cgit v1.2.3