mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-08 00:55:46 +01:00
Clean some DTD-specific strings out of the top-level config namespace.
This commit is contained in:
@@ -489,6 +489,7 @@ function call(fn) {
|
|||||||
*/
|
*/
|
||||||
function memoize(obj, key, getter) {
|
function memoize(obj, key, getter) {
|
||||||
if (arguments.length == 1) {
|
if (arguments.length == 1) {
|
||||||
|
obj = update({}, obj);
|
||||||
for (let prop in Object.getOwnPropertyNames(obj)) {
|
for (let prop in Object.getOwnPropertyNames(obj)) {
|
||||||
let get = objproto.__lookupGetter__.call(obj, prop);
|
let get = objproto.__lookupGetter__.call(obj, prop);
|
||||||
if (get)
|
if (get)
|
||||||
|
|||||||
@@ -41,9 +41,11 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
|
|
||||||
this.timeout(function () {
|
this.timeout(function () {
|
||||||
services["dactyl:"].pages.dtd = function () [null,
|
services["dactyl:"].pages.dtd = function () [null,
|
||||||
iter(config.dtdExtra, (["dactyl." + s, config[s]] for each (s in config.dtdStrings)))
|
iter(config.dtdExtra,
|
||||||
.map(function ([k, v]) ["<!ENTITY ", k, " '", String.replace(v, /'/g, "'"), "'>"].join(""))
|
(["dactyl." + k, v] for ([k, v] in iter(config.dtd))),
|
||||||
.join("\n")]
|
(["dactyl." + s, config[s]] for each (s in config.dtdStrings)))
|
||||||
|
.map(function ([k, v]) ["<!ENTITY ", k, " '", String.replace(v, /'/g, "'"), "'>"].join(""))
|
||||||
|
.join("\n")]
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -119,17 +121,20 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
return version;
|
return version;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// TODO: DTD properties. Cleanup.
|
dtd: memoize({
|
||||||
get home() "http://dactyl.sourceforge.net/",
|
get home() "http://dactyl.sourceforge.net/",
|
||||||
get apphome() this.home + this.name,
|
get apphome() this.home + this.name,
|
||||||
code: "http://code.google.com/p/dactyl/",
|
code: "http://code.google.com/p/dactyl/",
|
||||||
get issues() this.home + "bug/" + this.name,
|
get issues() this.home + "bug/" + this.name,
|
||||||
get plugins() "http://dactyl.sf.net/" + this.name + "/plugins",
|
get plugins() "http://dactyl.sf.net/" + this.name + "/plugins",
|
||||||
get faq() this.home + this.name + "/faq",
|
get faq() this.home + this.name + "/faq",
|
||||||
"list.mailto": Class.memoize(function () config.name + "@googlegroups.com"),
|
|
||||||
"list.href": Class.memoize(function () "http://groups.google.com/group/" + config.name),
|
"list.mailto": Class.memoize(function () config.name + "@googlegroups.com"),
|
||||||
"hg.latest": Class.memoize(function () config.code + "source/browse/"), // XXX
|
"list.href": Class.memoize(function () "http://groups.google.com/group/" + config.name),
|
||||||
"irc": "irc://irc.oftc.net/#pentadactyl",
|
|
||||||
|
"hg.latest": Class.memoize(function () this.code + "source/browse/"), // XXX
|
||||||
|
"irc": "irc://irc.oftc.net/#pentadactyl",
|
||||||
|
}),
|
||||||
|
|
||||||
dtdExtra: {
|
dtdExtra: {
|
||||||
"xmlns.dactyl": "http://vimperator.org/namespaces/liberator",
|
"xmlns.dactyl": "http://vimperator.org/namespaces/liberator",
|
||||||
@@ -142,21 +147,11 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
|
|
||||||
dtdStrings: [
|
dtdStrings: [
|
||||||
"appName",
|
"appName",
|
||||||
"apphome",
|
|
||||||
"code",
|
|
||||||
"faq",
|
|
||||||
"fileExt",
|
"fileExt",
|
||||||
"hg.latest",
|
|
||||||
"home",
|
|
||||||
"host",
|
"host",
|
||||||
"hostbin",
|
"hostbin",
|
||||||
"idName",
|
"idName",
|
||||||
"irc",
|
|
||||||
"issues",
|
|
||||||
"list.href",
|
|
||||||
"list.mailto",
|
|
||||||
"name",
|
"name",
|
||||||
"plugins",
|
|
||||||
"version"
|
"version"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user