1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 05:58:03 +01:00

Fix uploading of files by relative path name.

Use io.getFile(path).path instead of just path in order to create an
absolute path.
This commit is contained in:
Conrad Irwin
2009-03-26 03:11:17 +00:00
parent bda0c5bda5
commit 4282b07d77

View File

@@ -1021,7 +1021,16 @@ function Buffer() //{{{
}
else if (elemTagName == "input" && elem.getAttribute('type').toLowerCase() == "file")
{
commandline.input("Upload file: ", function (file) elem.value = file, {completer: completion.file, default: elem.value});
commandline.input("Upload file: ", function (path)
{
let file = io.getFile(path);
if (!file.exists())
return liberator.beep();
elem.value = file.path;
}
, {completer: completion.file, default: elem.value});
return;
}
@@ -1131,7 +1140,16 @@ function Buffer() //{{{
}
else if (localName == "input" && elem.getAttribute('type').toLowerCase() == "file")
{
commandline.input("Upload file: ", function (file) elem.value = file, {completer: completion.file, default: elem.value});
commandline.input("Upload file: ", function (path)
{
let file = io.getFile(path);
if (!file.exists())
return liberator.beep();
elem.value = file.path;
}
, {completer: completion.file, default: elem.value});
return;
}