1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-28 19:15:46 +01:00

Refactor HTML generation to use E4X. Could use some refactoring.

This commit is contained in:
Kris Maglione
2008-09-30 23:37:33 +00:00
parent 2a9ad9a18b
commit 1cf325a539
11 changed files with 349 additions and 332 deletions

View File

@@ -697,15 +697,23 @@ liberator.Commands = function () //{{{
var cmdlist = getMatchingUserCommands(cmd);
if (cmdlist.length > 0)
{
var str = ":" + liberator.util.escapeHTML(liberator.commandline.getCommand()) + "<br/>" +
"<table><tr class=\"hl-Title\" align=\"left\"><th>Name</th><th>Args</th><th>Definition</th></tr>";
for (let i = 0; i < cmdlist.length; i++)
{
// programmatically added user commands have a null replacementText
str += "<tr><td>" + cmdlist[i].name + "</td><td>" + "*" + "</td><td>" + liberator.util.escapeHTML(cmdlist[i].replacementText || "function () { ... }") + "</td></tr>";
}
str += "</table>";
XML.prettyPrinting = false;
var str = liberator.buffer.template.generic(
<table>
<tr class="hl-Title" align="left">
<th>Name</th>
<th>Args</th>
<th>Definition</th>
</tr>
{[
<tr>
<td>{cmd.name}</td>
<td>*</td>
<td>{cmd.replacementText || "function () { ... }"}</td>
</tr>
for each (cmd in cmdlist)].reduce(liberator.buffer.template.add, <></>)
}
</table>);
liberator.commandline.echo(str, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE);
}
else