aboutsummaryrefslogtreecommitdiffstats
path: root/walk-input.js
diff options
context:
space:
mode:
authorteramako2010-12-22 22:51:35 +0900
committerteramako2010-12-22 22:51:35 +0900
commita3734419cd45b26649c71afb4e56ad4e9990c6d0 (patch)
tree8c985d9fa428e34e0a26273279c64e047d2edc73 /walk-input.js
parent9ab8980ceddc43f6cb6649100d3609eeb6c7472e (diff)
downloadvimperator-plugins-a3734419cd45b26649c71afb4e56ad4e9990c6d0.tar.bz2
supports html5 input types
Diffstat (limited to 'walk-input.js')
-rw-r--r--walk-input.js22
1 files changed, 20 insertions, 2 deletions
diff --git a/walk-input.js b/walk-input.js
index d28b495..f788746 100644
--- a/walk-input.js
+++ b/walk-input.js
@@ -20,7 +20,7 @@
// PLUGIN_INFO {{{
let INFO =
-<plugin name="Walk-Input" version="1.1"
+<plugin name="Walk-Input" version="1.2"
href="http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/walk-input.js"
summary="The focus walks 'input' and 'textarea' element."
xmlns="http://vimperator.org/namespaces/liberator">
@@ -63,7 +63,25 @@ let INFO =
(function () {
-var xpath = '//input[@type="text" or @type="password" or @type="search" or not(@type)] | //textarea';
+var types = [
+ "text",
+ "passsword",
+ "search",
+ "file",
+ "datetime",
+ "datetime-local",
+ "date",
+ "month",
+ "time",
+ "week",
+ "number",
+ "range",
+ "email",
+ "url",
+ "tel",
+ "color",
+].map(function(type) "@type=" + type.quote()).join(" or ");
+var xpath = '//input[' + types + ' or not(@type)] | //textarea';
var walkinput = function (forward) {
var focused = document.commandDispatcher.focusedElement;