summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDoug Kearns <dougkearns@gmail.com>2008-12-20 01:08:24 +1100
committerKris Maglione <maglione.k@gmail.com>2008-12-19 15:25:12 -0500
commit6e9262ef6472b1aa2c2ce2c278d2f28e47680a6b (patch)
tree19d6ee51e4bb545090fcc22143aad86c1b01e44f /common
parentabf6bafaf7272415b7ca16ebd8c4347d14a21f82 (diff)
downloadpentadactyl-6e9262ef6472b1aa2c2ce2c278d2f28e47680a6b.tar.gz
document :hardcopy >{filename}...since it was committed
Diffstat (limited to 'common')
-rw-r--r--common/content/buffer.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/common/content/buffer.js b/common/content/buffer.js
index 7527f7ad..0843ecb6 100644
--- a/common/content/buffer.js
+++ b/common/content/buffer.js
@@ -468,14 +468,18 @@ function Buffer() //{{{
"Print current document",
function (args)
{
+ let arg = args[0];
+
+ // FIXME: arg handling is a bit of a mess, check for filename
+ if (arg && (liberator.has("Win32") || arg[0] != ">"))
+ return liberator.echoerr("E488: Trailing characters");
+
options.temporaryContext(function () {
- if (args[0])
+ if (arg)
{
- if (args[0][0] != ">")
- return liberator.echoerr("E488: Trailing characters");
options.setPref("print.print_to_file", "true");
- options.setPref("print.print_to_filename", io.getFile(args[0].substr(1)).path);
- liberator.echomsg("Printing to file: " + args[0].substr(1));
+ options.setPref("print.print_to_filename", io.getFile(arg.substr(1)).path);
+ liberator.echomsg("Printing to file: " + arg.substr(1));
}
else
{
@@ -488,8 +492,8 @@ function Buffer() //{{{
getBrowser().contentWindow.print();
});
- if (args[0])
- liberator.echomsg("Printed: " + args[0].substr(1));
+ if (arg)
+ liberator.echomsg("Printed: " + arg.substr(1));
else
liberator.echomsg("Print job sent.");
},