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