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