aboutsummaryrefslogtreecommitdiffstats
path: root/happy_hacking_vimperator.js
diff options
context:
space:
mode:
authoranekos2009-11-22 06:45:14 +0000
committeranekos2009-11-22 06:45:14 +0000
commit40406714f7b2d9ef7e3cef7cc32a8262b829cbb0 (patch)
tree91c7506813a9a5a7d4ddce54fda3702f069c3f97 /happy_hacking_vimperator.js
parent9d019a967c40be75789c54a614453ee803c03cb8 (diff)
downloadvimperator-plugins-40406714f7b2d9ef7e3cef7cc32a8262b829cbb0.tar.bz2
mousedown -> mouseup などで2回イベントが起きたりするのは微妙な方法で回避
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@35966 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'happy_hacking_vimperator.js')
-rw-r--r--happy_hacking_vimperator.js40
1 files changed, 23 insertions, 17 deletions
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 =
<VimperatorPlugin>
<name>Happy Happy Vimperator</name>
<description>This plugin makes you to True Vimperatorer</description>
- <version>2.4.0</version>
+ <version>2.4.1</version>
<author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author>
<minVersion>2.0pre</minVersion>
<maxVersion>2.2pre</maxVersion>
@@ -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(
- <div style="background: white; color: black;">
- <table>
- <tr>
- <td><img src={gunsou}/></td>
- <td style={"font-size: " + sz + "px; white-space: nowrap;"}>{msg}</td>
- </tr>
- </table>
- </div>
- );
- }
+ 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(
+ <div style="background: white; color: black;">
+ <table>
+ <tr>
+ <td><img src={gunsou}/></td>
+ <td style={"font-size: " + sz + "px; white-space: nowrap;"}>{msg}</td>
+ </tr>
+ </table>
+ </div>
+ );
+ }
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)
);