From 8c5abc4cf64d6e2e982c8b1295521535c01b6bb0 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 17 Dec 2010 13:52:10 -0500 Subject: [PATCH] Add param for the JS bookmark object to Bookmark* autocommands. --- common/content/bookmarks.js | 7 ++++++- common/content/commands.js | 2 +- pentadactyl/locale/en-US/autocommands.xml | 19 ++++++++++--------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index 2b3d625c..0c580bec 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -13,7 +13,12 @@ const Bookmarks = Module("bookmarks", { init: function () { storage.addObserver("bookmark-cache", function (key, event, arg) { if (["add", "change", "remove"].indexOf(event) >= 0) - autocommands.trigger("Bookmark" + event[0].toUpperCase() + event.substr(1), arg); + autocommands.trigger("Bookmark" + event[0].toUpperCase() + event.substr(1), iterAll({ + bookmark: { + toString: function () "bookmarkcache.bookmarks[" + arg.id + "]", + valueOf: function () arg + } + }, arg)); statusline.updateUrl(); }, window); }, diff --git a/common/content/commands.js b/common/content/commands.js index 018ed648..b429ce57 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -314,7 +314,7 @@ const Command = Class("Command", { replacementText: null }, { bindMacro: function (args, default_, params) { - let process = String; + let process = util.identity; let makeParams = function makeParams() let (args = arguments) params.map(function (name, i) [name, process(args[i])]).toObject(); diff --git a/pentadactyl/locale/en-US/autocommands.xml b/pentadactyl/locale/en-US/autocommands.xml index ee289b84..5a478a31 100644 --- a/pentadactyl/locale/en-US/autocommands.xml +++ b/pentadactyl/locale/en-US/autocommands.xml @@ -27,18 +27,19 @@
-
<url>
The URL against which the event was selected.
-
<title>
The page, bookmark or download title.
-
<doc>
The document for which the event occurred. Only for DOMLoad, PageLoad and PageLoadPre.
-
<tab>
The tab in which the event occurred. Only for DOMLoad, PageLoad and PageLoadPre.
+
<bookmark>
The JavaScript bookmark object. Only for Bookmark*.
<changed>
The name of the property that has changed. Only for BookmarkChange.
-
<tags>
The tags applied to <url>. Only for Bookmark*.
-
<keyword>
The keywords applied to the bookmark. Only for BookmarkChange, BookmarkRemove.
-
<icon>
The icon associated with <url>. Only for Bookmark*.
-
<size>
The size of a downloaded file. Only for DownloadPost.
+
<doc>
The document for which the event occurred. Only for DOMLoad, PageLoad and PageLoadPre.
<file>
The target destination of a download. Only for DownloadPost.
-
<state>
The new state. Only for Fullscreen and PrivateMode.
+
<icon>
The icon associated with <url>. Only for Bookmark*.
+
<keyword>
The keywords applied to the bookmark. Only for BookmarkChange, BookmarkRemove.
<name>
The name of the item. Only for ColorScheme and Sanitize.
+
<size>
The size of a downloaded file. Only for DownloadPost.
+
<state>
The new state. Only for Fullscreen and PrivateMode.
+
<tab>
The tab in which the event occurred. Only for DOMLoad, PageLoad and PageLoadPre.
+
<tags>
The tags applied to <url>. Only for Bookmark*.
+
<title>
The page, bookmark or download title.
+
<url>
The URL against which the event was selected.