Bug 1714670 - Port bug 1711519 to Thunderbird - Remove gProton use from frontend code. r=mkmelin
Differential Revision: https://phabricator.services.mozilla.com/D116912 --HG-- extra : amend_source : 21e43b155a1974316cb5a0597f62dc5c493c1ab1
This commit is contained in:
Родитель
2eef875a18
Коммит
4455d8f4dc
|
@ -192,13 +192,7 @@ function setupMaxReminders() {
|
|||
null,
|
||||
gReminderNotification.PRIORITY_WARNING_MEDIUM
|
||||
);
|
||||
|
||||
if (gReminderNotification.gProton) {
|
||||
notification.closeButton.hidden = true;
|
||||
} else {
|
||||
let closeButton = notification.messageDetails.nextElementSibling;
|
||||
closeButton.setAttribute("hidden", "true");
|
||||
}
|
||||
notification.closeButton.hidden = true;
|
||||
} else {
|
||||
gReminderNotification.removeAllNotifications();
|
||||
}
|
||||
|
|
|
@ -3351,16 +3351,9 @@ var gMessageNotificationBar = {
|
|||
aCanOverride ? buttons : []
|
||||
);
|
||||
|
||||
// Update the button differently based on the Proton pref.
|
||||
if (this.msgNotificationBar.gProton) {
|
||||
notification.buttonContainer.firstElementChild.classList.add(
|
||||
"button-menu-list"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
let button = notification.spacer.nextElementSibling;
|
||||
button.classList.add("button-menu-list");
|
||||
notification.buttonContainer.firstElementChild.classList.add(
|
||||
"button-menu-list"
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -3400,16 +3393,9 @@ var gMessageNotificationBar = {
|
|||
buttons
|
||||
);
|
||||
|
||||
// Update the button differently based on the Proton pref.
|
||||
if (this.msgNotificationBar.gProton) {
|
||||
notification.buttonContainer.firstElementChild.classList.add(
|
||||
"button-menu-list"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
let button = notification.spacer.nextElementSibling;
|
||||
button.classList.add("button-menu-list");
|
||||
notification.buttonContainer.firstElementChild.classList.add(
|
||||
"button-menu-list"
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -792,12 +792,7 @@ var gAccountSetup = {
|
|||
notification.setAttribute("align", "center");
|
||||
|
||||
// Hide the close button to prevent dismissing the notification.
|
||||
if (this.notificationBox.gProton) {
|
||||
notification.removeAttribute("dismissable");
|
||||
} else {
|
||||
let closeButton = notification.messageDetails.nextElementSibling;
|
||||
closeButton.hidden = true;
|
||||
}
|
||||
notification.removeAttribute("dismissable");
|
||||
|
||||
this.ensureVisibleNotification();
|
||||
},
|
||||
|
@ -839,12 +834,7 @@ var gAccountSetup = {
|
|||
notification.setAttribute("type", "success");
|
||||
|
||||
// Hide the close button to prevent dismissing the notification.
|
||||
if (this.notificationBox.gProton) {
|
||||
notification.removeAttribute("dismissable");
|
||||
} else {
|
||||
let closeButton = notification.messageDetails.nextElementSibling;
|
||||
closeButton.hidden = true;
|
||||
}
|
||||
notification.removeAttribute("dismissable");
|
||||
|
||||
this.showHelperImage("step3");
|
||||
|
||||
|
@ -891,12 +881,7 @@ var gAccountSetup = {
|
|||
);
|
||||
|
||||
// Hide the close button to prevent dismissing the notification.
|
||||
if (this.notificationBox.gProton) {
|
||||
notification.removeAttribute("dismissable");
|
||||
} else {
|
||||
let closeButton = notification.messageDetails.nextElementSibling;
|
||||
closeButton.hidden = true;
|
||||
}
|
||||
notification.removeAttribute("dismissable");
|
||||
|
||||
this.ensureVisibleNotification();
|
||||
},
|
||||
|
@ -1900,12 +1885,7 @@ var gAccountSetup = {
|
|||
);
|
||||
|
||||
// Hide the close button to prevent dismissing the notification.
|
||||
if (this.notificationBox.gProton) {
|
||||
notification.removeAttribute("dismissable");
|
||||
} else {
|
||||
let closeButton = notification.messageDetails.nextElementSibling;
|
||||
closeButton.hidden = true;
|
||||
}
|
||||
notification.removeAttribute("dismissable");
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -2841,13 +2841,13 @@ function manageAttachmentNotification(aForce = false) {
|
|||
// specific keywords to the existing notification instead of creating it
|
||||
// from scratch.
|
||||
if (notification) {
|
||||
let selector = this.gComposeNotification.gProton
|
||||
? notification.messageText
|
||||
: notification;
|
||||
|
||||
let msgContainer = selector.querySelector("#attachmentReminderText");
|
||||
let msgContainer = notification.messageText.querySelector(
|
||||
"#attachmentReminderText"
|
||||
);
|
||||
msgContainer.setAttribute("value", textValue);
|
||||
let keywordsContainer = selector.querySelector("#attachmentKeywords");
|
||||
let keywordsContainer = notification.messageText.querySelector(
|
||||
"#attachmentKeywords"
|
||||
);
|
||||
keywordsContainer.setAttribute("value", keywords);
|
||||
return;
|
||||
}
|
||||
|
@ -2913,19 +2913,10 @@ function manageAttachmentNotification(aForce = false) {
|
|||
);
|
||||
notification.setAttribute("id", "attachmentNotificationBox");
|
||||
|
||||
// Variation for Proton UI.
|
||||
if (this.gComposeNotification.gProton) {
|
||||
notification.messageText.appendChild(msg);
|
||||
notification.buttonContainer.lastElementChild.appendChild(
|
||||
remindLaterMenuPopup
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
notification.messageDetails.querySelector("button").before(msg);
|
||||
notification.messageDetails
|
||||
.querySelector("button:last-child")
|
||||
.appendChild(remindLaterMenuPopup);
|
||||
notification.messageText.appendChild(msg);
|
||||
notification.buttonContainer.lastElementChild.appendChild(
|
||||
remindLaterMenuPopup
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -5148,10 +5139,9 @@ function checkPublicRecipientsLimit() {
|
|||
|
||||
// Reuse the existing notification since one is shown already.
|
||||
if (notification) {
|
||||
let root = this.gComposeNotification.gProton
|
||||
? notification.messageText
|
||||
: notification;
|
||||
let msgText = root.querySelector(".consider-bcc-notification-text");
|
||||
let msgText = notification.messageText.querySelector(
|
||||
".consider-bcc-notification-text"
|
||||
);
|
||||
msgText.setAttribute(
|
||||
"data-l10n-args",
|
||||
JSON.stringify({ count: publicAddressPillsCount })
|
||||
|
@ -5211,17 +5201,7 @@ function checkPublicRecipientsLimit() {
|
|||
}
|
||||
);
|
||||
notification.setAttribute("id", "warnPublicRecipientsNotification");
|
||||
// Variation for Proton UI.
|
||||
if (this.gComposeNotification.gProton) {
|
||||
notification.messageText.appendChild(msgText);
|
||||
return;
|
||||
}
|
||||
|
||||
// Ugh, the following isn't perfect... but !gProton may be dropped soon.
|
||||
let msg = document.createElement("div");
|
||||
msg.appendChild(msgText);
|
||||
notification.messageDetails.style.display = "flex";
|
||||
notification.messageDetails.querySelector("button").before(msg);
|
||||
notification.messageText.appendChild(msgText);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче