mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-13 21:36:11 +00:00
feat: New site data popup, p=#10651
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/base/content/browser-addons.js b/browser/base/content/browser-addons.js
|
||||
index d7542a38a0242dd9c9c6390171d59992d75a0c19..d20e5a9fa42c88c7ba28fac1ef13dd693f1f1135 100644
|
||||
index d7542a38a0242dd9c9c6390171d59992d75a0c19..baa5d84c26f7e74c779bc7e1a2b83b543b413441 100644
|
||||
--- a/browser/base/content/browser-addons.js
|
||||
+++ b/browser/base/content/browser-addons.js
|
||||
@@ -1064,7 +1064,7 @@ var gXPInstallObserver = {
|
||||
@@ -20,7 +20,38 @@ index d7542a38a0242dd9c9c6390171d59992d75a0c19..d20e5a9fa42c88c7ba28fac1ef13dd69
|
||||
},
|
||||
};
|
||||
|
||||
@@ -2608,7 +2608,7 @@ var gUnifiedExtensions = {
|
||||
@@ -2205,7 +2205,7 @@ var gUnifiedExtensions = {
|
||||
// If the new ID is not added in NOTIFICATION_IDS, consider handling the case
|
||||
// in the "PopupNotificationsBeforeAnchor" handler elsewhere in this file.
|
||||
getPopupAnchorID(aBrowser, aWindow) {
|
||||
- const anchorID = "unified-extensions-button";
|
||||
+ const anchorID = "zen-site-data-icon-button";
|
||||
const attr = anchorID + "popupnotificationanchor";
|
||||
|
||||
if (!aBrowser[attr]) {
|
||||
@@ -2216,7 +2216,7 @@ var gUnifiedExtensions = {
|
||||
anchorID
|
||||
// Anchor on the toolbar icon to position the popup right below the
|
||||
// button.
|
||||
- ).firstElementChild;
|
||||
+ );
|
||||
}
|
||||
|
||||
return anchorID;
|
||||
@@ -2509,11 +2509,7 @@ var gUnifiedExtensions = {
|
||||
// Lazy load the unified-extensions-panel panel the first time we need to
|
||||
// display it.
|
||||
if (!this._panel) {
|
||||
- let template = document.getElementById(
|
||||
- "unified-extensions-panel-template"
|
||||
- );
|
||||
- template.replaceWith(template.content);
|
||||
- this._panel = document.getElementById("unified-extensions-panel");
|
||||
+ this._panel = document.getElementById("zen-unified-site-data-panel");
|
||||
let customizationArea = this._panel.querySelector(
|
||||
"#unified-extensions-area"
|
||||
);
|
||||
@@ -2608,7 +2604,7 @@ var gUnifiedExtensions = {
|
||||
this.recordButtonTelemetry(reason || "extensions_panel_showing");
|
||||
this.ensureButtonShownBeforeAttachingPanel(panel);
|
||||
PanelMultiView.openPopup(panel, this._button, {
|
||||
@@ -29,7 +60,7 @@ index d7542a38a0242dd9c9c6390171d59992d75a0c19..d20e5a9fa42c88c7ba28fac1ef13dd69
|
||||
triggerEvent: aEvent,
|
||||
});
|
||||
}
|
||||
@@ -2795,18 +2795,20 @@ var gUnifiedExtensions = {
|
||||
@@ -2795,18 +2791,20 @@ var gUnifiedExtensions = {
|
||||
this._maybeMoveWidgetNodeBack(widgetId);
|
||||
}
|
||||
|
||||
|
12
src/browser/base/content/browser-pageActions-js.patch
Normal file
12
src/browser/base/content/browser-pageActions-js.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/browser/base/content/browser-pageActions.js b/browser/base/content/browser-pageActions.js
|
||||
index 00da33bc11189db17b6a2e656acb3a778531197c..9571155baccad9a886cbe9c7bf0bd76a135331c4 100644
|
||||
--- a/browser/base/content/browser-pageActions.js
|
||||
+++ b/browser/base/content/browser-pageActions.js
|
||||
@@ -451,6 +451,7 @@ var BrowserPageActions = {
|
||||
),
|
||||
document.getElementById(this.mainButtonNode.id),
|
||||
document.getElementById("identity-icon"),
|
||||
+ document.getElementById("zen-site-data-icon-button"),
|
||||
];
|
||||
for (let node of potentialAnchorNodes) {
|
||||
if (node && !node.hidden) {
|
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/base/content/navigator-toolbox.js b/browser/base/content/navigator-toolbox.js
|
||||
index 413bad2a62058a1c434d6a44e927e44eb397289d..b621c586e679bb8686fe9a5e6743512e71604425 100644
|
||||
index 413bad2a62058a1c434d6a44e927e44eb397289d..472eab5d3bca2bc665920707a71105167cbe75ec 100644
|
||||
--- a/browser/base/content/navigator-toolbox.js
|
||||
+++ b/browser/base/content/navigator-toolbox.js
|
||||
@@ -8,7 +8,7 @@
|
||||
@@ -11,6 +11,24 @@ index 413bad2a62058a1c434d6a44e927e44eb397289d..b621c586e679bb8686fe9a5e6743512e
|
||||
const widgetOverflow = document.getElementById("widget-overflow");
|
||||
|
||||
function onPopupShowing(event) {
|
||||
@@ -110,7 +110,7 @@ document.addEventListener(
|
||||
#pageActionButton,
|
||||
#downloads-button,
|
||||
#fxa-toolbar-menu-button,
|
||||
- #unified-extensions-button,
|
||||
+ #zen-site-data-icon-button,
|
||||
#library-button
|
||||
`);
|
||||
if (!element) {
|
||||
@@ -138,7 +138,7 @@ document.addEventListener(
|
||||
gSync.toggleAccountPanel(element, event);
|
||||
break;
|
||||
|
||||
- case "unified-extensions-button":
|
||||
+ case "zen-site-data-icon-button":
|
||||
gUnifiedExtensions.togglePanel(event);
|
||||
break;
|
||||
|
||||
@@ -187,6 +187,7 @@ document.addEventListener(
|
||||
#reload-button ,
|
||||
#urlbar-go-button,
|
||||
@@ -27,3 +45,21 @@ index 413bad2a62058a1c434d6a44e927e44eb397289d..b621c586e679bb8686fe9a5e6743512e
|
||||
gBrowser.handleNewTabMiddleClick(element, event);
|
||||
break;
|
||||
|
||||
@@ -317,7 +319,7 @@ document.addEventListener(
|
||||
#pageActionButton,
|
||||
#downloads-button,
|
||||
#fxa-toolbar-menu-button,
|
||||
- #unified-extensions-button,
|
||||
+ #zen-site-data-icon-button,
|
||||
#library-button
|
||||
`);
|
||||
if (!element) {
|
||||
@@ -396,7 +398,7 @@ document.addEventListener(
|
||||
gSync.toggleAccountPanel(element, event);
|
||||
break;
|
||||
|
||||
- case "unified-extensions-button":
|
||||
+ case "zen-site-data-icon-button":
|
||||
gUnifiedExtensions.togglePanel(event);
|
||||
break;
|
||||
|
||||
|
@@ -5,10 +5,7 @@
|
||||
<commandset id="zenCommandSet">
|
||||
<command id="cmd_zenCompactModeToggle" />
|
||||
<command id="cmd_zenCompactModeShowSidebar" />
|
||||
<command id="cmd_zenCompactModeShowToolbar" />
|
||||
<command id="cmd_zenCompactModeHideSidebar" />
|
||||
<command id="cmd_zenCompactModeHideToolbar" />
|
||||
<command id="cmd_zenCompactModeHideBoth" />
|
||||
<command id="cmd_toggleCompactModeIgnoreHover" />
|
||||
|
||||
<command id="cmd_zenWorkspaceForward" />
|
||||
<command id="cmd_zenWorkspaceBackward" />
|
||||
|
@@ -49,3 +49,12 @@
|
||||
<menuitem id="context_zenFolderUnpack" data-l10n-id="zen-folders-panel-unpack-folder"/>
|
||||
<menuitem id="context_zenFolderDelete" data-l10n-id="zen-folders-panel-delete-folder"/>
|
||||
</menupopup>
|
||||
|
||||
<menupopup id="zenSiteDataActions">
|
||||
<menuitem id="context_zenClearSiteData" data-l10n-id="identity-clear-site-data"/>
|
||||
<menuseparator />
|
||||
<menuitem command="Tools:Addons" data-l10n-id="zen-site-data-manage-addons"/>
|
||||
<menuitem id="context_zenOpenGetAddons" data-l10n-id="zen-site-data-get-addons"/>
|
||||
<menuseparator />
|
||||
<menuitem id="context_zenOpenSiteSettings" data-l10n-id="zen-site-data-site-settings"/>
|
||||
</menupopup>
|
||||
|
87
src/browser/base/content/zen-panels/site-data.inc
Normal file
87
src/browser/base/content/zen-panels/site-data.inc
Normal file
@@ -0,0 +1,87 @@
|
||||
# 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/.
|
||||
|
||||
<panel id="zen-unified-site-data-panel"
|
||||
role="group"
|
||||
type="arrow"
|
||||
noautofocus="true"
|
||||
position="bottomright topright">
|
||||
<panelmultiview mainViewId="unified-extensions-view">
|
||||
# We'll keep the view with this name/id in order to prevent
|
||||
# any sort of future issues we may have if firefox decides
|
||||
# to change the functionality of this view
|
||||
<panelview id="unified-extensions-view"
|
||||
class="cui-widget-panelview"
|
||||
mainview-with-header="true">
|
||||
<hbox id="zen-site-data-header">
|
||||
<toolbarbutton id="zen-site-data-header-share"
|
||||
data-l10n-id="zen-site-data-share"
|
||||
flex="1"
|
||||
closemenu="none" />
|
||||
<toolbarbutton id="zen-site-data-header-reader-mode"
|
||||
command="View:ReaderView"
|
||||
flex="1" />
|
||||
<toolbarbutton id="zen-site-data-header-screenshot"
|
||||
command="Browser:Screenshot"
|
||||
flex="1" />
|
||||
<toolbarbutton id="zen-site-data-header-bookmark"
|
||||
command="Browser:AddBookmarkAs"
|
||||
flex="1" />
|
||||
</hbox>
|
||||
<vbox class="zen-site-data-section">
|
||||
<hbox class="zen-site-data-section-header">
|
||||
<label data-l10n-id="unified-extensions-header-title" flex="1" />
|
||||
<label data-l10n-id="zen-generic-manage" id="zen-site-data-manage-addons" />
|
||||
</hbox>
|
||||
<hbox class="panel-subview-body" context="unified-extensions-context-menu" id="zen-site-data-addons">
|
||||
<html:div id="unified-extensions-messages-container">
|
||||
<!-- messages will be inserted here -->
|
||||
</html:div>
|
||||
|
||||
<vbox id="overflowed-extensions-list">
|
||||
<!-- overflowed extension buttons from the nav-bar will go here -->
|
||||
</vbox>
|
||||
|
||||
<vbox id="unified-extensions-area">
|
||||
<!-- default area for extension browser action buttons -->
|
||||
</vbox>
|
||||
|
||||
<vbox class="unified-extensions-list">
|
||||
<!-- active visible extensions go here -->
|
||||
</vbox>
|
||||
|
||||
<vbox id="zen-site-data-new-addon-button-container">
|
||||
<toolbarbutton id="zen-site-data-new-addon-button"
|
||||
class="subviewbutton toolbarbutton-1" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
# Keep this button on the DOM even though we hide it for ever,
|
||||
# again, to keep firefox happy if they decide to change functionality
|
||||
# for this specific button / id
|
||||
<toolbarbutton id="unified-extensions-manage-extensions"
|
||||
class="subviewbutton panel-subview-footer-button unified-extensions-manage-extensions"
|
||||
data-l10n-id="unified-extensions-manage-extensions"
|
||||
hidden="true" />
|
||||
</vbox>
|
||||
<vbox class="zen-site-data-section">
|
||||
<hbox class="zen-site-data-section-header">
|
||||
<label data-l10n-id="zen-site-data-settings" flex="1" />
|
||||
<label data-l10n-id="zen-generic-more" id="zen-site-data-settings-more" />
|
||||
</hbox>
|
||||
<vbox id="zen-site-data-settings-list">
|
||||
<!-- settings will be inserted here -->
|
||||
</vbox>
|
||||
</vbox>
|
||||
<hbox id="zen-site-data-footer">
|
||||
<toolbarbutton id="zen-site-data-security-info"
|
||||
class="subviewbutton zen-interactive-button" />
|
||||
<toolbarbutton id="zen-site-data-actions"
|
||||
class="subviewbutton zen-interactive-button"
|
||||
closemenu="none"
|
||||
context="zenSiteDataActions" />
|
||||
</hbox>
|
||||
</panelview>
|
||||
</panelmultiview>
|
||||
</panel>
|
@@ -5,5 +5,6 @@
|
||||
#include zen-panels/gradient-generator.inc
|
||||
#include zen-panels/emojis-picker.inc
|
||||
#include zen-panels/folders-search.inc
|
||||
#include zen-panels/site-data.inc
|
||||
|
||||
#include zen-panels/popups.inc
|
||||
|
Reference in New Issue
Block a user