]> git.donarmstrong.com Git - dactyl.git/blobdiff - common/content/autocommands.js
Import 1.0b7.1 supporting Firefox up to 8.*
[dactyl.git] / common / content / autocommands.js
index 2d960c835be66b75f59a9c4fb274eea449fe38d3..beb8fc52e2a199bd5fefab0ed1fa3f1e2d452679 100644 (file)
@@ -47,7 +47,7 @@ var AutoCmdHive = Class("AutoCmdHive", Contexts.Hive, {
      *
      * @param {string} event The event name filter.
      * @param {string} pattern The URL pattern filter.
-     * @returns {AutoCommand[]}
+     * @returns {[AutoCommand]}
      */
     get: function (event, pattern) {
         return this._store.filter(function (autoCmd) autoCmd.match(event, regexp));
@@ -84,12 +84,17 @@ var AutoCommands = Module("autocommands", {
     remove: deprecated("group.autocmd.remove", { get: function remove() autocommands.user.closure.remove }),
 
     /**
-     * Lists all autocommands with a matching *event* and *regexp*.
+     * Lists all autocommands with a matching *event*, *regexp* and optionally
+     * *hives*.
      *
      * @param {string} event The event name filter.
      * @param {string} regexp The URL pattern filter.
+     * @param {[Hive]} hives List of hives.
+     * @optional
      */
-    list: function (event, regexp) {
+    list: function (event, regexp, hives) {
+
+        let hives = hives || this.activeHives;
 
         function cmds(hive) {
             let cmds = {};
@@ -108,7 +113,7 @@ var AutoCommands = Module("autocommands", {
                     <td colspan="3">----- Auto Commands -----</td>
                 </tr>
                 {
-                    template.map(this.activeHives, function (hive)
+                    template.map(hives, function (hive)
                         <tr highlight="Title">
                             <td colspan="3">{hive.name}</td>
                         </tr> +
@@ -143,7 +148,7 @@ var AutoCommands = Module("autocommands", {
         let lastPattern = null;
         var { url, doc } = args;
         if (url)
-            uri = util.newURI(url);
+            uri = util.createURI(url);
         else
             var { uri, doc } = buffer;
 
@@ -200,7 +205,7 @@ var AutoCommands = Module("autocommands", {
                             args["-group"].remove(event, regexp); // remove all
                     }
                     else
-                        autocommands.list(event, regexp); // list all
+                        autocommands.list(event, regexp, args.explicitOpts["-group"] ? [args["-group"]] : null); // list all
                 }
             }, {
                 bang: true,