From a3734419cd45b26649c71afb4e56ad4e9990c6d0 Mon Sep 17 00:00:00 2001 From: teramako Date: Wed, 22 Dec 2010 22:51:35 +0900 Subject: supports html5 input types --- walk-input.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'walk-input.js') 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 = - @@ -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; -- cgit v1.2.3