formatting fixed
This commit is contained in:
parent
cac620e26f
commit
1a80ab7991
1 changed files with 94 additions and 94 deletions
|
|
@ -59,47 +59,47 @@ switch (message.command) {
|
|||
return Promise.resolve(window.document.body.innerHTML);
|
||||
|
||||
case 'sendAlert':
|
||||
console.log(">>>>>> message.curr_tab_type: " + JSON.stringify(message.curr_tab_type));
|
||||
//console.log(">>>>>> message.curr_tab_type: " + JSON.stringify(message.curr_tab_type));
|
||||
if(message.curr_tab_type == 'mail'){ // workaround for Thunderbird bug not showing the alert
|
||||
// Create dialog elements
|
||||
const dialog_sendAlert = window.document.createElement('dialog');
|
||||
dialog_sendAlert.classList.add('mzta_dialog');
|
||||
// Create dialog elements
|
||||
const dialog_sendAlert = window.document.createElement('dialog');
|
||||
dialog_sendAlert.classList.add('mzta_dialog');
|
||||
|
||||
const content_sendAlert = window.document.createElement('div');
|
||||
content_sendAlert.classList.add('mzta_dialog_content');
|
||||
const content_sendAlert = window.document.createElement('div');
|
||||
content_sendAlert.classList.add('mzta_dialog_content');
|
||||
|
||||
// Create close button
|
||||
const closeButton_sendAlert = window.document.createElement('button');
|
||||
closeButton_sendAlert.classList.add('mzta_dialog_close');
|
||||
closeButton_sendAlert.id = 'mzta_dialog_close';
|
||||
closeButton_sendAlert.textContent = 'Close';
|
||||
// Create close button
|
||||
const closeButton_sendAlert = window.document.createElement('button');
|
||||
closeButton_sendAlert.classList.add('mzta_dialog_close');
|
||||
closeButton_sendAlert.id = 'mzta_dialog_close';
|
||||
closeButton_sendAlert.textContent = 'Close';
|
||||
|
||||
// Create message element
|
||||
const message_sendAlert = window.document.createElement('div');
|
||||
message_sendAlert.classList.add('mzta_dialog_message');
|
||||
message_sendAlert.textContent = message.message;
|
||||
// Create message element
|
||||
const message_sendAlert = window.document.createElement('div');
|
||||
message_sendAlert.classList.add('mzta_dialog_message');
|
||||
message_sendAlert.textContent = message.message;
|
||||
|
||||
// Append elements to the dialog
|
||||
content_sendAlert.appendChild(message_sendAlert);
|
||||
content_sendAlert.appendChild(closeButton_sendAlert);
|
||||
dialog_sendAlert.appendChild(content_sendAlert);
|
||||
window.document.body.appendChild(dialog_sendAlert);
|
||||
// Append elements to the dialog
|
||||
content_sendAlert.appendChild(message_sendAlert);
|
||||
content_sendAlert.appendChild(closeButton_sendAlert);
|
||||
dialog_sendAlert.appendChild(content_sendAlert);
|
||||
window.document.body.appendChild(dialog_sendAlert);
|
||||
|
||||
// Show the dialog
|
||||
dialog_sendAlert.showModal();
|
||||
// Show the dialog
|
||||
dialog_sendAlert.showModal();
|
||||
|
||||
// Close dialog on button click and remove elements from the DOM
|
||||
closeButton_sendAlert.onclick = () => {
|
||||
// Close dialog on button click and remove elements from the DOM
|
||||
closeButton_sendAlert.onclick = () => {
|
||||
dialog_sendAlert.close();
|
||||
dialog_sendAlert.addEventListener('close', () => {
|
||||
dialog_sendAlert.remove();
|
||||
style.remove();
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
// CSS styles for Thunderbird with support for light and dark themes
|
||||
const style = document.createElement('style');
|
||||
style.textContent = `
|
||||
// CSS styles for Thunderbird with support for light and dark themes
|
||||
const style = document.createElement('style');
|
||||
style.textContent = `
|
||||
.mzta_dialog {
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
|
|
@ -166,8 +166,8 @@ style.textContent = `
|
|||
background: rgba(0, 0, 0, 0.7);
|
||||
z-index: 1000;
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
|
||||
}else{
|
||||
alert(message.message);
|
||||
|
|
|
|||
Loading…
Reference in a new issue