mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-06 18:54:12 +01:00
Fix some issues with loading from an XPI.
This commit is contained in:
@@ -117,9 +117,11 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
if (isArray(value))
|
if (isArray(value))
|
||||||
value = Set(value);
|
value = Set(value);
|
||||||
|
|
||||||
this[prop] = update({}, this[prop],
|
let overrides = {};
|
||||||
iter([util.camelCase(k), value[k]]
|
for (let [key, val] of Object.entries(value))
|
||||||
for (k in value)).toObject());
|
overrides[util.camelCase(key)] = val;
|
||||||
|
|
||||||
|
this[prop] = update({}, this[prop], overrides);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
this[prop] = value;
|
this[prop] = value;
|
||||||
@@ -239,7 +241,7 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
if (jar) {
|
if (jar) {
|
||||||
let prefix = getDir(jar.JAREntry);
|
let prefix = getDir(jar.JAREntry);
|
||||||
res = Array.from(io.listJar(jar.JARFile, prefix),
|
res = Array.from(io.listJar(jar.JARFile, prefix),
|
||||||
s => slice(prefix.length).replace(/\/.*/, ""));
|
s => s.slice(prefix.length).replace(/\/.*/, ""));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
res = Array.from(util.getFile(uri).readDirectory())
|
res = Array.from(util.getFile(uri).readDirectory())
|
||||||
@@ -433,10 +435,15 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
get fileExt() { return this.name.slice(0, -6); },
|
get fileExt() { return this.name.slice(0, -6); },
|
||||||
|
|
||||||
dtd: Class.Memoize(function () {
|
dtd: Class.Memoize(function () {
|
||||||
return iter(this.dtdExtra,
|
return Ary.toObject([
|
||||||
(["dactyl." + k, v] for ([k, v] of iter(config.dtdDactyl))),
|
...Object.entries(this.dtdExtra),
|
||||||
(["dactyl." + s, config[s]] for (s of config.dtdStrings)))
|
|
||||||
.toObject();
|
...Object.entries(config.dtdDactyl)
|
||||||
|
.map(([k, v]) => ["dactyl." + k, v]),
|
||||||
|
|
||||||
|
...config.dtdStrings
|
||||||
|
.map(str => ["dactyl." + str, config[str]]),
|
||||||
|
]);
|
||||||
}),
|
}),
|
||||||
|
|
||||||
dtdDactyl: memoize({
|
dtdDactyl: memoize({
|
||||||
|
|||||||
Reference in New Issue
Block a user