1
0
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:
Conrad Irwin
2009-03-16 12:28:34 +00:00
parent c8a405cec5
commit 924aba8f54
3 changed files with 14 additions and 0 deletions

View File

@@ -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)