From 35695b1ebb6d97b82dc3a2ecb0239a152b31cdc5 Mon Sep 17 00:00:00 2001 From: Akhil Date: Mon, 21 Apr 2025 16:58:03 +0530 Subject: [PATCH] Remove the temporary murena.io banner --- src/email-recovery.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/email-recovery.js b/src/email-recovery.js index 31f6e88..93299f5 100644 --- a/src/email-recovery.js +++ b/src/email-recovery.js @@ -7,11 +7,11 @@ document.addEventListener('DOMContentLoaded', function() { const contentDiv = document.createElement('div') contentDiv.id = 'recovery-email-banner-container' const textNode = createTextNode(APPLICATION_NAME) - // const link = createLinkElement(APPLICATION_NAME) + const link = createLinkElement(APPLICATION_NAME) contentDiv.appendChild(textNode) newDiv.appendChild(contentDiv) - // newDiv.appendChild(link) + newDiv.appendChild(link) insertIntoDOM(newDiv) // Measure the height after the element is inserted into the DOM const banner = document.getElementById('recovery-email-banner') @@ -29,8 +29,8 @@ document.addEventListener('DOMContentLoaded', function() { const intervalId = setInterval(() => { const contentVue = document.querySelector('#content-vue') if (contentVue) { - setMarginTopAndHeight('#content-vue', topHeight) - clearInterval(intervalId) + setMarginTopAndHeight('#content-vue', topHeight) + clearInterval(intervalId) } }, 100) } @@ -142,7 +142,6 @@ function createTextNode(appName) { if (unverifiedRecoveryEmail !== '') { labelText = t(appName, 'Please verify your recovery email address to fully enjoy your murena.io account.') } - labelText = '📢 ' + t(appName, "Murena Workspace will be back fully soon! Please read this guide to know more.") p.innerHTML = labelText setTimeout(() => { const link = p.querySelector('a') // Find the tag inside

@@ -153,6 +152,21 @@ function createTextNode(appName) { }, 10) return p } +/** + * + * @param appName + */ +function createLinkElement(appName) { + const link = document.createElement('a') + let labelText = t(appName, 'SET RECOVERY EMAIL NOW') + if (unverifiedRecoveryEmail !== '') { + labelText = t(appName, 'VERIFY RECOVERY EMAIL NOW') + } + link.textContent = labelText + link.href = OC.getRootPath() + '/settings/user/security#recovery-email-div' + link.style.display = 'block' + return link +} /** * -- GitLab