1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-31 13:25:46 +01:00

Automagically generate option types and default value entities for options.xml.

This commit is contained in:
Kris Maglione
2011-03-15 23:12:28 -04:00
parent 2d03f3f9ca
commit f1965c81ff
8 changed files with 167 additions and 145 deletions

View File

@@ -27,12 +27,7 @@ var ConfigBase = Class("ConfigBase", {
set.add(this.features, "Gecko2");
this.timeout(function () {
services["dactyl:"].pages.dtd = function () [null,
iter(config.dtdExtra,
(["dactyl." + k, v] for ([k, v] in iter(config.dtd))),
(["dactyl." + s, config[s]] for each (s in config.dtdStrings)))
.map(function ([k, v]) ["<!ENTITY ", k, " '", String.replace(v || "null", /'/g, "&apos;"), "'>"].join(""))
.join("\n")]
services["dactyl:"].pages.dtd = function () [null, util.makeDTD(config.dtd)];
});
},
@@ -168,9 +163,15 @@ var ConfigBase = Class("ConfigBase", {
return version;
}),
get fileExt() this.name.slice(0, -5),
get fileExt() this.name.slice(0, -6),
dtd: memoize({
dtd: Class.memoize(function ()
iter(this.dtdExtra,
(["dactyl." + k, v] for ([k, v] in iter(config.dtdDactyl))),
(["dactyl." + s, config[s]] for each (s in config.dtdStrings)))
.toObject()),
dtdDactyl: memoize({
get name() config.name,
get home() "http://dactyl.sourceforge.net/",
get apphome() this.home + this.name,