1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 20:14:11 +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

@@ -63,12 +63,7 @@ liberator.IO = function () //{{{
function expandPathList(list)
{
var expanded = [];
for (let [,path] in Iterator(list.split(",")))
expanded.push(liberator.io.expandPath(path));
return expanded.join(",");
return list.split(",").map(liberator.io.expandPath).join(",");
}
// TODO: why are we passing around so many strings? I know that the XPCOM
@@ -308,13 +303,17 @@ liberator.IO = function () //{{{
"List all sourced script names",
function ()
{
var list = "<table>";
for (let i = 0; i < scriptNames.length; i++)
list += "<tr><td style=\"text-align: right\">" + (i + 1) + ".</td><td>" + scriptNames[i] + "</td></tr>";
list += "</table>";
XML.prettyPrinting = false;
var list =
<table>
{[
<tr>
<td style="text-align: right">{i+1}</td>
<td>{name}</td>
</tr>
for ([i, name] in Iterator(striptNames))].reduce(liberator.buffer.template.add, <></>)
}
</table>.toXMLString();
liberator.commandline.echo(list, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE);
},
{ argCount: "0" });