From 40406714f7b2d9ef7e3cef7cc32a8262b829cbb0 Mon Sep 17 00:00:00 2001 From: anekos Date: Sun, 22 Nov 2009 06:45:14 +0000 Subject: mousedown -> mouseup などで2回イベントが起きたりするのは微妙な方法で回避 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@35966 d0d07461-0603-4401-acd4-de1884942a52 --- happy_hacking_vimperator.js | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'happy_hacking_vimperator.js') diff --git a/happy_hacking_vimperator.js b/happy_hacking_vimperator.js index 68e03d8..9f0cb35 100644 --- a/happy_hacking_vimperator.js +++ b/happy_hacking_vimperator.js @@ -36,7 +36,7 @@ let PLUGIN_INFO = Happy Happy Vimperator This plugin makes you to True Vimperatorer - 2.4.0 + 2.4.1 anekos 2.0pre 2.2pre @@ -168,21 +168,27 @@ let PLUGIN_INFO = function shit (type) meows[type][Math.floor(Math.random() * meows[type].length)]; - function fuck (msg) { - let sz = innerWidth / msg.length / 1.5; - if (plugins.namakubi && typeof plugins.namakubi.talk == 'function') - plugins.namakubi.talk(msg); - liberator.echo( -
- - - - - -
{msg}
-
- ); - } + let fuck = + let (ignore) + function fuck (msg) { + if (ignore) + return; + setTimeout(function () (ignore = false), 1000); + ignore = true; + let sz = innerWidth / msg.length / 1.5; + if (plugins.namakubi && typeof plugins.namakubi.talk == 'function') + plugins.namakubi.talk(msg); + liberator.echo( +
+ + + + + +
{msg}
+
+ ); + } function kill (msg) { return function (event) { @@ -229,7 +235,7 @@ let PLUGIN_INFO = } }, true); - ['mousemove', 'DOMMouseScroll', 'dblclick'].forEach( + ['mousemove', 'DOMMouseScroll', 'mouseup', 'dblclick'].forEach( function (name) window.addEventListener(name, kill(false), true) ); -- cgit v1.2.3