mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 22:07:59 +01:00
More stuff.
This commit is contained in:
@@ -238,7 +238,7 @@ var Modes = Module("modes", {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
return rec(roots).toXMLString();
|
||||
return rec(roots);
|
||||
}
|
||||
|
||||
util.timeout(function () {
|
||||
|
||||
@@ -215,8 +215,8 @@ var ConfigBase = Class("ConfigBase", {
|
||||
"xmlns.html": "http://www.w3.org/1999/xhtml",
|
||||
"xmlns.xul": "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
|
||||
|
||||
"tag.command-line": '<link topic="command-line">command line</link>',
|
||||
"tag.status-line": '<link topic="status-line">status line</link>',
|
||||
"tag.command-line": <link topic="command-line">command line</link>,
|
||||
"tag.status-line": <link topic="status-line">status line</link>,
|
||||
},
|
||||
|
||||
dtdStrings: [
|
||||
|
||||
@@ -756,14 +756,12 @@ var Options = Module("options", {
|
||||
opt.set(opt.globalValue, Option.SCOPE_GLOBAL, true);
|
||||
}, window);
|
||||
|
||||
function escape(str) str.replace(/[<&]/g, function (m) ({ "&": "&", "<": "<" })[m]);
|
||||
|
||||
services["dactyl:"].pages["options.dtd"] = function () [null,
|
||||
util.makeDTD(
|
||||
iter(([["option", o.name, "default"].join("."),
|
||||
escape(o.type === "string" ? o.defaultValue.replace(/'/g, "''") :
|
||||
o.type === "string" ? o.defaultValue.replace(/'/g, "''") :
|
||||
o.value === true ? "on" :
|
||||
o.value === false ? "off" : o.stringDefaultValue)]
|
||||
o.value === false ? "off" : o.stringDefaultValue]
|
||||
for (o in self)),
|
||||
|
||||
([["option", o.name, "type"].join("."), o.type] for (o in self)),
|
||||
|
||||
@@ -1080,9 +1080,11 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
* @returns {string} The DTD fragment containing entity declaration
|
||||
* for *obj*.
|
||||
*/
|
||||
makeDTD: function makeDTD(obj) iter(obj)
|
||||
.map(function ([k, v]) ["<!ENTITY ", k, " '", String.replace(v == null ? "null" : v, /['%]/g,
|
||||
function (m) ({ "'": "'", "%": "%" })[m]),
|
||||
makeDTD: let (map = { "'": "'", '"': """, "%": "%", "&": "&", "<": "<", ">": ">" })
|
||||
function makeDTD(obj) iter(obj)
|
||||
.map(function ([k, v]) ["<!ENTITY ", k, " '", String.replace(v == null ? "null" : typeof v == "xml" ? v.toXMLString() : v,
|
||||
typeof v == "xml" ? /['%]/g : /['"%&<>]/g,
|
||||
function (m) map[m]),
|
||||
"'>"].join(""))
|
||||
.join("\n"),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user