aboutsummaryrefslogtreecommitdiffstats
path: root/auto_detect_link.js
diff options
context:
space:
mode:
authoranekos2008-11-08 16:54:49 +0000
committeranekos2008-11-08 16:54:49 +0000
commit8893144e53fe91f547433efeaee34f53ee33bcfd (patch)
treedf31c3c7a371a19ed19b40d05e58774f9f041cd6 /auto_detect_link.js
parent102ead4b7addd595d782f500c91d9e7d1b53bc32 (diff)
downloadvimperator-plugins-8893144e53fe91f547433efeaee34f53ee33bcfd.tar.bz2
移動後の echo 表示の空白をけずるようにした。
その他。 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@23018 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'auto_detect_link.js')
-rw-r--r--auto_detect_link.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/auto_detect_link.js b/auto_detect_link.js
index eddf66b..d854203 100644
--- a/auto_detect_link.js
+++ b/auto_detect_link.js
@@ -2,7 +2,7 @@
// @name Auto Detect Link
// @description-ja (次|前)っぽいページへのリンクを探してジャンプ
// @license Creative Commons 2.1 (Attribution + Share Alike)
-// @version 1.3
+// @version 1.4
// @author anekos (anekos@snca.net)
// ==/VimperatorPlugin==
//
@@ -72,7 +72,7 @@
// history
-(function () { try {
+(function () {
liberator.log('auto_detect_link.js loading');
////////////////////////////////////////////////////////////////
@@ -106,6 +106,7 @@
//clickButton: true,
force: false,
useAutoPagerize: true,
+ displayDelay: 500,
};
////////////////////////////////////////////////////////////////
@@ -146,6 +147,9 @@
// functions
////////////////////////////////////////////////////////////////
+ function removeSpace (str)
+ str.replace(/^\s+|\s+$/g, '').replace(/\s+/g, ' ');
+
// Array#find
function find (ary, f) {
var func = (typeof f == 'function') ? f : function (v) v == f;
@@ -169,8 +173,8 @@
// 開いたURIなどの表示
function displayOpened (link) {
- var msg = 'open: ' + link.type + ' <' + link.text + '> ' + link.uri;
- setTimeout(function () liberator.echo(msg, commandline.FORCE_SINGLELINE), 1000);
+ var msg = 'open: ' + link.type + ' <' + removeSpace(link.text) + '> ' + link.uri;
+ setTimeout(function () liberator.echo(msg, commandline.FORCE_SINGLELINE), gv().displayDelay);
liberator.log(msg);
}
@@ -470,4 +474,4 @@
liberator.log('auto_detect_link.js loaded');
-} catch (e) { liberator.log(e); } })();
+})();