diff --git a/common/content/buffer.js b/common/content/buffer.js index 7f535692..458daa21 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -1019,6 +1019,11 @@ function Buffer() //{{{ elem.contentWindow.focus(); return; } + else if (elemTagName == "input" && elem.getAttribute('type').toLowerCase() == "file") + { + commandline.input("Upload file: ", function (file) elem.value = file, {completer: completion.file, default: elem.value}); + return; + } elem.focus(); @@ -1124,6 +1129,11 @@ function Buffer() //{{{ offsetX = Number(coords[0]) + 1; offsetY = Number(coords[1]) + 1; } + else if (localName == "input" && elem.getAttribute('type').toLowerCase() == "file") + { + commandline.input("Upload file: ", function (file) elem.value = file, {completer: completion.file, default: elem.value}); + return; + } let ctrlKey = false, shiftKey = false; switch (where) diff --git a/common/content/ui.js b/common/content/ui.js index 18cb7059..d01f2a2c 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -1201,6 +1201,8 @@ function CommandLine() //{{{ * for the user's input. * @... {string} promptHighlight - The HighlightGroup used for the * prompt. @default "Question" + * @... {string} default - The initial value that will be returned + * if the user presses straightaway. @default "" */ input: function _input(prompt, callback, extra) { diff --git a/vimperator/NEWS b/vimperator/NEWS index 8cd7d8b1..c33ef4b9 100644 --- a/vimperator/NEWS +++ b/vimperator/NEWS @@ -21,6 +21,8 @@ * IMPORTANT: 'verbose' is now by default at 1, set to 0 to not show any status messages. * IMPORTANT: $VIMPERATOR_HOME is no longer used. + * Selecting an with hints now causes the commandline to prompt + for file input (instead of doing nothing). * [count] now goes to the [count]th next tab rather than the [count]th tab. * add ~/.vimperator/info/{profile}/, similar to viminfo * add $VIMPERATOR_RUNTIME, $VIMPERATOR_INIT