Bug 1401238 - remove pocket entries in bookmarks menu button panel and bookmarks menu, r=jaws

MozReview-Commit-ID: HPxVus6oXjS

--HG--
extra : rebase_source : 95c8ef96e42fe2001f45f5b53549662e55e320c2
This commit is contained in:
Gijs Kruitbosch 2017-09-20 01:00:25 +01:00
Родитель 40de26eb54
Коммит 5520fd7eb2
3 изменённых файлов: 9 добавлений и 55 удалений

46
browser/extensions/pocket/bootstrap.js поставляемый
Просмотреть файл

@ -372,9 +372,8 @@ var PocketOverlay = {
PocketPageAction.shutdown();
for (let window of browserWindows()) {
for (let id of ["panelMenu_pocket", "menu_pocket", "BMB_pocket",
"panelMenu_pocketSeparator", "menu_pocketSeparator",
"BMB_pocketSeparator", "appMenu-library-pocket-button"]) {
for (let id of ["panelMenu_pocket", "panelMenu_pocketSeparator",
"appMenu-library-pocket-button"]) {
let element = window.document.getElementById(id) ||
window.gNavToolbox.palette.querySelector("#" + id);
if (element)
@ -413,47 +412,8 @@ var PocketOverlay = {
let document = window.document;
let hidden = !isPocketEnabled();
// add to bookmarksMenu
let sib = document.getElementById("menu_bookmarkThisPage");
if (sib && !document.getElementById("menu_pocket")) {
let menu = createElementWithAttrs(document, "menuitem", {
"id": "menu_pocket",
"label": gPocketBundle.GetStringFromName("pocketMenuitem.label"),
"class": "menuitem-iconic", // OSX only
"oncommand": "Pocket.openList(event)",
"hidden": hidden
});
let sep = createElementWithAttrs(document, "menuseparator", {
"id": "menu_pocketSeparator",
"hidden": hidden
});
sib.parentNode.insertBefore(menu, sib);
sib.parentNode.insertBefore(sep, sib);
}
// add to bookmarks-menu-button
sib = document.getElementById("BMB_bookmarksToolbar");
if (!sib) {
sib = window.gNavToolbox.palette.querySelector("#BMB_bookmarksToolbar");
}
if (sib && !sib.parentNode.querySelector("#BMB_pocket")) {
let menu = createElementWithAttrs(document, "menuitem", {
"id": "BMB_pocket",
"label": gPocketBundle.GetStringFromName("pocketMenuitem.label"),
"class": "menuitem-iconic bookmark-item subviewbutton",
"oncommand": "Pocket.openList(event)",
"hidden": hidden
});
let sep = createElementWithAttrs(document, "menuseparator", {
"id": "BMB_pocketSeparator",
"hidden": hidden
});
sib.parentNode.insertBefore(menu, sib);
sib.parentNode.insertBefore(sep, sib);
}
// add to PanelUI-bookmarks
sib = document.getElementById("panelMenuBookmarkThisPage");
let sib = document.getElementById("panelMenuBookmarkThisPage");
if (sib && !document.getElementById("panelMenu_pocket")) {
let menu = createElementWithAttrs(document, "toolbarbutton", {
"id": "panelMenu_pocket",

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

@ -207,16 +207,12 @@
list-style-image: url("chrome://pocket-shared/skin/pocket.svg");
}
#panelMenu_pocket,
#menu_pocket,
#BMB_pocket {
#panelMenu_pocket {
list-style-image: url("chrome://pocket/content/panels/img/pocketmenuitem16.png");
}
@media (min-resolution: 2dppx) {
#panelMenu_pocket,
#menu_pocket,
#BMB_pocket {
#panelMenu_pocket {
list-style-image: url("chrome://pocket/content/panels/img/pocketmenuitem16@2x.png");
}

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

@ -28,9 +28,8 @@ add_task(async function() {
await promisePocketEnabled();
checkWindowProperties(true, ["Pocket", "pktUI", "pktUIMessaging"]);
checkElements(true, ["pocket-button", "panelMenu_pocket", "menu_pocket", "BMB_pocket",
"panelMenu_pocketSeparator", "menu_pocketSeparator",
"BMB_pocketSeparator"]);
checkElements(true, ["pocket-button", "panelMenu_pocket",
"panelMenu_pocketSeparator"]);
// check context menu exists
info("checking content context menu");
@ -54,9 +53,8 @@ add_task(async function() {
await promisePocketDisabled();
checkWindowProperties(false, ["Pocket", "pktUI", "pktUIMessaging"]);
checkElements(false, ["pocket-button", "panelMenu_pocket", "menu_pocket", "BMB_pocket",
"panelMenu_pocketSeparator", "menu_pocketSeparator",
"BMB_pocketSeparator", "context-pocket", "context-savelinktopocket"]);
checkElements(false, ["pocket-button", "panelMenu_pocket", "panelMenu_pocketSeparator",
"context-pocket", "context-savelinktopocket"]);
await promisePocketReset();
});