diff options
author | anekos | 2010-03-09 14:18:21 +0000 |
---|---|---|
committer | anekos | 2010-03-09 14:18:21 +0000 |
commit | 4ca34175067cf4fd087c5c94bbaea77fa38830dd (patch) | |
tree | a4b777fd8ba1bbb4346c70eb07c0a7ee61979733 /happy_hacking_vimperator.js | |
parent | 6a781330ad948f1a36e98b363d7b8ba297561621 (diff) | |
download | vimperator-plugins-4ca34175067cf4fd087c5c94bbaea77fa38830dd.tar.bz2 |
コードにより生成されたっぽいマウスイベントを許してやる方向
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@36971 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'happy_hacking_vimperator.js')
-rw-r--r-- | happy_hacking_vimperator.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/happy_hacking_vimperator.js b/happy_hacking_vimperator.js index 9f0cb35..4c0fd32 100644 --- a/happy_hacking_vimperator.js +++ b/happy_hacking_vimperator.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2008-2009, anekos. +Copyright (c) 2008-2010, anekos. All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -36,10 +36,10 @@ let PLUGIN_INFO = <VimperatorPlugin> <name>Happy Happy Vimperator</name> <description>This plugin makes you to True Vimperatorer</description> - <version>2.4.1</version> + <version>2.4.2</version> <author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author> <minVersion>2.0pre</minVersion> - <maxVersion>2.2pre</maxVersion> + <maxVersion>2.3</maxVersion> <updateURL>http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/happy_hacking_vimperator.js</updateURL> <license>new BSD License (Please read the source code comments of this plugin)</license> <license lang="ja">修正BSDライセンス (ソースコードのコメントを参照してください)</license> @@ -203,6 +203,10 @@ let PLUGIN_INFO = } } + function shumagorasu (func) + function (event) + ('screenX screenY'.split(/\s+/).some(function (name) event[name]) && func(event)); + function damn (event) !/^(script|embed)$/i.test(event.target.tagName); @@ -236,24 +240,18 @@ let PLUGIN_INFO = }, true); ['mousemove', 'DOMMouseScroll', 'mouseup', 'dblclick'].forEach( - function (name) window.addEventListener(name, kill(false), true) + function (name) window.addEventListener(name, shumagorasu(kill(false)), true) ); window.addEventListener( 'mousedown', - function (event) { - mousedownTime = new Date().getTime(); - kill(false)(event); - }, + shumagorasu(function (event) (mousedownTime = new Date().getTime(), kill(false)(event))), true ); window.addEventListener( 'click', - function (event) { - if ((new Date().getTime() - mousedownTime) < 500) - kill('mickey')(event); - }, + shumagorasu(function (event) (((new Date().getTime() - mousedownTime) < 500) && kill('mickey')(event))), true ); |