From b2f3db6fe2a3ff8887c5961b868bebf530c4cfaf Mon Sep 17 00:00:00 2001 From: Alex Kovar Date: Mon, 27 Sep 2010 10:49:07 -0500 Subject: added bookmarklet support to bookmark mode --- bookmarks.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/bookmarks.js b/bookmarks.js index 476e28ac..ad57e1bf 100644 --- a/bookmarks.js +++ b/bookmarks.js @@ -84,14 +84,19 @@ function activateBookmarkFindMode() { var bookmarksFound = BookmarkMode.bookmarksFound; if(bookmarksFound && bookmarksFound.length>0) { var url = bookmarksFound[0].url - if(BookmarkMode.newTab) { - BookmarkMode.disable(); - window.open(url) + if(url.indexOf("javascript:")===0) { + eval(url.substr(11, url.length)) } else { - BookmarkMode.disable(); - window.location=url + if(BookmarkMode.newTab) { + window.open(url) + } + else { + window.location=url + } } + + BookmarkMode.disable(); } } @@ -115,6 +120,8 @@ function activateBookmarkFindMode() { } BookmarkMode.finder.find(BookmarkMode.getQueryString()) + event.stopPropagation(); + event.preventDefault(); }, keyUp: function(event) { // shift key will toggle between new tab/same tab -- cgit v1.2.3