diff options
author | damegane | 2008-08-10 13:22:14 +0000 |
---|---|---|
committer | damegane | 2008-08-10 13:22:14 +0000 |
commit | ccc18e7963d7ed68240ec9c0202644dab4ef70f1 (patch) | |
tree | 4c76a6f30dbdf2d600e2a7fd27eb415a8ea8e2c4 | |
parent | d9bb5caa0fab25df7bf38f1ac1e9b41243487bc1 (diff) | |
download | vimperator-plugins-ccc18e7963d7ed68240ec9c0202644dab4ef70f1.tar.bz2 |
標準オプションでできることだったので削除
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@17331 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r-- | autofocus_canceller.js | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/autofocus_canceller.js b/autofocus_canceller.js deleted file mode 100644 index 3ffa563..0000000 --- a/autofocus_canceller.js +++ /dev/null @@ -1,88 +0,0 @@ -// Vimperator Plugin: Auto-Focus Canceller -// Version: 0.1 - -(function(){ - -const DEBUG = false; -var org_focus = {}; - -function disable_focus(){ - var doc = content.document; - - var input = doc.getElementsByTagName("input"); - if(input.length > 0){ - input = input[0]; - org_focus.input = input.wrappedJSObject.__proto__.focus; - input.wrappedJSObject.__proto__.focus = function(){}; - } - - var textarea = doc.getElementsByTagName("textarea"); - if(textarea.length > 0){ - textarea = textarea[0]; - org_focus.textarea = textarea.wrappedJSObject.__proto__.focus; - textarea.wrappedJSObject.__proto__.focus = function(){}; - } -} - -function enable_focus(){ - var doc = content.document; - - if(org_focus.input){ - var input = doc.getElementsByTagName("input"); - if(input.length > 0){ - input = input[0]; - input.wrappedJSObject.__proto__.focus = org_focus.input; - } - } - - if(org_focus.textarea){ - var textarea = doc.getElementsByTagName("textarea"); - if(textarea.length > 0){ - textarea = textarea[0]; - textarea.wrappedJSObject.__proto__.focus = org_focus.textarea; - } - } - - org_focus = {}; -} - -liberator.autocommands.add("PageLoad", - ".*", - ":autofocuscanceller" -); - -liberator.commands.addUserCommand( - ["autofocuscanceller"], - "", - function(){ - disable_focus(); - content.window.addEventListener("load", function(){ - setTimeout(function(){ - enable_focus(); - }, 1000); - }, false); - }, - null, true -); - -if(DEBUG){ - liberator.commands.addUserCommand( - ["disablefocus"], - "", - function(){ - disable_focus(); - }, - null, true - ); - - liberator.commands.addUserCommand( - ["enablefocus"], - "", - function(){ - enable_focus(); - }, - null, true - ); -} - -})(); |