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

@@ -930,33 +930,30 @@ liberator.Editor = function () //{{{
}
else // list all (for that filter {i,c,!})
{
var flagFound = false;
var searchFilter = (filter == "!") ? "!ci" : filter + "!"; // ! -> list all, on c or i ! matches too)
var list = "<table>";
XML.prettyPrinting = false;
let list = <></>;
for (let tmplhs in abbrev)
{
for (let i = 0; i < abbrev[tmplhs].length; i++)
abbrev[tmplhs].forEach(function (abbr)
{
if (searchFilter.indexOf(abbrev[tmplhs][i][0]) > -1)
if (searchFilter.indexOf(abbr[0]) > -1)
{
if (!flagFound)
flagFound = true;
list += "<tr>";
list += "<td> " + abbrev[tmplhs][i][0] + "</td>";
list += "<td> " + liberator.util.escapeHTML(tmplhs) + "</td>";
list += "<td> " + liberator.util.escapeHTML(abbrev[tmplhs][i][1]) + "</td>";
list += "</tr>";
list += <tr>
<td>{abbr[0]}</td>
<td>{tmplhs}</td>
<td>{abbr[1]}</td>
</tr>;
}
}
});
}
if (!flagFound)
if (!list.length())
{
liberator.echoerr("No abbreviations found");
return;
}
list += "</table>";
list = <table>{list}</table>
liberator.commandline.echo(list, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE);
}
},