mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 15:48:00 +01:00
Commandline completion for hinted file inputs
When an <input type="file"> is selected with hints, it will cause an "Upload file: " prompt in the commandline. (Selection with tab and mouse is left unchanged and will cause the firefox dialog to display)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 <CR> straightaway. @default ""
|
||||
*/
|
||||
input: function _input(prompt, callback, extra)
|
||||
{
|
||||
|
||||
@@ -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 <input type="file"> with hints now causes the commandline to prompt
|
||||
for file input (instead of doing nothing).
|
||||
* [count]<C-n> 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
|
||||
|
||||
Reference in New Issue
Block a user