1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 18:57:58 +01:00

Completely HTML-ize help transforms. Add intentionally undocumented :exporthelp.

This commit is contained in:
Kris Maglione
2009-11-02 00:18:58 -05:00
parent 3f4602ca3c
commit 108f467fe4
10 changed files with 354 additions and 181 deletions

View File

@@ -567,6 +567,23 @@ const liberator = (function () //{{{
});
});
commands.add(["exporth[elp]"],
"Exports " + config.name + "'s help system to the named zip file",
function (args)
{
liberator.echomsg("Exporting help to " + args[0].quote() + ". Please wait...");
util.exportHelp(args[0]);
liberator.echomsg("Help exported to " + args[0].quote() + ".");
},
{
argCount: "1",
completer: function (context) {
context.filters.push(function ({ item: f }) f.isDirectory() || /\.zip/.test(f.leafName));
completion.file(context);
},
literal: 0
});
commands.add(["javas[cript]", "js"],
"Run a JavaScript command through eval()",
function (args)
@@ -1845,6 +1862,18 @@ const liberator = (function () //{{{
liberator.reportError(e);
}
let img = Image();
img.src = config.logo || "chrome://" + config.name.toLowerCase() + "/content/logo.png";
img.onload = function () {
highlight.set("Logo", String(<>
display: inline-block;
background: url({img.src});
width: {img.width}px;
height: {img.height}px;
</>));
delete img;
};
// commands must always be the first module to be initialized
loadModule("commands", Commands);
loadModule("options", Options);