mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-08 11:25:51 +01:00
Fix duplicate plugin help entries. Closes issue #51.
This commit is contained in:
@@ -496,7 +496,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
|
|
||||||
let body = XML();
|
let body = XML();
|
||||||
for (let [, context] in Iterator(plugins.contexts))
|
for (let [, context] in Iterator(plugins.contexts))
|
||||||
if (context.INFO instanceof XML)
|
if (context && context.INFO instanceof XML)
|
||||||
body += <h2 xmlns={NS.uri} tag={context.INFO.@name + '-plugin'}>{context.INFO.@summary}</h2> +
|
body += <h2 xmlns={NS.uri} tag={context.INFO.@name + '-plugin'}>{context.INFO.@summary}</h2> +
|
||||||
context.INFO;
|
context.INFO;
|
||||||
|
|
||||||
|
|||||||
@@ -9,25 +9,26 @@
|
|||||||
|
|
||||||
/** @scope modules */
|
/** @scope modules */
|
||||||
|
|
||||||
plugins.contexts = plugins;
|
plugins.contexts = {};
|
||||||
function Script(file) {
|
function Script(file) {
|
||||||
let self = plugins[file.path];
|
let self = plugins[file.path];
|
||||||
if (self) {
|
if (self) {
|
||||||
if (self.onUnload)
|
if (self.onUnload)
|
||||||
self.onUnload();
|
self.onUnload();
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
self = { __proto__: plugins };
|
self = { __proto__: plugins };
|
||||||
plugins[file.path] = self;
|
plugins[file.path] = self;
|
||||||
self.NAME = file.leafName.replace(/\..*/, "").replace(/-([a-z])/g, function (m, n1) n1.toUpperCase());
|
self.NAME = file.leafName.replace(/\..*/, "").replace(/-([a-z])/g, function (m, n1) n1.toUpperCase());
|
||||||
self.PATH = file.path;
|
self.PATH = file.path;
|
||||||
self.CONTEXT = self;
|
self.CONTEXT = self;
|
||||||
|
|
||||||
// This belongs elsewhere
|
// This belongs elsewhere
|
||||||
if (io.getRuntimeDirectories("plugins").some(
|
if (io.getRuntimeDirectories("plugins").some(
|
||||||
function (dir) dir.contains(file, false)))
|
function (dir) dir.contains(file, false)))
|
||||||
plugins[self.NAME] = self;
|
plugins[self.NAME] = self;
|
||||||
|
}
|
||||||
|
plugins.contexts[file.path] = self;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user