1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-05 00:14:11 +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

@@ -748,6 +748,18 @@ var Options = Module("options", {
if (event == "change" && opt)
opt.set(opt.globalValue, Option.SCOPE_GLOBAL, true);
}, window);
services["dactyl:"].pages["options.dtd"] = function () [null,
util.makeDTD(
iter(([["option", o.name, "default"].join("."),
o.type === "string" ? o.value.replace(/'/g, "''") :
o.value === true ? "on" :
o.value === false ? "off" : o.stringDefaultValue]
for (o in self)),
([["option", o.name, "type"].join("."), o.type] for (o in self)),
config.dtd))];
},
dactyl: dactyl,