diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc
index af69b6369d20..896507c5126f 100644
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -367,6 +367,10 @@
+
diff --git a/browser/base/content/browser-sets.inc b/browser/base/content/browser-sets.inc
index a8ad1d8adb63..374b2ceb3ec1 100644
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -147,7 +147,8 @@
-
+
+
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
index 5fcf589b246f..ed214b324827 100644
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -185,6 +185,37 @@ function UpdateBackForwardButtons()
}
}
+function UpdateBookmarkAllTabsMenuitem()
+{
+ var tabbrowser = getBrowser();
+ var numTabs = tabbrowser.tabContainer.childNodes.length;
+
+ var bookmarkAllCommand = document.getElementById("Browser:BookmarkAllTabs");
+ if (numTabs > 1)
+ bookmarkAllCommand.removeAttribute("disabled");
+ else
+ bookmarkAllCommand.setAttribute("disabled", "true");
+}
+
+function addBookmarkMenuitems()
+{
+ var tabbrowser = getBrowser();
+ var tabMenu = document.getAnonymousElementByAttribute(tabbrowser,"anonid","tabContextMenu");
+ var bookmarkAllTabsItem = document.createElement("menuitem");
+ bookmarkAllTabsItem.setAttribute("label", gNavigatorBundle.getString("bookmarkAllTabs_label"));
+ bookmarkAllTabsItem.setAttribute("accesskey", gNavigatorBundle.getString("bookmarkAllTabs_accesskey"));
+ bookmarkAllTabsItem.setAttribute("command", "Browser:BookmarkAllTabs");
+ var bookmarkCurTabItem = document.createElement("menuitem");
+ bookmarkCurTabItem.setAttribute("label", gNavigatorBundle.getString("bookmarkCurTab_label"));
+ bookmarkCurTabItem.setAttribute("accesskey", gNavigatorBundle.getString("bookmarkCurTab_accesskey"));
+ bookmarkCurTabItem.setAttribute("oncommand", "addBookmarkAs((getBrowser().mContextTab).linkedBrowser, false);");
+ var menuseparator = document.createElement("menuseparator");
+ var insertPos = tabMenu.lastChild.previousSibling;
+ tabMenu.insertBefore(bookmarkAllTabsItem, insertPos);
+ tabMenu.insertBefore(bookmarkCurTabItem, bookmarkAllTabsItem);
+ tabMenu.insertBefore(menuseparator, bookmarkCurTabItem);
+}
+
const gSessionHistoryObserver = {
observe: function(subject, topic, data)
{
@@ -769,6 +800,8 @@ function delayedStartup()
initFindBar();
+ // add bookmark options to context menu for tabs
+ addBookmarkMenuitems();
// now load bookmarks
BMSVC.readBookmarks();
var bt = document.getElementById("bookmarks-ptf");
@@ -1508,16 +1541,16 @@ function updateGoMenu(goMenu)
endSep.hidden = false;
}
-function addBookmarkAs(aBrowser, aIsWebPanel)
+function addBookmarkAs(aBrowser, aBookmarkAllTabs, aIsWebPanel)
{
const browsers = aBrowser.browsers;
if (browsers && browsers.length > 1)
- addBookmarkForTabBrowser(aBrowser);
+ addBookmarkForTabBrowser(aBrowser, aBookmarkAllTabs);
else
addBookmarkForBrowser(aBrowser.webNavigation, aIsWebPanel);
}
-function addBookmarkForTabBrowser(aTabBrowser, aSelect)
+function addBookmarkForTabBrowser(aTabBrowser, aBookmarkAllTabs, aSelect)
{
var tabsInfo = [];
var currentTabInfo = { name: "", url: "", charset: null };
@@ -1537,11 +1570,16 @@ function addBookmarkForTabBrowser(aTabBrowser, aSelect)
} catch (e) {
name = url;
}
- tabsInfo[i] = { name: name, url: url, charset: charSet, description: description, bAddGroup: true };
+ tabsInfo[i] = { name: name, url: url, charset: charSet, description: description };
if (browsers[i] == activeBrowser)
currentTabInfo = tabsInfo[i];
}
var dialogArgs = currentTabInfo;
+ if (aBookmarkAllTabs) {
+ dialogArgs = { name: gNavigatorBundle.getString("bookmarkAllTabsDefault") };
+ dialogArgs.bBookmarkAllTabs = true;
+ }
+
dialogArgs.objGroup = tabsInfo;
openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "",
BROWSER_ADD_BM_FEATURES, dialogArgs);
@@ -3427,7 +3465,7 @@ nsBrowserStatusHandler.prototype =
}
}
UpdateBackForwardButtons();
-
+ UpdateBookmarkAllTabsMenuitem();
if (findField && gFindMode != FIND_NORMAL) {
// Close the Find toolbar if we're in old-style TAF mode
closeFindBar();
diff --git a/browser/components/bookmarks/content/addBookmark2.js b/browser/components/bookmarks/content/addBookmark2.js
index acd1c4cf550c..fc7790eef759 100644
--- a/browser/components/bookmarks/content/addBookmark2.js
+++ b/browser/components/bookmarks/content/addBookmark2.js
@@ -52,36 +52,36 @@
* Apart from the standard openDialog parameters, this dialog can
* be passed additional information, which is contained in the
* wArg object:
- *
- * wArg.name : Bookmark Name. The value to be prefilled
- * into the "Name: " field (if visible).
- * wArg.description : Bookmark description. The value to be added
- * : to the boomarks description field.
- * wArg.url : Bookmark URL: The location of the bookmark.
- * The value to be filled in the "Location: "
- * field (if visible).
- * wArg.folderURI : Bookmark Folder. The RDF Resource URI of the
- * folder that this bookmark should be created in.
- * wArg.charset : Bookmark Charset. The charset that should be
- * used when adding a bookmark to the specified
- * URL. (Usually the charset of the current
- * document when launching this window).
- * wArg.bAddGroup : True if adding a group of tabs, false
- * otherwise.
- * wArg.objGroup[] : If adding a group of tabs, this is an array
- * of wArg objects with name, URL and charset
- * properties, one for each group member.
- * wArg.bWebPanel : If the bookmark should become a web panel.
- * wArg.keyword : A suggested keyword for the bookmark. If this
- * argument is supplied, the keyword row is made
- * visible.
- * wArg.bNeedKeyword : Whether or not a keyword is required to add
- * the bookmark.
- * wArg.postData : PostData to be saved with this bookmark,
- * in the format a string of name=value pairs
- * separated by CRLFs.
- * wArg.feedURL : feed URL for Livemarks (turns bookmark
- * into Livemark)
+ *
+ * wArg.name : Bookmark Name. The value to be prefilled
+ * into the "Name: " field (if visible).
+ * wArg.description : Bookmark description. The value to be added
+ * : to the boomarks description field.
+ * wArg.url : Bookmark URL: The location of the bookmark.
+ * The value to be filled in the "Location: "
+ * field (if visible).
+ * wArg.folderURI : Bookmark Folder. The RDF Resource URI of the
+ * folder that this bookmark should be created in.
+ * wArg.charset : Bookmark Charset. The charset that should be
+ * used when adding a bookmark to the specified
+ * URL. (Usually the charset of the current
+ * document when launching this window).
+ * wArg.bBookmarkAllTabs : True if "Bookmark All Tabs" option is chosen,
+ * false otherwise.
+ * wArg.objGroup[] : If adding a group of tabs, this is an array
+ * of wArg objects with name, URL and charset
+ * properties, one for each group member.
+ * wArg.bWebPanel : If the bookmark should become a web panel.
+ * wArg.keyword : A suggested keyword for the bookmark. If this
+ * argument is supplied, the keyword row is made
+ * visible.
+ * wArg.bNeedKeyword : Whether or not a keyword is required to add
+ * the bookmark.
+ * wArg.postData : PostData to be saved with this bookmark,
+ * in the format a string of name=value pairs
+ * separated by CRLFs.
+ * wArg.feedURL : feed URL for Livemarks (turns bookmark
+ * into Livemark)
*/
var gSelectedFolder;
@@ -91,7 +91,6 @@ var gKeywordRow;
var gExpander;
var gMenulist;
var gBookmarksTree;
-var gGroup;
var gKeywordRequired;
var gSuggestedKeyword;
var gRequiredFields = [];
@@ -110,7 +109,6 @@ function Startup()
gRequiredFields.push(gName);
gKeywordRow = document.getElementById("keywordRow");
gKeyword = document.getElementById("keyword");
- gGroup = document.getElementById("addgroup");
gExpander = document.getElementById("expander");
gMenulist = document.getElementById("select-menu");
gBookmarksTree = document.getElementById("folder-tree");
@@ -127,10 +125,9 @@ function Startup()
if (gKeywordRequired)
gRequiredFields.push(gKeyword);
}
- if (!gArg.bAddGroup)
- gGroup.setAttribute("hidden", "true");
sizeToContent();
onFieldInput();
+ initTitle();
gSelectedFolder = RDF.GetResource(gMenulist.selectedItem.id);
gExpander.setAttribute("tooltiptext", gExpander.getAttribute("tooltiptextdown"));
gPostData = gArg.postData;
@@ -170,6 +167,14 @@ function Startup()
setTimeout(initMenulist, 0);
}
+function initTitle()
+{
+ if(gArg.bBookmarkAllTabs)
+ document.title = document.getElementById("bookmarksBundle").getString("bookmarkAllTabsTitle");
+ else
+ document.title = document.getElementById("bookmarksBundle").getString("bookmarkCurTabTitle");
+}
+
function onFieldInput()
{
var ok = document.documentElement.getButton("accept");
@@ -188,7 +193,7 @@ function onOK()
var url, rSource;
var livemarkFeed = gArg.feedURL;
- if (gGroup && gGroup.checked) {
+ if (gArg.bBookmarkAllTabs) {
rSource = BMDS.createFolder(gName.value);
const groups = gArg.objGroup;
for (var i = 0; i < groups.length; ++i) {
diff --git a/browser/components/bookmarks/content/addBookmark2.xul b/browser/components/bookmarks/content/addBookmark2.xul
index 00c978c48cea..723475b25b18 100644
--- a/browser/components/bookmarks/content/addBookmark2.xul
+++ b/browser/components/bookmarks/content/addBookmark2.xul
@@ -62,7 +62,7 @@
#endif
buttoniconaccept="add"
buttoniconextra2="open"
- title="&newBookmark.title;" title-selectFolder="&selectFolder.label;"
+ title-selectFolder="&selectFolder.label;"
onload="Startup();"
onunload="setFolderTreeHeight();"
persist="screenX screenY width">
@@ -70,7 +70,7 @@
-
+
@@ -116,11 +116,6 @@
tooltiptextdown="&expanderDown.tooltip;"
tooltiptextup="&expanderUp.tooltip;"/>
-
-
-
-
diff --git a/browser/components/migration/content/migration.js b/browser/components/migration/content/migration.js
index a26ea34cbb2e..8c1d295cf47e 100644
--- a/browser/components/migration/content/migration.js
+++ b/browser/components/migration/content/migration.js
@@ -300,6 +300,7 @@ var MigrationWizard = {
items.removeChild(items.firstChild);
var bundle = document.getElementById("bundle");
+ var brandBundle = document.getElementById("brandBundle");
var itemID;
for (var i = 0; i < 16; ++i) {
var itemID = (this._itemsFlags >> i) & 0x1 ? Math.pow(2, i) : 0;
diff --git a/browser/components/migration/content/migration.xul b/browser/components/migration/content/migration.xul
index 3142ae858cb3..6aff95d587d2 100644
--- a/browser/components/migration/content/migration.xul
+++ b/browser/components/migration/content/migration.xul
@@ -52,6 +52,7 @@
+
-
-
diff --git a/browser/locales/en-US/chrome/browser/bookmarks/bookmarks.properties b/browser/locales/en-US/chrome/browser/bookmarks/bookmarks.properties
index 77a7365e5f4e..40ca8ef31bf9 100644
--- a/browser/locales/en-US/chrome/browser/bookmarks/bookmarks.properties
+++ b/browser/locales/en-US/chrome/browser/bookmarks/bookmarks.properties
@@ -176,3 +176,6 @@ addLiveBookmarkTitle=Add Live Bookmark
BookmarksLivemarkLoading=Live Bookmark loading...
BookmarksLivemarkFailed=Live Bookmark feed failed to load.
+
+bookmarkCurTabTitle=Add Bookmark
+bookmarkAllTabsTitle=Bookmark All Tabs
diff --git a/browser/locales/en-US/chrome/browser/browser.dtd b/browser/locales/en-US/chrome/browser/browser.dtd
index b219454330ba..7b2f8b690026 100644
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -61,6 +61,8 @@
+
+
diff --git a/browser/locales/en-US/chrome/browser/browser.properties b/browser/locales/en-US/chrome/browser/browser.properties
index aed9b5832e40..e5af4d6fd73e 100644
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -40,6 +40,15 @@ DefaultSaveFileName=index
WebPageCompleteFilter=Web Page, complete
WebPageHTMLOnlyFilter=Web Page, HTML only
+bookmarkAllTabs_label=Bookmark All Tabs...
+bookmarkAllTabs_accesskey=T
+bookmarkCurTab_label=Bookmark This Tab...
+bookmarkCurTab_accesskey=B
+
+# bookmark dialog strings
+
+bookmarkAllTabsDefault=[Folder Name]
+
# LOCALIZATION NOTE (filesFolder):
# This is the name of the folder that is created parallel to a HTML file
# when it is saved "With Images". The %S section is replaced with the
diff --git a/toolkit/content/widgets/tabbrowser.xml b/toolkit/content/widgets/tabbrowser.xml
index 6b0dc35e524a..30d8b8c44d9a 100644
--- a/toolkit/content/widgets/tabbrowser.xml
+++ b/toolkit/content/widgets/tabbrowser.xml
@@ -68,7 +68,7 @@
ondragdrop="nsDragAndDrop.drop(event, this.parentNode.parentNode); event.stopPropagation();"
ondragexit="nsDragAndDrop.dragExit(event, this.parentNode.parentNode); event.stopPropagation();">
-
+