diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index 408dcac9..09f9f863 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -1320,35 +1320,6 @@ function scrollBufferAbsolute(horizontal, vertical) win.scrollTo(horiz, vert); } -/////////////////////////////////////////////////////////////////////}}} -// DOM related helper functions //////////////////////////////////////// -/////////////////////////////////////////////////////////////////////{{{ -function isFormElemFocused() -{ - var elt = window.document.commandDispatcher.focusedElement; - if (elt == null) - return false; - - try - { // sometimes the elt doesn't have .localName - var tagname = elt.localName.toLowerCase(); - var type = elt.type.toLowerCase(); - - if ( (tagname == "input" && (type != "image")) || - tagname == "textarea" || - // tagName == "SELECT" || - // tagName == "BUTTON" || - tagname == "isindex") // isindex is a deprecated one-line input box - return true; - } - catch (e) - { - // FIXME: do nothing? - } - - return false; -} - /////////////////////////////////////////////////////////////////////}}} // misc helper functions /////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////{{{ diff --git a/chrome/content/vimperator/events.js b/chrome/content/vimperator/events.js index e6d65b3a..a3ad66da 100644 --- a/chrome/content/vimperator/events.js +++ b/chrome/content/vimperator/events.js @@ -29,7 +29,7 @@ the terms of any one of the MPL, the GPL or the LGPL. function Events() //{{{ { //////////////////////////////////////////////////////////////////////////////// - ////////////////////// CONSTRUCTOR ///////////////////////////////////////////// + ////////////////////// PRIVATE SECTION ///////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ // this handler is for middle click only in the content @@ -76,9 +76,31 @@ function Events() //{{{ //alert("titlechanged"); }, null); - /////////////////////////////////////////////////////////////////////////////}}} - ////////////////////// PRIVATE SECTION ///////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////{{{ + function isFormElemFocused() + { + var elt = window.document.commandDispatcher.focusedElement; + if (elt == null) + return false; + + try + { // sometimes the elt doesn't have .localName + var tagname = elt.localName.toLowerCase(); + var type = elt.type.toLowerCase(); + + if ( (tagname == "input" && (type != "image")) || + tagname == "textarea" || + // tagName == "SELECT" || + // tagName == "BUTTON" || + tagname == "isindex") // isindex is a deprecated one-line input box + return true; + } + catch (e) + { + // FIXME: do nothing? + } + + return false; + } function onPageLoad(event) { diff --git a/chrome/content/vimperator/ui.js b/chrome/content/vimperator/ui.js index b7d8a56a..bfa2303a 100644 --- a/chrome/content/vimperator/ui.js +++ b/chrome/content/vimperator/ui.js @@ -536,7 +536,7 @@ function CommandLine() //{{{ this.onMultilineInputEvent = function(event) { // for now we just receive keypress events - + var key = event.toString(); if (key == "" || key == "" || key == "") {