diff --git a/mozilla/browser/base/content/browser.js b/mozilla/browser/base/content/browser.js index e4a15151420..aea68a57db3 100644 --- a/mozilla/browser/base/content/browser.js +++ b/mozilla/browser/base/content/browser.js @@ -21,6 +21,7 @@ # # Contributor(s): # Blake Ross +# David Hyatt # Peter Annema # Dean Tessman # Kevin Puetz (puetzk@iastate.edu) @@ -772,13 +773,13 @@ function updateGoMenu(goMenu) endSep.hidden = false; } -function addBookmarkAs(aBrowser) +function addBookmarkAs(aBrowser, aIsWebPanel) { const browsers = aBrowser.browsers; - if (browsers.length > 1) + if (browsers && browsers.length > 1) addBookmarkForTabBrowser(aBrowser); else - addBookmarkForBrowser(aBrowser.webNavigation); + addBookmarkForBrowser(aBrowser.webNavigation, aIsWebPanel); } function addBookmarkForTabBrowser(aTabBrowser, aSelect) @@ -810,7 +811,7 @@ function addBookmarkForTabBrowser(aTabBrowser, aSelect) currentTabInfo.charset, "addGroup" + (aSelect ? ",group" : ""), tabsInfo); } -function addBookmarkForBrowser(aDocShell) +function addBookmarkForBrowser(aDocShell, aIsWebPanel) { // Bug 52536: We obtain the URL and title from the nsIWebNavigation // associated with a rather than from a DOMWindow. @@ -826,7 +827,7 @@ function addBookmarkForBrowser(aDocShell) catch (e) { title = url; } - BookmarksUtils.addBookmark(url, title, charSet); + BookmarksUtils.addBookmark(url, title, charSet, aIsWebPanel); } function openLocation() diff --git a/mozilla/browser/base/content/web-panels.js b/mozilla/browser/base/content/web-panels.js index 0c428e46c03..7e546116b35 100644 --- a/mozilla/browser/base/content/web-panels.js +++ b/mozilla/browser/base/content/web-panels.js @@ -53,3 +53,7 @@ function grabPage() } catch (e) {} } +function addWebPanel() +{ + window.parent.addBookmarkAs(document.getElementById('webpanels-browser'), true); +} diff --git a/mozilla/browser/base/content/web-panels.xml b/mozilla/browser/base/content/web-panels.xml index b80f8e91f74..1df7a26155c 100644 --- a/mozilla/browser/base/content/web-panels.xml +++ b/mozilla/browser/base/content/web-panels.xml @@ -6,6 +6,9 @@ -Drag a link into this area to view it here. +Drop a link here to view it. +You can also click on the Grab Page button above to +view the current page. + diff --git a/mozilla/browser/base/content/web-panels.xul b/mozilla/browser/base/content/web-panels.xul index 14952df5894..557ed37e6ce 100644 --- a/mozilla/browser/base/content/web-panels.xul +++ b/mozilla/browser/base/content/web-panels.xul @@ -17,6 +17,7 @@ diff --git a/mozilla/browser/components/bookmarks/content/bookmarks.js b/mozilla/browser/components/bookmarks/content/bookmarks.js index 2d7937e5e06..be99b9ece08 100644 --- a/mozilla/browser/components/bookmarks/content/bookmarks.js +++ b/mozilla/browser/components/bookmarks/content/bookmarks.js @@ -1464,10 +1464,11 @@ var BookmarksUtils = { }, // should update the caller, aShowDialog is no more necessary - addBookmark: function (aURL, aTitle, aCharset) + addBookmark: function (aURL, aTitle, aCharset, aIsWebPanel) { openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", - "centerscreen,chrome,dialog=yes,resizable=no,dependent", aTitle, aURL, null, aCharset); + "centerscreen,chrome,dialog=yes,resizable=no,dependent", aTitle, aURL, null, aCharset, + null, null, aIsWebPanel); }, getBrowserTargetFromEvent: function (aEvent) diff --git a/mozilla/browser/components/bookmarks/public/nsIBookmarksService.idl b/mozilla/browser/components/bookmarks/public/nsIBookmarksService.idl index 89505a4c8e6..d09430363dd 100644 --- a/mozilla/browser/components/bookmarks/public/nsIBookmarksService.idl +++ b/mozilla/browser/components/bookmarks/public/nsIBookmarksService.idl @@ -21,6 +21,7 @@ * * Contributor(s): * Ben Goodger + * David Hyatt * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or