mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 01:07:59 +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)
|
||||
|
||||
Reference in New Issue
Block a user