1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-14 20:35:47 +01:00

Death to E4X and stuff.

This commit is contained in:
Kris Maglione
2012-12-17 18:56:36 -08:00
parent 0d179d78bc
commit 3f483de547
24 changed files with 112 additions and 517 deletions

View File

@@ -37,7 +37,7 @@ var Bookmarks = Module("bookmarks", {
anchored: false,
title: ["URL", "Info"],
keys: { text: "url", description: "title", icon: "icon", extra: "extra", tags: "tags", isURI: function () true },
process: [template_.icon, template_.bookmarkDescription]
process: [template.icon, template.bookmarkDescription]
}),
// TODO: why is this a filter? --djk

View File

@@ -1578,7 +1578,7 @@ var CommandLine = Module("commandline", {
else if (callable(arg))
arg = String.replace(arg, "/* use strict */ \n", "/* use strict */ ");
else if (!isString(arg) && useColor)
arg = template_.highlight(arg);
arg = template.highlight(arg);
return arg;
}
}, {
@@ -1621,7 +1621,7 @@ var CommandLine = Module("commandline", {
}
else if (commandline._messageHistory.length > 1) {
commandline.commandOutput(
template_.map(commandline._messageHistory.messages, function (message)
template.map(commandline._messageHistory.messages, function (message)
["div", { highlight: message.highlight + " Message" },
message.message]));
}
@@ -1894,7 +1894,7 @@ var ItemList = Class("ItemList", {
["div", { key: "completions" }]],
["div", { highlight: "Completions" },
template_.map(util.range(0, options["maxitems"] * 2), function (i)
template.map(util.range(0, options["maxitems"] * 2), function (i)
["div", { highlight: "CompItem NonText" },
"~"])]],

View File

@@ -253,7 +253,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
results = results.filter(function (item) filters.every(function (re) keys(item).some(re.closure.test)));
commandline.commandOutput(
template_.usage(results, params.format));
template.usage(results, params.format));
},
{
argCount: "*",
@@ -693,7 +693,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
};
}
else if (obj instanceof Option) {
spec = function () template_.map(obj.names, tag, " ");
spec = function () template.map(obj.names, tag, " ");
tag = function (name) DOM.DOMString("'" + name + "'");
link = function (opt, name) ["o", {}, name];
args = { value: "", values: [] };
@@ -702,23 +702,23 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
let res = [
["dt", {}, link(obj.helpTag || tag(obj.name), obj.name)],
["dd", {},
template_.linkifyHelp(obj.description ? obj.description.replace(/\.$/, "") : "", true)]];
template.linkifyHelp(obj.description ? obj.description.replace(/\.$/, "") : "", true)]];
if (specOnly)
return res;
let description = ["description", {},
obj.description ? ["p", {}, template_.linkifyHelp(obj.description.replace(/\.?$/, "."), true)] : "",
obj.description ? ["p", {}, template.linkifyHelp(obj.description.replace(/\.?$/, "."), true)] : "",
extraHelp ? extraHelp : "",
!(extraHelp || obj.description) ? ["p", {}, /*L*/ "Sorry, no help available."] : ""]
res.push(
["item", {},
["tags", {}, template_.map(obj.names.slice().reverse(),
tag,
" ").join("")],
["tags", {}, template.map(obj.names.slice().reverse(),
tag,
" ").join("")],
["spec", {},
let (name = (obj.specs || obj.names)[0])
spec(template_.highlightRegexp(tag(name),
spec(template.highlightRegexp(tag(name),
/\[(.*?)\]/g,
function (m, n0) ["oa", {}, n0]),
name)],
@@ -729,9 +729,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
function add(ary) {
description.push(
["dl", {}, template_.map(ary,
function ([a, b]) [["dt", {}, a], " ",
["dd", {}, b]])]);
["dl", {}, template.map(ary,
function ([a, b]) [["dt", {}, a], " ",
["dd", {}, b]])]);
}
if (obj.completer && false)
@@ -745,7 +745,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
[o.description,
o.names.length == 1 ? "" :
["", " (short name: ",
template_.map(o.names.slice(1), function (n) ["em", {}, n], ", "),
template.map(o.names.slice(1), function (n) ["em", {}, n], ", "),
")"]]
]));
@@ -1144,7 +1144,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
error.message = prefix + error.message;
if (error.message)
dactyl.echoerr(template_.linkifyHelp(error.message));
dactyl.echoerr(template.linkifyHelp(error.message));
else
dactyl.beep();
@@ -1267,9 +1267,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
cache.register("help/index.xml", function () {
return '<?xml version="1.0"?>\n' +
DOM.toXML(["overlay", { xmlns: "dactyl" },
template_.map(dactyl.indices, function ([name, iter])
template.map(dactyl.indices, function ([name, iter])
["dl", { insertafter: name + "-index" },
template_.map(iter(), util.identity)],
template.map(iter(), util.identity)],
"\n\n")]);
});
@@ -1277,7 +1277,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
return '<?xml version="1.0"?>\n' +
DOM.toXML(["overlay", { xmlns: "dactyl" },
["dl", { insertafter: "dialog-list" },
template_.map(config.dialogs, function ([name, val])
template.map(config.dialogs, function ([name, val])
(!val[2] || val[2]())
? [["dt", {}, name],
["dd", {}, val[0]]]
@@ -1289,12 +1289,12 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
return '<?xml version="1.0"?>\n' +
DOM.toXML(["overlay", { xmlns: "dactyl" },
["dl", { insertafter: "sanitize-items" },
template_.map(options.get("sanitizeitems").values
template.map(options.get("sanitizeitems").values
.sort(function (a, b) String.localeCompare(a.name,
b.name)),
function ({ name, description })
[["dt", {}, name],
["dd", {}, template_.linkifyHelp(description, true)]],
["dd", {}, template.linkifyHelp(description, true)]],
"\n")]]);
});
},

View File

@@ -316,7 +316,7 @@ var History = Module("history", {
.concat(jumps)
.concat(sh.slice(sh.index + 1));
commandline.commandOutput(template_.jumps(index, list));
commandline.commandOutput(template.jumps(index, list));
},
{ argCount: "0" });

View File

@@ -770,9 +770,9 @@ var Mappings = Module("mappings", {
description: function (map) [
options.get("passkeys").has(map.name)
? ["span", { highlight: "URLExtra" },
"(", template_.linkifyHelp(_("option.passkeys.passedBy")), ")"]
"(", template.linkifyHelp(_("option.passkeys.passedBy")), ")"]
: [],
template_.linkifyHelp(map.description + (map.rhs ? ": " + map.rhs : ""))
template.linkifyHelp(map.description + (map.rhs ? ": " + map.rhs : ""))
],
help: function (map) let (char = array.compact(map.modes.map(function (m) m.char))[0])
char === "n" ? map.name : char ? char + "_" + map.name : "",

View File

@@ -265,7 +265,7 @@ var Marks = Module("marks", {
}
commandline.commandOutput(
template_.tabular(
template.tabular(
["Mark", "HPos", "VPos", "File"],
["", "text-align: right", "text-align: right", "color: green"],
([name,

View File

@@ -113,7 +113,7 @@ var QuickMarks = Module("quickmarks", {
dactyl.assert(marks.length >= 0, _("quickmark.noMatching", filter.quote()));
}
commandline.commandOutput(template_.tabular(["QuickMark", "URL"], [],
commandline.commandOutput(template.tabular(["QuickMark", "URL"], [],
([mark, quickmarks._qmarks.get(mark)] for ([k, mark] in Iterator(marks)))));
}
}, {

View File

@@ -1044,7 +1044,7 @@ var Tabs = Module("tabs", {
item.indicator],
next.call(this, item, text)
]);
context.process[1] = function (item, text) template_.bookmarkDescription(item, template_.highlightFilter(text, this.filter));
context.process[1] = function (item, text) template.bookmarkDescription(item, template.highlightFilter(text, this.filter));
context.anchored = false;
context.keys = {