diff --git a/common/content/dactyl.js b/common/content/dactyl.js
index 232dba67..4de27eb0 100644
--- a/common/content/dactyl.js
+++ b/common/content/dactyl.js
@@ -1234,7 +1234,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
// Process plugin help entries.
XML.ignoreWhiteSpace = XML.prettyPrinting = false;
- let body = XML();
+ let body = [];
for (let [, context] in Iterator(plugins.contexts))
try {
let info = contexts.getDocs(context);
@@ -1249,8 +1249,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
if (elem[attr].length())
info[attr] = elem[attr];
}
- body +=
{info.@summary}
+
- info;
+ body.push(["h2", { xmlns: NS.uri, tag: info.@name + '-plugin' },
+ String(info.@summary)]);
+ body.push(info);
}
}
catch (e) {
@@ -1259,55 +1260,47 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
return '\n' +
'\n' +
-
- {_("help.title.Using Plugins")}
-
+ DOM.toXML(
+ ["document", { xmlns: "dactyl", name: "plugins",
+ title: config.appName + ", Plugins" },
+ ["h1", { tag: "using-plugins" }, _("help.title.Using Plugins")],
+ ["toc", { start: "2" }],
- {body}
- .toXMLString();
+ body]);
});
cache.register("help/index.xml", function () {
- default xml namespace = NS;
-
return '\n' +
- {
- template.map(dactyl.indices, function ([name, iter])
- {
- template.map(iter(), util.identity)
- }
, <>{"\n\n"}>)
- };
+ DOM.toXML(["overlay", { xmlns: "dactyl" },
+ template_.map(dactyl.indices, function ([name, iter])
+ ["dl", { insertafter: name + "-index" },
+ template_.map(iter(), util.identity)],
+ "\n\n")]);
});
cache.register("help/gui.xml", function () {
- default xml namespace = NS;
-
return '\n' +
-
- {
- template.map(config.dialogs, function ([name, val])
- (!val[2] || val[2]())
- ? <>- {name}
- {val[0]}
>
- : undefined,
- <>{"\n"}>)
- }
- ;
+ DOM.toXML(["overlay", { xmlns: "dactyl" },
+ ["dl", { insertafter: "dialog-list" },
+ template_.map(config.dialogs, function ([name, val])
+ (!val[2] || val[2]())
+ ? [["dt", {}, name],
+ ["dd", {}, val[0]]]
+ : undefined,
+ "\n")]]);
});
cache.register("help/privacy.xml", function () {
- default xml namespace = NS;
-
return '\n' +
-
- {
- template.map(options.get("sanitizeitems").values
- .sort(function (a, b) String.localeCompare(a.name, b.name)),
- function ({ name, description })
- <>- {name}
- {template.linkifyHelp(description, true)}
>,
- <>{"\n"}>)
- }
- ;
+ DOM.toXML(["overlay", { xmlns: "dactyl" },
+ ["dl", { insertafter: "sanitize-items" },
+ 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)]],
+ "\n")]]);
});
},
events: function initEvents() {
@@ -1747,14 +1740,24 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
totalUnits = "msec";
commandline.commandOutput(
-
-
- | {_("title.Code execution summary")} |
-
- | {_("title.Executed")}: | {count} | times |
- | {_("title.Average time")}: | {each.toFixed(2)} | {eachUnits} |
- | {_("title.Total time")}: | {total.toFixed(2)} | {totalUnits} |
-
);
+ ["table", {}
+ ["tr", { highlight: "Title", align: "left" },
+ ["th", { colspan: "3" }, _("title.Code execution summary")]],
+ ["tr", {},
+ ["td", {}, _("title.Executed"), ":"],
+ ["td", { align: "right" },
+ ["span", { class: "times-executed" }, count]],
+ ["td", {}, /*L*/"times"]],
+ ["tr", {},
+ ["td", {}, _("title.Average time"), ":"],
+ ["td", { align: "right" },
+ ["span", { class: "time-average" }, each.toFixed(2)]],
+ ["td", {}, eachUnits]],
+ ["tr", {},
+ ["td", {}, _("title.Total time"), ":"],
+ ["td", { align: "right" },
+ ["span", { class: "time-total" }, total.toFixed(2)]],
+ ["td", {}, totalUnits]]]);
}
else {
let beforeTime = Date.now();
@@ -1822,9 +1825,10 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
let date = config.buildDate;
date = date ? " (" + date + ")" : "";
- commandline.commandOutput(
- {config.appName} {config.version}{date} running on:
+
- {navigator.userAgent}
)
+ commandline.commandOutput([
+ ["div", {}, [config.appName, " ", config.version, date, " running on: "].join("")],
+ ["div", {}, [navigator.userAgent].join("")]
+ ])
}
}, {
argCount: "0",
diff --git a/common/modules/config.jsm b/common/modules/config.jsm
index 9c4a7d50..4373acab 100644
--- a/common/modules/config.jsm
+++ b/common/modules/config.jsm
@@ -4,7 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-/* use strict */
+"use strict";
let global = this;
defineModule("config", {
@@ -592,12 +592,14 @@ config.INIT = update(Object.create(config.INIT), config.INIT, {
let img = window.Image();
img.src = this.logo || "resource://dactyl-local-content/logo.png";
img.onload = util.wrapCallback(function () {
- highlight.loadCSS(<>{"!Logo {"}
+ highlight.loadCSS(literal(/*
+ !Logo {
display: inline-block;
- background: url({img.src});
- width: {img.width}px;
- height: {img.height}px;
- {"}"}>);
+ background: url({src});
+ width: {width}px;
+ height: {height}px;
+ }
+ */).replace(/\{(.*?)\}/g, function (m, m1) img[m1]));
img = null;
});
},
diff --git a/common/modules/dom.jsm b/common/modules/dom.jsm
index 01f3d2f3..58ec3284 100644
--- a/common/modules/dom.jsm
+++ b/common/modules/dom.jsm
@@ -1561,7 +1561,7 @@ var DOM = Class("DOM", {
function tag(args, namespaces) {
let _namespaces = namespaces;
- if (isinstance(args, ["String", _]))
+ if (isinstance(args, ["String", "Number", _]))
return doc.createTextNode(args);
if (isXML(args))
return DOM.fromXML(args, doc, nodes);