зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1155519 - Add "View Pocket Items" menuitem to the bookmarks menu, r=dolske.
This commit is contained in:
Родитель
640bf32e81
Коммит
8cf9407c0e
|
@ -387,6 +387,7 @@
|
|||
oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);"
|
||||
onclick="BookmarksEventHandler.onClick(event, this.parentNode._placesView);"
|
||||
onpopupshowing="BookmarkingUI.onMainMenuPopupShowing(event);
|
||||
BookmarkingUI.updatePocketItemVisibility('menu_');
|
||||
if (!this.parentNode._placesView)
|
||||
new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');"
|
||||
tooltip="bhTooltip" popupsinherittooltip="true">
|
||||
|
@ -460,6 +461,9 @@
|
|||
</menupopup>
|
||||
</menu>
|
||||
#endif
|
||||
<menuseparator id="menu_pocketSeparator"/>
|
||||
<menuitem id="menu_pocket" label="&pocketMenuitem.label;"
|
||||
oncommand="openUILink(Pocket.listURL, event);"/>
|
||||
<menuseparator id="bookmarksMenuItemsSeparator"/>
|
||||
<!-- Bookmarks menu items -->
|
||||
<menuseparator builder="end"
|
||||
|
|
|
@ -1565,6 +1565,12 @@ let BookmarkingUI = {
|
|||
PlacesCommandHook.updateBookmarkAllTabsCommand();
|
||||
},
|
||||
|
||||
updatePocketItemVisibility: function BUI_updatePocketItemVisibility(prefix) {
|
||||
let hidden = !CustomizableUI.getPlacementOfWidget("pocket-button");
|
||||
document.getElementById(prefix + "pocket").hidden = hidden;
|
||||
document.getElementById(prefix + "pocketSeparator").hidden = hidden;
|
||||
},
|
||||
|
||||
_showBookmarkedNotification: function BUI_showBookmarkedNotification() {
|
||||
function getCenteringTransformForRects(rectToPosition, referenceRect) {
|
||||
let topDiff = referenceRect.top - rectToPosition.top;
|
||||
|
@ -1682,6 +1688,7 @@ let BookmarkingUI = {
|
|||
|
||||
onPanelMenuViewShowing: function BUI_onViewShowing(aEvent) {
|
||||
this._updateBookmarkPageMenuItem();
|
||||
this.updatePocketItemVisibility("panelMenu_");
|
||||
// Update checked status of the toolbar toggle.
|
||||
let viewToolbar = document.getElementById("panelMenu_viewBookmarksToolbar");
|
||||
let personalToolbar = document.getElementById("PersonalToolbar");
|
||||
|
|
|
@ -7,3 +7,4 @@
|
|||
|
||||
<!ENTITY saveToPocketCmd.label "Save Page to Pocket">
|
||||
<!ENTITY saveToPocketCmd.accesskey "k">
|
||||
<!ENTITY pocketMenuitem.label "View Pocket List">
|
||||
|
|
|
@ -883,6 +883,7 @@
|
|||
oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);"
|
||||
onclick="BookmarksEventHandler.onClick(event, this.parentNode._placesView);"
|
||||
onpopupshowing="BookmarkingUI.onPopupShowing(event);
|
||||
BookmarkingUI.updatePocketItemVisibility('BMB_');
|
||||
BookmarkingUI.attachPlacesView(event, this);"
|
||||
tooltip="bhTooltip" popupsinherittooltip="true">
|
||||
<menuitem id="BMB_viewBookmarksSidebar"
|
||||
|
@ -970,6 +971,11 @@
|
|||
label="&readingList.showSidebar.label;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuseparator id="BMB_pocketSeparator"/>
|
||||
<menuitem id="BMB_pocket"
|
||||
class="menuitem-iconic bookmark-item subviewbutton"
|
||||
label="&pocketMenuitem.label;"
|
||||
oncommand="openUILink(Pocket.listURL, event);"/>
|
||||
<menuseparator/>
|
||||
<!-- Bookmarks menu items will go here -->
|
||||
<menuitem id="BMB_bookmarksShowAll"
|
||||
|
|
|
@ -137,6 +137,10 @@
|
|||
<observes element="readingListSidebar" attribute="checked"/>
|
||||
<observes element="readingListSidebar" attribute="hidden"/>
|
||||
</toolbarbutton>
|
||||
<toolbarseparator id="panelMenu_pocketSeparator"/>
|
||||
<toolbarbutton id="panelMenu_pocket" label="&pocketMenuitem.label;"
|
||||
class="subviewbutton cui-withicon"
|
||||
oncommand="openUILink(Pocket.listURL, event);"/>
|
||||
<toolbarseparator class="small-separator"/>
|
||||
<toolbaritem id="panelMenu_bookmarksMenu"
|
||||
orient="vertical"
|
||||
|
|
|
@ -29,6 +29,8 @@ let Pocket = {
|
|||
|
||||
get hostname() Services.prefs.getCharPref("browser.pocket.hostname"),
|
||||
|
||||
get listURL() { return "https://" + Pocket.hostname; },
|
||||
|
||||
get _accessToken() {
|
||||
let sessionId, accessToken;
|
||||
let cookies = Services.cookies.getCookiesFromHost(this.hostname);
|
||||
|
|
|
@ -16,6 +16,8 @@ browser.jar:
|
|||
content/browser/pocket/panels/img/pocketlogo@2x.png (panels/img/pocketlogo@2x.png)
|
||||
content/browser/pocket/panels/img/pocketlogosolo@1x.png (panels/img/pocketlogosolo@1x.png)
|
||||
content/browser/pocket/panels/img/pocketlogosolo@2x.png (panels/img/pocketlogosolo@2x.png)
|
||||
content/browser/pocket/panels/img/pocketmenuitem16.png (panels/img/pocketmenuitem16.png)
|
||||
content/browser/pocket/panels/img/pocketmenuitem16@2x.png (panels/img/pocketmenuitem16@2x.png)
|
||||
content/browser/pocket/panels/img/pocketmultidevices@1x.png (panels/img/pocketmultidevices@1x.png)
|
||||
content/browser/pocket/panels/img/pocketmultidevices@2x.png (panels/img/pocketmultidevices@2x.png)
|
||||
content/browser/pocket/panels/img/signup_firefoxlogo@1x.png (panels/img/signup_firefoxlogo@1x.png)
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 278 B |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 422 B |
|
@ -523,6 +523,12 @@ menuitem:not([type]):not(.menuitem-tooltip):not(.menuitem-iconic-tooltip) {
|
|||
list-style-image: url("chrome://browser/skin/readinglist/readinglist-icon.svg");
|
||||
}
|
||||
|
||||
#panelMenu_pocket,
|
||||
#menu_pocket,
|
||||
#BMB_pocket {
|
||||
list-style-image: url("chrome://browser/content/pocket/panels/img/pocketmenuitem16.png");
|
||||
}
|
||||
|
||||
#menu_openDownloads {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
|
||||
-moz-image-region: rect(0px 16px 16px 0px);
|
||||
|
|
|
@ -568,6 +568,24 @@ toolbarpaletteitem[place="palette"] > #personal-bookmarks > #bookmarks-toolbar-p
|
|||
list-style-image: url("chrome://browser/skin/readinglist/readinglist-icon.svg");
|
||||
}
|
||||
|
||||
#panelMenu_pocket,
|
||||
#menu_pocket,
|
||||
#BMB_pocket {
|
||||
list-style-image: url("chrome://browser/content/pocket/panels/img/pocketmenuitem16.png");
|
||||
}
|
||||
|
||||
@media (min-resolution: 2dppx) {
|
||||
#panelMenu_pocket,
|
||||
#menu_pocket,
|
||||
#BMB_pocket {
|
||||
list-style-image: url("chrome://browser/content/pocket/panels/img/pocketmenuitem16@2x.png");
|
||||
}
|
||||
|
||||
#panelMenu_pocket > .toolbarbutton-icon {
|
||||
width: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----- PRIMARY TOOLBAR BUTTONS ----- */
|
||||
|
||||
toolbar .toolbarbutton-1:not([type="menu-button"]),
|
||||
|
|
|
@ -2297,6 +2297,12 @@ notification[value="loop-sharing-notification"] .messageImage {
|
|||
-moz-image-region: auto;
|
||||
}
|
||||
|
||||
#panelMenu_pocket,
|
||||
#menu_pocket,
|
||||
#BMB_pocket {
|
||||
list-style-image: url("chrome://browser/content/pocket/panels/img/pocketmenuitem16.png");
|
||||
}
|
||||
|
||||
/* ::::: Keyboard UI Panel ::::: */
|
||||
|
||||
.KUI-panel {
|
||||
|
|
Загрузка…
Ссылка в новой задаче