Bug 1692668 - Update bookmarks context menu for clarity. r=Gijs,fluent-reviewers,flod

Differential Revision: https://phabricator.services.mozilla.com/D106046
This commit is contained in:
Erica Wright 2021-03-02 15:34:56 +00:00
Родитель dc5c1a0789
Коммит 7563ded7df
16 изменённых файлов: 446 добавлений и 97 удалений

Просмотреть файл

@ -1688,7 +1688,7 @@ var BookmarkingUI = {
// Used by the Places context menu in the Bookmarks Toolbar // Used by the Places context menu in the Bookmarks Toolbar
// when nothing is selected // when nothing is selected
menu.setAttribute("selectiontype", "none"); menu.setAttribute("selectiontype", "none|single");
MozXULElement.insertFTLIfNeeded("browser/toolbarContextMenu.ftl"); MozXULElement.insertFTLIfNeeded("browser/toolbarContextMenu.ftl");
let menuItems = [ let menuItems = [

Просмотреть файл

@ -260,6 +260,9 @@ PlacesViewBase.prototype = {
); );
existingOtherBookmarksItem?.remove(); existingOtherBookmarksItem?.remove();
let manageBookmarksMenu = aPopup.querySelector(
"#placesContext_showAllBookmarks"
);
// Add the View menu for the Bookmarks Toolbar and "Show Other Bookmarks" menu item // Add the View menu for the Bookmarks Toolbar and "Show Other Bookmarks" menu item
// if the click originated from the Bookmarks Toolbar. // if the click originated from the Bookmarks Toolbar.
if (gBookmarksToolbar2h2020) { if (gBookmarksToolbar2h2020) {
@ -267,13 +270,16 @@ PlacesViewBase.prototype = {
existingSubmenu?.remove(); existingSubmenu?.remove();
let bookmarksToolbar = document.getElementById("PersonalToolbar"); let bookmarksToolbar = document.getElementById("PersonalToolbar");
if (bookmarksToolbar?.contains(aPopup.triggerNode)) { if (bookmarksToolbar?.contains(aPopup.triggerNode)) {
manageBookmarksMenu.removeAttribute("hidden");
let menu = BookmarkingUI.buildBookmarksToolbarSubmenu(bookmarksToolbar); let menu = BookmarkingUI.buildBookmarksToolbarSubmenu(bookmarksToolbar);
aPopup.appendChild(menu); aPopup.insertBefore(menu, manageBookmarksMenu);
if ( if (
aPopup.triggerNode.id === "OtherBookmarks" || aPopup.triggerNode.id === "OtherBookmarks" ||
aPopup.triggerNode.id === "PlacesChevron" || aPopup.triggerNode.id === "PlacesChevron" ||
aPopup.triggerNode.id === "PlacesToolbarItems" aPopup.triggerNode.id === "PlacesToolbarItems" ||
aPopup.triggerNode.parentNode.id === "PlacesToolbarItems"
) { ) {
let otherBookmarksMenuItem = BookmarkingUI.buildShowOtherBookmarksMenuItem(); let otherBookmarksMenuItem = BookmarkingUI.buildShowOtherBookmarksMenuItem();
@ -284,7 +290,11 @@ PlacesViewBase.prototype = {
); );
} }
} }
} else {
manageBookmarksMenu.setAttribute("hidden", "true");
} }
} else {
manageBookmarksMenu.setAttribute("hidden", "true");
} }
return this.controller.buildContextMenu(aPopup); return this.controller.buildContextMenu(aPopup);

Просмотреть файл

@ -549,6 +549,8 @@ PlacesController.prototype = {
* true if it should be hidden inside the private browsing mode * true if it should be hidden inside the private browsing mode
* 9) The "forcehideintabbrowser" attribute may be set on a menu-item if * 9) The "forcehideintabbrowser" attribute may be set on a menu-item if
* it should be hidden when we're in a tabbed browsing window. * it should be hidden when we're in a tabbed browsing window.
* 10) The "forcehidenotintabbrowser" attribute may be set on a menu-item if
* it should be hidden when we're not in a tabbed browsing window.
* @param aPopup * @param aPopup
* The menupopup to build children into. * The menupopup to build children into.
* @return true if at least one item is visible, false otherwise. * @return true if at least one item is visible, false otherwise.
@ -587,12 +589,16 @@ PlacesController.prototype = {
var hideIfInTabBrowser = var hideIfInTabBrowser =
item.getAttribute("forcehideintabbrowser") == "true" && item.getAttribute("forcehideintabbrowser") == "true" &&
window.top.gBrowser; window.top.gBrowser;
var hideIfNotInTabBrowser =
item.getAttribute("forcehidenotintabbrowser") == "true" &&
!window.top.gBrowser;
var hideIfPrivate = var hideIfPrivate =
item.getAttribute("hideifprivatebrowsing") == "true" && item.getAttribute("hideifprivatebrowsing") == "true" &&
PrivateBrowsingUtils.isWindowPrivate(window); PrivateBrowsingUtils.isWindowPrivate(window);
var shouldHideItem = var shouldHideItem =
hideIfNoIP || hideIfNoIP ||
hideIfInTabBrowser || hideIfInTabBrowser ||
hideIfNotInTabBrowser ||
hideIfPrivate || hideIfPrivate ||
!this._shouldShowMenuItem(item, metadata); !this._shouldShowMenuItem(item, metadata);
item.hidden = item.disabled = shouldHideItem; item.hidden = item.disabled = shouldHideItem;
@ -621,20 +627,32 @@ PlacesController.prototype = {
// New separator, count again: // New separator, count again:
visibleItemsBeforeSep = false; visibleItemsBeforeSep = false;
} }
if (item.id === "placesContext_deleteBookmark") {
document.l10n.setAttributes(item, "places-remove-bookmark", {
count: metadata.length,
});
}
} }
// Set Open Folder/Links In Tabs items enabled state if they're visible // Set Open Folder/Links In Tabs or Open Bookmark item's enabled state if they're visible
if (usableItemCount > 0) { if (usableItemCount > 0) {
var openContainerInTabsItem = document.getElementById( let openContainerInTabsItem = document.getElementById(
"placesContext_openContainer:tabs" "placesContext_openContainer:tabs"
); );
if (!openContainerInTabsItem.hidden) { let openBookmarksItem = document.getElementById(
var containerToUse = this._view.selectedNode || this._view.result.root; "placesContext_openBookmarkContainer:tabs"
if (PlacesUtils.nodeIsContainer(containerToUse)) { );
if (!PlacesUtils.hasChildURIs(containerToUse)) { for (let menuItem of [openContainerInTabsItem, openBookmarksItem]) {
openContainerInTabsItem.disabled = true; if (!menuItem.hidden) {
// Ensure that we don't display the menu if nothing is enabled: var containerToUse =
usableItemCount--; this._view.selectedNode || this._view.result.root;
if (PlacesUtils.nodeIsContainer(containerToUse)) {
if (!PlacesUtils.hasChildURIs(containerToUse)) {
menuItem.disabled = true;
// Ensure that we don't display the menu if nothing is enabled:
usableItemCount--;
}
} }
} }
} }

Просмотреть файл

@ -229,10 +229,12 @@ var PlacesOrganizer = {
} }
} }
// remove the "Properties" context-menu item, we've our own details pane // remove the "Edit" and "Edit Bookmark" context-menu item, we're in our own details pane
document let contextMenu = document.getElementById("placesContext");
.getElementById("placesContext") contextMenu.removeChild(document.getElementById("placesContext_show:info"));
.removeChild(document.getElementById("placesContext_show:info")); contextMenu.removeChild(
document.getElementById("placesContext_show_bookmark:info")
);
if (!Services.policies.isAllowed("profileImport")) { if (!Services.policies.isAllowed("profileImport")) {
document document

Просмотреть файл

@ -177,13 +177,13 @@
<menupopup id="organizeButtonPopup"> <menupopup id="organizeButtonPopup">
<menuitem id="newbookmark" <menuitem id="newbookmark"
command="placesCmd_new:bookmark" command="placesCmd_new:bookmark"
data-l10n-id="places-new-bookmark"/> data-l10n-id="places-add-bookmark"/>
<menuitem id="newfolder" <menuitem id="newfolder"
command="placesCmd_new:folder" command="placesCmd_new:folder"
data-l10n-id="places-new-folder"/> data-l10n-id="places-add-folder"/>
<menuitem id="newseparator" <menuitem id="newseparator"
command="placesCmd_new:separator" command="placesCmd_new:separator"
data-l10n-id="places-new-separator"/> data-l10n-id="places-add-separator"/>
#ifdef XP_MACOSX #ifdef XP_MACOSX
<menuseparator id="orgDeleteSeparator"/> <menuseparator id="orgDeleteSeparator"/>

Просмотреть файл

@ -12,9 +12,16 @@
selectiontype="single" selectiontype="single"
selection="link" selection="link"
forcehideintabbrowser="true"/> forcehideintabbrowser="true"/>
<menuitem id="placesContext_openBookmarkContainer:tabs"
oncommand="PlacesUIUtils.openSelectionInTabs(event);"
onclick="checkForMiddleClick(this, event);"
data-l10n-id="places-open-all-bookmarks"
selectiontype="single|none|multiple"
selection="folder"
forcehidenotintabbrowser="true"/>
<menuitem id="placesContext_open:newtab" <menuitem id="placesContext_open:newtab"
command="placesCmd_open:tab" command="placesCmd_open:tab"
data-l10n-id="places-open-tab" data-l10n-id="places-open-in-tab"
selectiontype="single" selectiontype="single"
selection="link"/> selection="link"/>
<menuitem id="placesContext_openContainer:tabs" <menuitem id="placesContext_openContainer:tabs"
@ -22,69 +29,48 @@
onclick="checkForMiddleClick(this, event);" onclick="checkForMiddleClick(this, event);"
data-l10n-id="places-open-all-in-tabs" data-l10n-id="places-open-all-in-tabs"
selectiontype="single|none" selectiontype="single|none"
selection="folder|host|query"/> selection="folder|host|query"
forcehideselection="bookmark"
forcehideintabbrowser="true"/>
<menuitem id="placesContext_openLinks:tabs" <menuitem id="placesContext_openLinks:tabs"
oncommand="PlacesUIUtils.openSelectionInTabs(event);" oncommand="PlacesUIUtils.openSelectionInTabs(event);"
onclick="checkForMiddleClick(this, event);" onclick="checkForMiddleClick(this, event);"
data-l10n-id="places-open-all-in-tabs" data-l10n-id="places-open-all-in-tabs"
selectiontype="multiple" selectiontype="multiple"
selection="link"/> selection="link"
forcehideintabbrowser="true"/>
<menuitem id="placesContext_open:newwindow" <menuitem id="placesContext_open:newwindow"
command="placesCmd_open:window" command="placesCmd_open:window"
data-l10n-id="places-open-window" data-l10n-id="places-open-in-window"
selectiontype="single" selectiontype="single"
selection="link"/> selection="link"/>
<menuitem id="placesContext_open:newprivatewindow" <menuitem id="placesContext_open:newprivatewindow"
command="placesCmd_open:privatewindow" command="placesCmd_open:privatewindow"
data-l10n-id="places-open-private-window" data-l10n-id="places-open-in-private-window"
selectiontype="single" selectiontype="single"
selection="link" selection="link"
hideifprivatebrowsing="true"/> hideifprivatebrowsing="true"/>
<menuseparator id="placesContext_openSeparator"/> <menuseparator id="placesContext_openSeparator"/>
<menuitem id="placesContext_new:bookmark" <menuitem id="placesContext_show_bookmark:info"
command="placesCmd_new:bookmark" command="placesCmd_show:info"
data-l10n-id="places-new-bookmark" data-l10n-id="places-edit-bookmark"
selectiontype="any" selection="bookmark"/>
hideifnoinsertionpoint="true"/> <menuitem id="placesContext_show:info"
<menuitem id="placesContext_new:folder" command="placesCmd_show:info"
command="placesCmd_new:folder" data-l10n-id="places-edit-generic"
data-l10n-id="places-new-folder-contextmenu" selection="folder|query"/>
selectiontype="any" <menuitem id="placesContext_deleteBookmark"
hideifnoinsertionpoint="true"/> data-l10n-id="places-remove-bookmark"
<menuitem id="placesContext_new:separator" data-l10n-args='{"count":"1"}'
command="placesCmd_new:separator" command="placesCmd_delete"
data-l10n-id="places-new-separator"
closemenu="single" closemenu="single"
selectiontype="any" selection="bookmark"/>
hideifnoinsertionpoint="true"/>
<menuseparator id="placesContext_newSeparator"/>
<menuitem id="placesContext_createBookmark"
command="placesCmd_createBookmark"
selection="link"
forcehideselection="bookmark|tagChild"/>
<menuitem id="placesContext_cut"
command="placesCmd_cut"
data-l10n-id="text-action-cut"
closemenu="single"
selection="bookmark|folder|separator|query"
forcehideselection="tagChild"/>
<menuitem id="placesContext_copy"
command="placesCmd_copy"
data-l10n-id="text-action-copy"
closemenu="single"
selection="any"/>
<menuitem id="placesContext_paste"
data-l10n-id="text-action-paste"
command="placesCmd_paste"
closemenu="single"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuseparator id="placesContext_editSeparator"/>
<menuitem id="placesContext_delete" <menuitem id="placesContext_delete"
data-l10n-id="text-action-delete" data-l10n-id="text-action-delete"
command="placesCmd_delete" command="placesCmd_delete"
closemenu="single" closemenu="single"
selection="bookmark|tagChild|folder|query|dynamiccontainer|separator|host"/> selection="tagChild|folder|query|dynamiccontainer|separator|host"
forcehideselection="bookmark"/>
<menuitem id="placesContext_delete_history" <menuitem id="placesContext_delete_history"
command="placesCmd_delete" command="placesCmd_delete"
closemenu="single" closemenu="single"
@ -98,14 +84,62 @@
selectiontype="single" selectiontype="single"
forcehideselection="bookmark"/> forcehideselection="bookmark"/>
<menuseparator id="placesContext_deleteSeparator"/> <menuseparator id="placesContext_deleteSeparator"/>
<menuitem id="placesContext_cut"
command="placesCmd_cut"
data-l10n-id="text-action-cut"
closemenu="single"
selection="bookmark|folder|separator|query"
forcehideselection="tagChild"/>
<menuitem id="placesContext_copy"
command="placesCmd_copy"
data-l10n-id="text-action-copy"
closemenu="single"
selection="any"/>
<menuitem id="placesContext_paste_group"
data-l10n-id="text-action-paste"
command="placesCmd_paste"
closemenu="single"
selection="any"
hideifnoinsertionpoint="true"/>
<menuseparator id="placesContext_editSeparator"/>
<menuitem id="placesContext_new:bookmark"
command="placesCmd_new:bookmark"
data-l10n-id="places-add-bookmark"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuitem id="placesContext_new:folder"
command="placesCmd_new:folder"
data-l10n-id="places-add-folder-contextmenu"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuitem id="placesContext_new:separator"
command="placesCmd_new:separator"
data-l10n-id="places-add-separator"
closemenu="single"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuseparator id="placesContext_newSeparator"/>
<menuitem id="placesContext_paste"
data-l10n-id="text-action-paste"
command="placesCmd_paste"
closemenu="single"
selectiontype="none"
hideifnoinsertionpoint="true"/>
<menuseparator id="placesContext_pasteSeparator"/>
<menuitem id="placesContext_createBookmark"
command="placesCmd_createBookmark"
selection="link"
forcehideselection="bookmark|tagChild"/>
<menuitem id="placesContext_sortBy:name" <menuitem id="placesContext_sortBy:name"
command="placesCmd_sortBy:name" command="placesCmd_sortBy:name"
data-l10n-id="places-sortby-name" data-l10n-id="places-sortby-name"
closemenu="single" closemenu="single"
selection="folder"/> selection="folder"/>
<menuseparator id="placesContext_sortSeparator"/> <menuseparator id="placesContext_sortSeparator"/>
<menuitem id="placesContext_show:info" <menuitem id="placesContext_showAllBookmarks"
command="placesCmd_show:info" data-l10n-id="places-manage-bookmarks"
data-l10n-id="places-properties" command="Browser:ShowAllBookmarks"
selection="bookmark|folder|query"/> ignoreitem="true"
hidden="true"/>
</menupopup> </menupopup>

Просмотреть файл

@ -16,6 +16,7 @@ skip-if = (verify && debug)
[browser_autoshow_bookmarks_toolbar.js] [browser_autoshow_bookmarks_toolbar.js]
[browser_bookmark_add_tags.js] [browser_bookmark_add_tags.js]
[browser_bookmark_backup_export_import.js] [browser_bookmark_backup_export_import.js]
[browser_bookmark_context_menu_contents.js]
[browser_bookmark_change_location.js] [browser_bookmark_change_location.js]
[browser_bookmark_folder_moveability.js] [browser_bookmark_folder_moveability.js]
[browser_bookmark_menu_ctrl_click.js] [browser_bookmark_menu_ctrl_click.js]

Просмотреть файл

@ -52,9 +52,13 @@ add_task(async function test_change_location_from_Toolbar() {
button: 2, button: 2,
type: "contextmenu", type: "contextmenu",
}); });
console.log("JKJKJKJKJKafterBEFORE");
await promisePopup; await promisePopup;
console.log("JKJKJKJKJKafter");
let properties = document.getElementById("placesContext_show:info"); let properties = document.getElementById(
"placesContext_show_bookmark:info"
);
EventUtils.synthesizeMouseAtCenter(properties, {}); EventUtils.synthesizeMouseAtCenter(properties, {});
}, },
async function test(dialogWin) { async function test(dialogWin) {

Просмотреть файл

@ -0,0 +1,249 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/**
* Test removing bookmarks from the Bookmarks Toolbar and Library.
*/
const BOOKMARKS_H2_2020_PREF = "browser.toolbars.bookmarks.2h2020";
const bookmarksInfo = [
{
title: "firefox",
url: "http://example.com",
},
{
title: "rules",
url: "http://example.com/2",
},
{
title: "yo",
url: "http://example.com/2",
},
];
const TEST_URL = "about:mozilla";
add_task(async function setup() {
await PlacesUtils.bookmarks.eraseEverything();
let toolbar = document.getElementById("PersonalToolbar");
let wasCollapsed = toolbar.collapsed;
// Uncollapse the personal toolbar if needed.
if (wasCollapsed) {
await promiseSetToolbarVisibility(toolbar, true);
}
registerCleanupFunction(async () => {
// Collapse the personal toolbar if needed.
if (wasCollapsed) {
await promiseSetToolbarVisibility(toolbar, false);
}
await PlacesUtils.bookmarks.eraseEverything();
});
});
let OptionItemExists = elementId => {
let optionItem = document.getElementById(elementId);
Assert.ok(optionItem, "Context menu contains the appropriate option");
Assert.ok(
BrowserTestUtils.is_visible(optionItem),
"Context menu option is visible"
);
};
let OptionsMatchExpected = (contextMenu, expectedOptionItems) => {
let idList = [];
for (let elem of contextMenu.children) {
if (
BrowserTestUtils.is_visible(elem) &&
elem.localName !== "menuseparator"
) {
idList.push(elem.id);
}
}
Assert.deepEqual(
idList.sort(),
expectedOptionItems.sort(),
"Content is the same across both lists"
);
};
let checkContextMenu = async (cbfunc, optionItems) => {
await SpecialPowers.pushPrefEnv({
set: [[BOOKMARKS_H2_2020_PREF, true]],
});
await PlacesUtils.bookmarks.insert({
parentGuid: PlacesUtils.bookmarks.toolbarGuid,
title: "Second Bookmark Title",
url: TEST_URL,
});
await PlacesUtils.bookmarks.insertTree({
guid: PlacesUtils.bookmarks.unfiledGuid,
children: bookmarksInfo,
});
let contextMenu = await cbfunc();
for (let item of optionItems) {
OptionItemExists(item);
}
OptionsMatchExpected(contextMenu, optionItems);
contextMenu.hidePopup();
await PlacesUtils.bookmarks.eraseEverything();
};
add_task(async function test_bookmark_contextmenu_contents() {
let optionItems = [
"placesContext_open:newtab",
"placesContext_open:newwindow",
"placesContext_open:newprivatewindow",
"placesContext_show_bookmark:info",
"placesContext_deleteBookmark",
"placesContext_cut",
"placesContext_copy",
"placesContext_paste_group",
"placesContext_new:bookmark",
"placesContext_new:folder",
"placesContext_new:separator",
"placesContext_showAllBookmarks",
"toggle_PersonalToolbar",
"show-other-bookmarks_PersonalToolbar",
];
await checkContextMenu(async function() {
let toolbarBookmark = await PlacesUtils.bookmarks.insert({
parentGuid: PlacesUtils.bookmarks.toolbarGuid,
title: "Bookmark Title",
url: TEST_URL,
});
let toolbarNode = getToolbarNodeForItemGuid(toolbarBookmark.guid);
let contextMenu = document.getElementById("placesContext");
let popupShownPromise = BrowserTestUtils.waitForEvent(
contextMenu,
"popupshown"
);
EventUtils.synthesizeMouseAtCenter(toolbarNode, {
button: 2,
type: "contextmenu",
});
await popupShownPromise;
return contextMenu;
}, optionItems);
});
add_task(async function test_empty_contextmenu_contents() {
let optionItems = [
"placesContext_openBookmarkContainer:tabs",
"placesContext_new:bookmark",
"placesContext_new:folder",
"placesContext_new:separator",
"placesContext_paste",
"placesContext_showAllBookmarks",
"toggle_PersonalToolbar",
"show-other-bookmarks_PersonalToolbar",
];
await checkContextMenu(async function() {
let contextMenu = document.getElementById("placesContext");
let toolbar = document.querySelector("#PlacesToolbarItems");
let openToolbarContextMenuPromise = BrowserTestUtils.waitForPopupEvent(
contextMenu,
"shown"
);
// Use the end of the toolbar because the beginning (and even middle, on
// some resolutions) might be occluded by the empty toolbar message, which
// has a different context menu.
let bounds = toolbar.getBoundingClientRect();
EventUtils.synthesizeMouse(toolbar, bounds.width - 5, 5, {
type: "contextmenu",
});
await openToolbarContextMenuPromise;
return contextMenu;
}, optionItems);
});
add_task(async function test_separator_contextmenu_contents() {
let optionItems = [
"placesContext_delete",
"placesContext_cut",
"placesContext_copy",
"placesContext_paste_group",
"placesContext_new:bookmark",
"placesContext_new:folder",
"placesContext_new:separator",
"placesContext_showAllBookmarks",
"toggle_PersonalToolbar",
"show-other-bookmarks_PersonalToolbar",
];
await checkContextMenu(async function() {
let sep = await PlacesUtils.bookmarks.insert({
type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
parentGuid: PlacesUtils.bookmarks.toolbarGuid,
});
let toolbarNode = getToolbarNodeForItemGuid(sep.guid);
let contextMenu = document.getElementById("placesContext");
let popupShownPromise = BrowserTestUtils.waitForEvent(
contextMenu,
"popupshown"
);
EventUtils.synthesizeMouseAtCenter(toolbarNode, {
button: 2,
type: "contextmenu",
});
await popupShownPromise;
return contextMenu;
}, optionItems);
});
add_task(async function test_folder_contextmenu_contents() {
let optionItems = [
"placesContext_openBookmarkContainer:tabs",
"placesContext_show:info",
"placesContext_delete",
"placesContext_cut",
"placesContext_copy",
"placesContext_paste_group",
"placesContext_new:bookmark",
"placesContext_new:folder",
"placesContext_new:separator",
"placesContext_sortBy:name",
"placesContext_showAllBookmarks",
"toggle_PersonalToolbar",
"show-other-bookmarks_PersonalToolbar",
];
await checkContextMenu(async function() {
let folder = await PlacesUtils.bookmarks.insert({
type: PlacesUtils.bookmarks.TYPE_FOLDER,
parentGuid: PlacesUtils.bookmarks.toolbarGuid,
});
let toolbarNode = getToolbarNodeForItemGuid(folder.guid);
let contextMenu = document.getElementById("placesContext");
let popupShownPromise = BrowserTestUtils.waitForEvent(
contextMenu,
"popupshown"
);
EventUtils.synthesizeMouseAtCenter(toolbarNode, {
button: 2,
type: "contextmenu",
});
await popupShownPromise;
return contextMenu;
}, optionItems);
});

Просмотреть файл

@ -107,7 +107,9 @@ add_task(async function test_remove_tags_from_Toolbar() {
}); });
await promisePopup; await promisePopup;
let properties = document.getElementById("placesContext_show:info"); let properties = document.getElementById(
"placesContext_show_bookmark:info"
);
EventUtils.synthesizeMouseAtCenter(properties, {}); EventUtils.synthesizeMouseAtCenter(properties, {});
}, },
async function test(dialogWin) { async function test(dialogWin) {

Просмотреть файл

@ -116,7 +116,9 @@ add_task(async function test_change_title_from_Toolbar() {
}); });
await promisePopup; await promisePopup;
let properties = document.getElementById("placesContext_show:info"); let properties = document.getElementById(
"placesContext_show_bookmark:info"
);
EventUtils.synthesizeMouseAtCenter(properties, {}); EventUtils.synthesizeMouseAtCenter(properties, {});
}, },
async function test(dialogWin) { async function test(dialogWin) {

Просмотреть файл

@ -37,7 +37,7 @@ add_task(async function testPopup() {
); );
ok(!bookmarksToolbar.collapsed, "Bookmarks toolbar should be visible"); ok(!bookmarksToolbar.collapsed, "Bookmarks toolbar should be visible");
// 1. Right-click on a bookmark and check that the submenu is not visible // 1. Right-click on a bookmark and check that the submenu is visible
let bookmarkItem = bookmarksToolbar.querySelector( let bookmarkItem = bookmarksToolbar.querySelector(
`.bookmark-item[label="firefox"]` `.bookmark-item[label="firefox"]`
); );
@ -45,8 +45,8 @@ add_task(async function testPopup() {
let contextMenu = document.getElementById("placesContext"); let contextMenu = document.getElementById("placesContext");
let popup = await openContextMenu(contextMenu, bookmarkItem); let popup = await openContextMenu(contextMenu, bookmarkItem);
ok( ok(
popup.target.querySelector("#toggle_PersonalToolbar").hidden, !popup.target.querySelector("#toggle_PersonalToolbar").hidden,
"Bookmarks toolbar submenu should not appear on a .bookmark-item" "Bookmarks toolbar submenu should appear on a .bookmark-item"
); );
contextMenu.hidePopup(); contextMenu.hidePopup();

Просмотреть файл

@ -63,7 +63,9 @@ add_task(async function test_panelview_bookmarks_delete() {
}); });
observer.observe(list, { childList: true }); observer.observe(list, { childList: true });
}); });
let placesContextDelete = document.getElementById("placesContext_delete"); let placesContextDelete = document.getElementById(
"placesContext_deleteBookmark"
);
EventUtils.synthesizeMouseAtCenter(placesContextDelete, {}); EventUtils.synthesizeMouseAtCenter(placesContextDelete, {});
await promise; await promise;

Просмотреть файл

@ -51,7 +51,9 @@ add_task(async function test_remove_bookmark_from_toolbar() {
}); });
await popupShownPromise; await popupShownPromise;
let contextMenuDeleteItem = document.getElementById("placesContext_delete"); let contextMenuDeleteBookmark = document.getElementById(
"placesContext_deleteBookmark"
);
let removePromise = PlacesTestUtils.waitForNotification( let removePromise = PlacesTestUtils.waitForNotification(
"bookmark-removed", "bookmark-removed",
@ -59,7 +61,7 @@ add_task(async function test_remove_bookmark_from_toolbar() {
"places" "places"
); );
EventUtils.synthesizeMouseAtCenter(contextMenuDeleteItem, {}); EventUtils.synthesizeMouseAtCenter(contextMenuDeleteBookmark, {});
await removePromise; await removePromise;
@ -106,8 +108,8 @@ add_task(async function test_remove_bookmark_from_library() {
); );
let contextMenu = library.document.getElementById("placesContext"); let contextMenu = library.document.getElementById("placesContext");
let contextMenuDeleteItem = library.document.getElementById( let contextMenuDeleteBookmark = library.document.getElementById(
"placesContext_delete" "placesContext_deleteBookmark"
); );
let popupShownPromise = BrowserTestUtils.waitForEvent( let popupShownPromise = BrowserTestUtils.waitForEvent(
@ -143,7 +145,7 @@ add_task(async function test_remove_bookmark_from_library() {
events => events.some(event => event.url == uris[0]), events => events.some(event => event.url == uris[0]),
"places" "places"
); );
EventUtils.synthesizeMouseAtCenter(contextMenuDeleteItem, {}, library); EventUtils.synthesizeMouseAtCenter(contextMenuDeleteBookmark, {}, library);
await removePromise; await removePromise;

Просмотреть файл

@ -218,8 +218,10 @@ add_task(async function testDeletingMenuItems() {
await popupEventPromise; await popupEventPromise;
info("Delete bookmark menu item from popup."); info("Delete bookmark menu item from popup.");
let deleteMenuItem = document.getElementById("placesContext_delete"); let deleteMenuBookmark = document.getElementById(
EventUtils.synthesizeMouseAtCenter(deleteMenuItem, {}); "placesContext_deleteBookmark"
);
EventUtils.synthesizeMouseAtCenter(deleteMenuBookmark, {});
await TestUtils.waitForCondition(() => { await TestUtils.waitForCondition(() => {
let popup = document.querySelector("#OtherBookmarksPopup"); let popup = document.querySelector("#OtherBookmarksPopup");

Просмотреть файл

@ -5,30 +5,33 @@
places-open = places-open =
.label = Open .label = Open
.accesskey = O .accesskey = O
places-open-tab = places-open-in-tab =
.label = Open in a New Tab .label = Open in New Tab
.accesskey = w .accesskey = w
places-open-all-bookmarks =
.label = Open All Bookmarks
.accesskey = O
places-open-all-in-tabs = places-open-all-in-tabs =
.label = Open All in Tabs .label = Open All in Tabs
.accesskey = O .accesskey = O
places-open-window = places-open-in-window =
.label = Open in a New Window .label = Open in New Window
.accesskey = N .accesskey = N
places-open-private-window = places-open-in-private-window =
.label = Open in a New Private Window .label = Open in New Private Window
.accesskey = P .accesskey = P
places-new-bookmark = places-add-bookmark =
.label = New Bookmark… .label = Add Bookmark…
.accesskey = B .accesskey = B
places-new-folder-contextmenu = places-add-folder-contextmenu =
.label = New Folder… .label = Add Folder…
.accesskey = F .accesskey = F
places-new-folder = places-add-folder =
.label = New Folder… .label = Add Folder…
.accesskey = o .accesskey = o
places-new-separator = places-add-separator =
.label = New Separator .label = Add Separator
.accesskey = S .accesskey = S
places-view = places-view =
@ -61,8 +64,12 @@ places-delete-domain-data =
places-sortby-name = places-sortby-name =
.label = Sort By Name .label = Sort By Name
.accesskey = r .accesskey = r
places-properties = # places-edit-bookmark and places-edit-generic will show one or the other and can have the same access key.
.label = Properties places-edit-bookmark =
.label = Edit Bookmark…
.accesskey = i
places-edit-generic =
.label = Edit…
.accesskey = i .accesskey = i
# Managed bookmarks are created by an administrator and cannot be changed by the user. # Managed bookmarks are created by an administrator and cannot be changed by the user.
@ -75,3 +82,17 @@ managed-bookmarks-subfolder =
# This label is used for the "Other Bookmarks" folder that appears in the bookmarks toolbar. # This label is used for the "Other Bookmarks" folder that appears in the bookmarks toolbar.
other-bookmarks-folder = other-bookmarks-folder =
.label = Other Bookmarks .label = Other Bookmarks
# Variables:
# $count (number) - The number of elements being selected for removal.
places-remove-bookmark =
.label =
{ $count ->
[1] Remove Bookmark
*[other] Remove Bookmarks
}
.accesskey = e
places-manage-bookmarks =
.label = Manage Bookmarks
.accesskey = M