diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 470ae96d..1d27671f 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -213,9 +213,13 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { let results = array((params.iterateIndex || params.iterate).call(params, commands.get(name).newArgs())) .array.sort(function (a, b) String.localeCompare(a.name, b.name)); - for (let obj in values(results)) - if (obj.helpTag in services["dactyl:"].HELP_TAGS) - yield dactyl.generateHelp(obj, null, null, true); + for (let obj in values(results)) { + let res = dactyl.generateHelp(obj, null, null, true); + if (!set.has(services["dactyl:"].HELP_TAGS, obj.helpTag)) + res[1].@tag = obj.helpTag; + + yield res; + } }; }, @@ -786,6 +790,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { ]; } addTags("versions", util.httpGet("dactyl://help/versions").responseXML); + addTags("plugins", util.httpGet("dactyl://help/plugins").responseXML); default xml namespace = NS; @@ -799,7 +804,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { }, <>{"\n\n"}))) + '\n']; - addTags("plugins", util.httpGet("dactyl://help/plugins").responseXML); + addTags("index", util.httpGet("dactyl://help/index").responseXML); + this.helpInitialized = true; } }, @@ -969,7 +975,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { template.linkifyHelp(obj.description ? obj.description.replace(/\.$/, "") : "", true) }; if (specOnly) - return res.*; + return res.elements(); res.* += <> diff --git a/common/modules/commands.jsm b/common/modules/commands.jsm index d33d906a..6510c111 100644 --- a/common/modules/commands.jsm +++ b/common/modules/commands.jsm @@ -12,7 +12,7 @@ Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("commands", { exports: ["ArgType", "Command", "Commands", "CommandOption", "Ex", "commands"], require: ["contexts"], - use: ["config", "options", "template", "util"] + use: ["config", "options", "services", "template", "util"] }, this); /** @@ -1540,6 +1540,8 @@ var Commands = Module("commands", { cmd.hive == commands.builtin ? "" : {cmd.hive.name} ] })), + iterateIndex: function (args) let (tags = services["dactyl:"].HELP_TAGS) + this.iterate(args).filter(function (cmd) cmd.hive === commands.builtin || set.has(cmd.helpTag)), format: { headings: ["Command", "Group", "Description"], description: function (cmd) template.linkifyHelp(cmd.description + (cmd.replacementText ? ": " + cmd.action : "")),