From e8f71e7e3d660afe316079d1ba4c86d9309dada2 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 14:39:51 -0700 Subject: [PATCH 01/16] Business banner --- .../BeforeTemplateRenderedListener.php | 10 +- scss/business-banner.scss | 56 ++++++ src/business-banner.js | 171 ++++++++++++++++++ webpack.config.js | 3 +- 4 files changed, 237 insertions(+), 3 deletions(-) create mode 100644 scss/business-banner.scss create mode 100644 src/business-banner.js diff --git a/lib/Listeners/BeforeTemplateRenderedListener.php b/lib/Listeners/BeforeTemplateRenderedListener.php index adece9c3..f814d25a 100644 --- a/lib/Listeners/BeforeTemplateRenderedListener.php +++ b/lib/Listeners/BeforeTemplateRenderedListener.php @@ -13,7 +13,7 @@ use OCP\IRequest; use OCP\ISession; use OCP\IUserSession; use OCP\Util; - +use OCP\AppFramework\Http\TemplateResponse; class BeforeTemplateRenderedListener implements IEventListener { private $userSession; private $request; @@ -49,7 +49,13 @@ class BeforeTemplateRenderedListener implements IEventListener { if (strpos($pathInfo, '/apps/ecloud-accounts/accounts') !== false) { $this->util->addStyle($this->appName, $this->appName . '-userregistration'); } - + if (($event->getResponse()->getRenderAs() === TemplateResponse::RENDER_AS_USER) && $event->isLoggedIn() && !empty($this->userId)) { + // $recoveryEmail = $this->recoveryEmailService->getRecoveryEmail($this->userId); + // if ($recoveryEmail === '') { + $this->util->addStyle($this->appName, 'business-banner'); + $this->util->addScript($this->appName, $this->appName . '-business-banner'); + // } + } } diff --git a/scss/business-banner.scss b/scss/business-banner.scss new file mode 100644 index 00000000..aa010b6b --- /dev/null +++ b/scss/business-banner.scss @@ -0,0 +1,56 @@ +.recovery-email-banner { + display: inline-flex; + position: absolute; + top: 0px; + width: 100%; + min-height: 50px; + box-sizing: border-box; + justify-content: center; + align-items: center; + background: #333333; + color: #ffffff; + font-size: 16px; + font-weight: 400; + line-height: 24px; + padding: 16px 6%; + #recovery-email-banner-container{ + display:inline-flex; + img { + padding-right:10px; + align-self: start; + } + p{ + margin: 0 auto; + } + } + + a { + color: #ffffff; + padding-left: 24px; + text-decoration: underline; + font-size: 16px; + font-weight: 600; + } + +} + +@media only screen and (max-width: 768px) { + .recovery-email-banner { + display: block; + a{ + padding: 8px 0 0 30px; + } + } +} +[data-object-type="email-recovery-important"] a.external { + background-color: var(--color-primary-element); + color: var(--color-primary-element-text); + text-decoration: none; + display: block; + text-align: center; + padding: 10px 12px; + border-radius: 30px; + font-size: 12px; + font-weight: bold; + width: fit-content; +} diff --git a/src/business-banner.js b/src/business-banner.js new file mode 100644 index 00000000..a777e3f9 --- /dev/null +++ b/src/business-banner.js @@ -0,0 +1,171 @@ +import { generateUrl } from '@nextcloud/router' +import { loadState } from '@nextcloud/initial-state' + +const unverifiedRecoveryEmail = loadState('ecloud-accounts', 'unverifiedRecoveryEmail') +const APPLICATION_NAME = 'ecloud-accounts' +document.addEventListener('DOMContentLoaded', function() { + const newDiv = createNewDiv('business-banner') + const contentDiv = document.createElement('div') + contentDiv.id = 'business-banner-container' + const img = createImageElement(APPLICATION_NAME) + const textNode = createTextNode(APPLICATION_NAME) + const link = createLinkElement(APPLICATION_NAME) + + contentDiv.appendChild(img) + contentDiv.appendChild(textNode) + newDiv.appendChild(contentDiv) + newDiv.appendChild(link) + insertIntoDOM(newDiv) + // Measure the height after the element is inserted into the DOM + const banner = document.getElementById('business-banner') + if (banner) { + const bannerHeight = banner.clientHeight + 'px' + const topHeight = (banner.clientHeight + 50) + 'px' + setTopStyle('#header', bannerHeight) + setMarginTopAndHeight('#content', topHeight) + setMarginTopAndHeight('#content-vue', topHeight) + setTopStyleWhenElementAvailable('#header-menu-user-menu', topHeight) + setTopStyleWhenElementAvailable('#header-menu-notifications', topHeight) + setTopStyle('#header-menu-unified-search', topHeight) + banner.style.height = bannerHeight + } + +}) + +/** + * Sets the 'top' style to an element once it becomes available in the DOM. + * + * @param {string} selector - The CSS selector for the element. + * @param {string} topValue - The value to be set for the 'top' property. + */ + +/** + * + * @param selector + * @param topValue + */ +function setTopStyleWhenElementAvailable(selector, topValue) { + // Function to check each node and apply style if it matches the selector + /** + * + * @param node + */ + function checkAndApplyStyle(node) { + if (node.nodeType === Node.ELEMENT_NODE) { + if (node.matches(selector)) { + node.style.top = topValue + } + + // Check all child nodes + node.querySelectorAll(selector).forEach(childNode => { + childNode.style.top = topValue + }) + } + } + + // Set up a MutationObserver to watch for added nodes + const observer = new MutationObserver(mutations => { + mutations.forEach(mutation => { + mutation.addedNodes.forEach(checkAndApplyStyle) + }) + }) + + // Start observing the document body for added nodes + observer.observe(document.body, { childList: true, subtree: true }) +} + +/** + * Sets the 'top' style property of an element. + * The element is selected based on the provided CSS selector. + * + * @param {string} selector + * @param {string} topValue + */ +function setTopStyle(selector, topValue) { + const element = document.querySelector(selector) + if (element) { + element.style.top = topValue + } +} + +/** + * Apply a margin-top style with !important and calculate a new height for the element. + * + * @param {string} selector - The CSS selector for the element. + * @param {string} topValue - The value for the margin-top property. + */ + +/** + * + * @param selector + * @param topValue + */ +function setMarginTopAndHeight(selector, topValue) { + const element = document.querySelector(selector) + if (element) { + element.style.cssText += `margin-top: ${topValue} !important;` + const heightValue = `calc(100% - env(safe-area-inset-bottom) - ${topValue} - var(--body-container-margin)) !important` + element.style.cssText += `height: ${heightValue};` + } +} +/** + * + * @param className + */ +function createNewDiv(className) { + const div = document.createElement('div') + div.className = className + div.id = className + return div +} + +/** + * + * @param appName + */ +function createImageElement(appName) { + const img = document.createElement('img') + img.src = generateUrl('/custom_apps/' + appName + '/img/warning.svg') + return img +} + +/** + * + * @param appName + */ +function createTextNode(appName) { + const p = document.createElement('p') + let labelText = t(appName, 'Please set your recovery email address to use your email account without restrictions.') + if (unverifiedRecoveryEmail !== '') { + labelText = t(appName, 'Please verify your recovery email address to fully enjoy your murena.io account.') + } + const text = document.createTextNode(labelText) + p.appendChild(text) + 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 +} + +/** + * + * @param element + */ +function insertIntoDOM(element) { + const targetElement = document.getElementById('header') + const parentElement = targetElement.parentNode + parentElement.insertBefore(element, targetElement) +} diff --git a/webpack.config.js b/webpack.config.js index b6eaacba..e4d82caa 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -9,6 +9,7 @@ module.exports = { 'delete-shop-account-setting': path.join(__dirname, 'src/delete-shop-account-setting.js'), 'delete-account-listeners': path.join(__dirname, 'src/delete-account-listeners.js'), 'beta-user-setting': path.join(__dirname, 'src/beta-user-setting.js'), - 'signup': path.join(__dirname, 'src/signup.js') + 'signup': path.join(__dirname, 'src/signup.js'), + 'business-banner': path.join(__dirname, 'src/business-banner.js'), }, } -- GitLab From a2724b5204c136159672fd9abd181518d0ac42a7 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 14:41:14 -0700 Subject: [PATCH 02/16] changes --- lib/Listeners/BeforeTemplateRenderedListener.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Listeners/BeforeTemplateRenderedListener.php b/lib/Listeners/BeforeTemplateRenderedListener.php index f814d25a..7462d089 100644 --- a/lib/Listeners/BeforeTemplateRenderedListener.php +++ b/lib/Listeners/BeforeTemplateRenderedListener.php @@ -6,6 +6,7 @@ namespace OCA\EcloudAccounts\Listeners; use OCP\App\IAppManager; use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent; +use OCP\AppFramework\Http\TemplateResponse; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use OCP\IConfig; @@ -13,7 +14,7 @@ use OCP\IRequest; use OCP\ISession; use OCP\IUserSession; use OCP\Util; -use OCP\AppFramework\Http\TemplateResponse; + class BeforeTemplateRenderedListener implements IEventListener { private $userSession; private $request; @@ -52,8 +53,8 @@ class BeforeTemplateRenderedListener implements IEventListener { if (($event->getResponse()->getRenderAs() === TemplateResponse::RENDER_AS_USER) && $event->isLoggedIn() && !empty($this->userId)) { // $recoveryEmail = $this->recoveryEmailService->getRecoveryEmail($this->userId); // if ($recoveryEmail === '') { - $this->util->addStyle($this->appName, 'business-banner'); - $this->util->addScript($this->appName, $this->appName . '-business-banner'); + $this->util->addStyle($this->appName, 'business-banner'); + $this->util->addScript($this->appName, $this->appName . '-business-banner'); // } } } -- GitLab From 678cac2d0af43bb8328f530ae95cc6e84e23fd7c Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 14:43:41 -0700 Subject: [PATCH 03/16] changes --- lib/Listeners/BeforeTemplateRenderedListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Listeners/BeforeTemplateRenderedListener.php b/lib/Listeners/BeforeTemplateRenderedListener.php index 7462d089..2d1100ac 100644 --- a/lib/Listeners/BeforeTemplateRenderedListener.php +++ b/lib/Listeners/BeforeTemplateRenderedListener.php @@ -50,7 +50,7 @@ class BeforeTemplateRenderedListener implements IEventListener { if (strpos($pathInfo, '/apps/ecloud-accounts/accounts') !== false) { $this->util->addStyle($this->appName, $this->appName . '-userregistration'); } - if (($event->getResponse()->getRenderAs() === TemplateResponse::RENDER_AS_USER) && $event->isLoggedIn() && !empty($this->userId)) { + if (($event->getResponse()->getRenderAs() === TemplateResponse::RENDER_AS_USER) && $event->isLoggedIn()) { // $recoveryEmail = $this->recoveryEmailService->getRecoveryEmail($this->userId); // if ($recoveryEmail === '') { $this->util->addStyle($this->appName, 'business-banner'); -- GitLab From a842f11e12776e23072c83e623ddc473261339b2 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 14:46:18 -0700 Subject: [PATCH 04/16] changes --- scss/business-banner.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scss/business-banner.scss b/scss/business-banner.scss index aa010b6b..f3a258bf 100644 --- a/scss/business-banner.scss +++ b/scss/business-banner.scss @@ -1,4 +1,4 @@ -.recovery-email-banner { +.ecloud-accounts-banner { display: inline-flex; position: absolute; top: 0px; @@ -13,7 +13,7 @@ font-weight: 400; line-height: 24px; padding: 16px 6%; - #recovery-email-banner-container{ + #ecloud-accounts-banner-container{ display:inline-flex; img { padding-right:10px; @@ -35,14 +35,14 @@ } @media only screen and (max-width: 768px) { - .recovery-email-banner { + .ecloud-accounts-banner { display: block; a{ padding: 8px 0 0 30px; } } } -[data-object-type="email-recovery-important"] a.external { +[data-object-type="ecloud-accounts-important"] a.external { background-color: var(--color-primary-element); color: var(--color-primary-element-text); text-decoration: none; -- GitLab From 60b123aa78dc37802d28164fd80dba9ace71d085 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 14:57:39 -0700 Subject: [PATCH 05/16] added crowdcube.png --- img/crowdcube.png | Bin 0 -> 8311 bytes .../BeforeTemplateRenderedListener.php | 11 ++++++++-- src/business-banner.js | 19 ++++++++---------- 3 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 img/crowdcube.png diff --git a/img/crowdcube.png b/img/crowdcube.png new file mode 100644 index 0000000000000000000000000000000000000000..a37524efef71ff6f93cdd28b3418f68ef48ef1ce GIT binary patch literal 8311 zcmXwe2Q-||_dZsTsH+oo)uY_$3 z`OEk7|DAj0ojdQ`^E~Iy`<{Dd<_T9^lq$Or8f{8xQB<*>>pB z_0VCuynFi^qhgqD=V2ggp`&1_qJqKo;NxLnhT33Y{|k9&v=0pf1CWi00eI*!|Gmq` z`oCFBo@~JX`54;&0yCrn(lIa?*A!%5X?kG(Ho$G6hfGOduyM9N%VB55jwQt!eWxp*fgi;2QXHinAeq!+=h!1ixU#a>I&zgXAZ!VCzMa*3Yv_)yZ!%}C7vzwq9y5#uIhHf4IS>`>$E@i*5r%`^fe0;3RW`Q8DH;(o4^XMVhb z*h|!0kE1Dc3AeaEG$;1o$hX5zwM*Ku`(ToR;>lVS3I5tBp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gd|jpap^v-8pbIQymlc zV{>T~+-7yU;qt>+;tcDJ-yy(&HLqqGF!?M?NTiv*Oj&~N@C}n;C=bb%+hO3ru2+aBnW(V|b%;Ns_x+XFCx|r+5%DX7T1Rv6;{D z7cpCYpV#+~!ldS3e)2s3J`9KBzWm?=e+}x6lZlVWtf|sS2=!?lXe^L)jh1@ zZ|{JFtpnMG(L!a()WD`MPu8I5gl?j1(AI!XY9QfQhib4)DU&E+J)%d-du=} zBV&BeFu{5{6H!$-ZJ((U6ZN8h_C zZG~jH#J}vi9{&>LYn+cOF|yp@GvQOxsW+qKoJIryjywMx8rTN}ddb2LTy1myyvlCR z+0^vi8Jj{u{Q)>;ef^oxfjY7h{c%1)A30j=27$~Q0-MHr3~ZQ3;dUQ{JLR!;vr=Qc zF!S2r*ggvMkVS%cB7&=0!+oas*ptp#W z$80n4OdsTxmrQz1Y&Paa}|@fw~3y|I;`#LrX^c2p#5CbqNG3Jr)k z&i@ZYf^!f6+i|_r8Nxn()>``AKFFduX&+R&S~qLWns>Y~xY=j+A0;;qBKgVJX4#5> z%L`=|9h(&60*B>YHfaXW*-GZwN~T$E4KN?EsvR)>e`##rQKtab|1d3IN#tB)8eGM< mOx-YwNtyf)EFd`WFYdl4^{_D&=Jr3)Ujd>jTk+aB=>GvgumBYR literal 0 HcmV?d00001 diff --git a/lib/Listeners/BeforeTemplateRenderedListener.php b/lib/Listeners/BeforeTemplateRenderedListener.php index 2d1100ac..1ccf784b 100644 --- a/lib/Listeners/BeforeTemplateRenderedListener.php +++ b/lib/Listeners/BeforeTemplateRenderedListener.php @@ -7,6 +7,7 @@ namespace OCA\EcloudAccounts\Listeners; use OCP\App\IAppManager; use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent; use OCP\AppFramework\Http\TemplateResponse; +use OCP\AppFramework\Services\IInitialState; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use OCP\IConfig; @@ -27,8 +28,9 @@ class BeforeTemplateRenderedListener implements IEventListener { private const SNAPPYMAIL_APP_ID = 'snappymail'; private const SNAPPYMAIL_URL = '/apps/snappymail/'; private const SNAPPYMAIL_AUTOLOGIN_PWD = '1'; - - public function __construct($appName, IUserSession $userSession, IRequest $request, ISession $session, IConfig $config, IAppManager $appManager, Util $util) { + private IInitialState $initialState; + private $userId; + public function __construct($appName, IUserSession $userSession, IRequest $request, ISession $session, IConfig $config, IAppManager $appManager, Util $util, $userId, IInitialState $initialState) { $this->appName = $appName; $this->userSession = $userSession; $this->request = $request; @@ -36,6 +38,8 @@ class BeforeTemplateRenderedListener implements IEventListener { $this->config = $config; $this->appManager = $appManager; $this->util = $util; + $this->initialState = $initialState; + $this->userId = $userId; } public function handle(Event $event): void { @@ -53,6 +57,9 @@ class BeforeTemplateRenderedListener implements IEventListener { if (($event->getResponse()->getRenderAs() === TemplateResponse::RENDER_AS_USER) && $event->isLoggedIn()) { // $recoveryEmail = $this->recoveryEmailService->getRecoveryEmail($this->userId); // if ($recoveryEmail === '') { + // $unverifiedRecoveryEmail = $this->recoveryEmailService->getUnverifiedRecoveryEmail($this->userId); + $userLocation = 'USA'; + $this->initialState->provideInitialState('userLocation', $userLocation); $this->util->addStyle($this->appName, 'business-banner'); $this->util->addScript($this->appName, $this->appName . '-business-banner'); // } diff --git a/src/business-banner.js b/src/business-banner.js index a777e3f9..080cccce 100644 --- a/src/business-banner.js +++ b/src/business-banner.js @@ -1,7 +1,7 @@ import { generateUrl } from '@nextcloud/router' import { loadState } from '@nextcloud/initial-state' -const unverifiedRecoveryEmail = loadState('ecloud-accounts', 'unverifiedRecoveryEmail') +const userLocation = loadState('ecloud-accounts', 'userLocation') const APPLICATION_NAME = 'ecloud-accounts' document.addEventListener('DOMContentLoaded', function() { const newDiv = createNewDiv('business-banner') @@ -125,7 +125,7 @@ function createNewDiv(className) { */ function createImageElement(appName) { const img = document.createElement('img') - img.src = generateUrl('/custom_apps/' + appName + '/img/warning.svg') + img.src = generateUrl('/custom_apps/' + appName + '/img/crowdcube.png') return img } @@ -135,10 +135,10 @@ function createImageElement(appName) { */ function createTextNode(appName) { const p = document.createElement('p') - let labelText = t(appName, 'Please set your recovery email address to use your email account without restrictions.') - if (unverifiedRecoveryEmail !== '') { - labelText = t(appName, 'Please verify your recovery email address to fully enjoy your murena.io account.') - } + let labelText = t(appName, 'Own a Part of Murena!') + // if (userLocation !== 'USA') { + // labelText = t(appName, 'Please verify your recovery email address to fully enjoy your murena.io account.') + // } const text = document.createTextNode(labelText) p.appendChild(text) return p @@ -150,12 +150,9 @@ function createTextNode(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') - } + let labelText = t(appName, 'LEARN MORE') link.textContent = labelText - link.href = OC.getRootPath() + '/settings/user/security#recovery-email-div' + link.href = 'https://murena.com/investors/' link.style.display = 'block' return link } -- GitLab From 58b4333dddb075a050f622e44c59e41ca58a9f56 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 14:59:55 -0700 Subject: [PATCH 06/16] lint fix --- src/business-banner.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/business-banner.js b/src/business-banner.js index 080cccce..52894167 100644 --- a/src/business-banner.js +++ b/src/business-banner.js @@ -1,7 +1,7 @@ import { generateUrl } from '@nextcloud/router' -import { loadState } from '@nextcloud/initial-state' +// import { loadState } from '@nextcloud/initial-state' -const userLocation = loadState('ecloud-accounts', 'userLocation') +// const userLocation = loadState('ecloud-accounts', 'userLocation') const APPLICATION_NAME = 'ecloud-accounts' document.addEventListener('DOMContentLoaded', function() { const newDiv = createNewDiv('business-banner') @@ -135,10 +135,7 @@ function createImageElement(appName) { */ function createTextNode(appName) { const p = document.createElement('p') - let labelText = t(appName, 'Own a Part of Murena!') - // if (userLocation !== 'USA') { - // labelText = t(appName, 'Please verify your recovery email address to fully enjoy your murena.io account.') - // } + const labelText = t(appName, 'Own a Part of Murena!') const text = document.createTextNode(labelText) p.appendChild(text) return p @@ -150,7 +147,7 @@ function createTextNode(appName) { */ function createLinkElement(appName) { const link = document.createElement('a') - let labelText = t(appName, 'LEARN MORE') + const labelText = t(appName, 'LEARN MORE') link.textContent = labelText link.href = 'https://murena.com/investors/' link.style.display = 'block' -- GitLab From 4d42805b3633442d4e3c90f95f432a8ff1165403 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 15:03:26 -0700 Subject: [PATCH 07/16] lint fix --- img/crowdcube.png | Bin 8311 -> 2910 bytes scss/business-banner.scss | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/img/crowdcube.png b/img/crowdcube.png index a37524efef71ff6f93cdd28b3418f68ef48ef1ce..6f15ba707528bd6658dfad4098f714982abc6fc7 100644 GIT binary patch literal 2910 zcmZ{mc{CJ!7sn-J%|1x7uMM&$Yqnu*Au~pHqhzh7p{KDWOxCf6v1MN}P1a=1Hpr0!hh@E{J+-!W&i*c z55Qmp_%;VZF9Rob5M~H|Zh`$>;J^YhZU9#vu)PLuoCEeuU}+Le_JLba;3osVFM@?} z&|eGss==cxARYm{#liay&|U~;he2T=$ngWit)Qz6q&Nc)0q}Jil;8kP3k0cyjb$)H z1IbkaP`Tlt7vrh=74{3V7@Zkf#9k zC3y235WPWp7+9M}Vt06t&nJzwwYo|(Q~7J>J4IhpPW+=#b0Izq?W6=@TpX;oW9vw} z<2zbyMI;2lIXm&aA~ZBiRd6GHyT2yaCI+m!F7xB(p4b-18+Tx2==V;j^KBHpGyp@Ziy7xLV8@sJ5kOQ|C^4O_M+&3DBgCHw0KA$)DRsz~E4$4CN zc4=1+Ca^HXMTqR753jXxY&yoY@>)qc2E+A~F2$CUZ9v#KT-;WUy88xpOSVD!&(Jkw zgWAuF1J1dnC9v_hyXGY&W7(`3rS&l_mSfjV8JLaDt~H4g=fx!zEG-!JEh@2`b832(8sxr2j;hV)x$n&y4pjr`NO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E4KN?EsvR)>e`##rQKtab|1d3IN#tB)8eGM< mOx-YwNtyf)EFd`WFYdl4^{_D&=Jr3)Ujd>jTk+aB=>GvgumBYR diff --git a/scss/business-banner.scss b/scss/business-banner.scss index f3a258bf..24b78cb7 100644 --- a/scss/business-banner.scss +++ b/scss/business-banner.scss @@ -1,4 +1,4 @@ -.ecloud-accounts-banner { +.business-banner { display: inline-flex; position: absolute; top: 0px; @@ -13,7 +13,7 @@ font-weight: 400; line-height: 24px; padding: 16px 6%; - #ecloud-accounts-banner-container{ + #business-banner-container{ display:inline-flex; img { padding-right:10px; @@ -35,14 +35,14 @@ } @media only screen and (max-width: 768px) { - .ecloud-accounts-banner { + .business-banner { display: block; a{ padding: 8px 0 0 30px; } } } -[data-object-type="ecloud-accounts-important"] a.external { +[data-object-type="business-banner-important"] a.external { background-color: var(--color-primary-element); color: var(--color-primary-element-text); text-decoration: none; -- GitLab From 1538eb6fb2df2bcc01c6d25ba313c6d4b911e558 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 15:05:56 -0700 Subject: [PATCH 08/16] lint fix --- scss/business-banner.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scss/business-banner.scss b/scss/business-banner.scss index 24b78cb7..4ec7c6fc 100644 --- a/scss/business-banner.scss +++ b/scss/business-banner.scss @@ -18,6 +18,8 @@ img { padding-right:10px; align-self: start; + height: 25px; + width: auto; } p{ margin: 0 auto; -- GitLab From d5b4f6b0c8b8fb0f93690eafbcbede7bf5a45594 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 15:10:35 -0700 Subject: [PATCH 09/16] lint fix --- src/business-banner.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/business-banner.js b/src/business-banner.js index 52894167..bdb07cec 100644 --- a/src/business-banner.js +++ b/src/business-banner.js @@ -10,11 +10,13 @@ document.addEventListener('DOMContentLoaded', function() { const img = createImageElement(APPLICATION_NAME) const textNode = createTextNode(APPLICATION_NAME) const link = createLinkElement(APPLICATION_NAME) + const closeButton = createCloseButton() contentDiv.appendChild(img) contentDiv.appendChild(textNode) newDiv.appendChild(contentDiv) newDiv.appendChild(link) + newDiv.appendChild(closeButton) insertIntoDOM(newDiv) // Measure the height after the element is inserted into the DOM const banner = document.getElementById('business-banner') @@ -153,6 +155,17 @@ function createLinkElement(appName) { link.style.display = 'block' return link } +/** + * + * @param appName + */ +function createCloseButton() { + const span = document.createElement('span') + const labelText = 'X' + span.textContent = labelText + span.style.display = 'block' + return span +} /** * -- GitLab From 1c975c4702e6c34faee5539763dfb02420a8da55 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 15:13:49 -0700 Subject: [PATCH 10/16] added spam css --- scss/business-banner.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scss/business-banner.scss b/scss/business-banner.scss index 4ec7c6fc..75314a05 100644 --- a/scss/business-banner.scss +++ b/scss/business-banner.scss @@ -24,6 +24,11 @@ p{ margin: 0 auto; } + span { + position: absolute; + right: 20px; + cursor: pointer; + } } a { -- GitLab From d546c3bdbc6cae840b4789a9f539c252334bfe80 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 15:17:53 -0700 Subject: [PATCH 11/16] added localstorage to close it permanent --- src/business-banner.js | 61 +++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/src/business-banner.js b/src/business-banner.js index bdb07cec..829b11d2 100644 --- a/src/business-banner.js +++ b/src/business-banner.js @@ -4,34 +4,35 @@ import { generateUrl } from '@nextcloud/router' // const userLocation = loadState('ecloud-accounts', 'userLocation') const APPLICATION_NAME = 'ecloud-accounts' document.addEventListener('DOMContentLoaded', function() { - const newDiv = createNewDiv('business-banner') - const contentDiv = document.createElement('div') - contentDiv.id = 'business-banner-container' - const img = createImageElement(APPLICATION_NAME) - const textNode = createTextNode(APPLICATION_NAME) - const link = createLinkElement(APPLICATION_NAME) - const closeButton = createCloseButton() + if (!localStorage.getItem('bannerClosed')) { + const newDiv = createNewDiv('business-banner') + const contentDiv = document.createElement('div') + contentDiv.id = 'business-banner-container' + const img = createImageElement(APPLICATION_NAME) + const textNode = createTextNode(APPLICATION_NAME) + const link = createLinkElement(APPLICATION_NAME) + const closeButton = createCloseButton(newDiv) - contentDiv.appendChild(img) - contentDiv.appendChild(textNode) - newDiv.appendChild(contentDiv) - newDiv.appendChild(link) - newDiv.appendChild(closeButton) - insertIntoDOM(newDiv) - // Measure the height after the element is inserted into the DOM - const banner = document.getElementById('business-banner') - if (banner) { - const bannerHeight = banner.clientHeight + 'px' - const topHeight = (banner.clientHeight + 50) + 'px' - setTopStyle('#header', bannerHeight) - setMarginTopAndHeight('#content', topHeight) - setMarginTopAndHeight('#content-vue', topHeight) - setTopStyleWhenElementAvailable('#header-menu-user-menu', topHeight) - setTopStyleWhenElementAvailable('#header-menu-notifications', topHeight) - setTopStyle('#header-menu-unified-search', topHeight) - banner.style.height = bannerHeight + contentDiv.appendChild(img) + contentDiv.appendChild(textNode) + newDiv.appendChild(contentDiv) + newDiv.appendChild(link) + newDiv.appendChild(closeButton) + insertIntoDOM(newDiv) + // Measure the height after the element is inserted into the DOM + const banner = document.getElementById('business-banner') + if (banner) { + const bannerHeight = banner.clientHeight + 'px' + const topHeight = (banner.clientHeight + 50) + 'px' + setTopStyle('#header', bannerHeight) + setMarginTopAndHeight('#content', topHeight) + setMarginTopAndHeight('#content-vue', topHeight) + setTopStyleWhenElementAvailable('#header-menu-user-menu', topHeight) + setTopStyleWhenElementAvailable('#header-menu-notifications', topHeight) + setTopStyle('#header-menu-unified-search', topHeight) + banner.style.height = bannerHeight + } } - }) /** @@ -158,12 +159,18 @@ function createLinkElement(appName) { /** * * @param appName + * @param banner */ -function createCloseButton() { +function createCloseButton(banner) { const span = document.createElement('span') const labelText = 'X' span.textContent = labelText span.style.display = 'block' + span.style.cursor = 'pointer' + span.addEventListener('click', function() { + banner.style.display = 'none' + localStorage.setItem('bannerClosed', 'true') + }) return span } -- GitLab From 2100bd66af23d15912f7d5deb669ead25f1a8fce Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 15:22:57 -0700 Subject: [PATCH 12/16] added translations --- l10n/de.js | 3 ++- l10n/de.json | 3 ++- l10n/en.js | 3 ++- l10n/en.json | 3 ++- l10n/es.js | 3 ++- l10n/es.json | 3 ++- l10n/fr.js | 3 ++- l10n/fr.json | 3 ++- l10n/it.js | 3 ++- l10n/it.json | 3 ++- 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/l10n/de.js b/l10n/de.js index 26bd31c0..a5dcd6f3 100644 --- a/l10n/de.js +++ b/l10n/de.js @@ -85,6 +85,7 @@ OC.L10N.register( "Captcha is not verified!": "Captcha wird nicht überprüft!", "A server-side error occurred while processing your request! Please try again later.": "Ein serverseitiger Fehler ist bei der Bearbeitung Ihrer Anfrage aufgetreten! Bitte versuchen Sie es später noch einmal.", "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!", - "The domain of this email address is blacklisted. Please provide another recovery address.": "Die Domäne dieser E-Mailadresse ist auf der Sperrliste. Bitte geben Sie eine andere E-Mailadresse an." + "The domain of this email address is blacklisted. Please provide another recovery address.": "Die Domäne dieser E-Mailadresse ist auf der Sperrliste. Bitte geben Sie eine andere E-Mailadresse an.", + "Own a Part of Murena!": "Besitzen Sie einen Teil von Murena!" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de.json b/l10n/de.json index 581f0a74..b2e6e195 100644 --- a/l10n/de.json +++ b/l10n/de.json @@ -83,7 +83,8 @@ "Captcha is not verified!": "Captcha wird nicht überprüft!", "A server-side error occurred while processing your request! Please try again later.": "Ein serverseitiger Fehler ist bei der Bearbeitung Ihrer Anfrage aufgetreten! Bitte versuchen Sie es später noch einmal.", "An error occurred while creating your account!": "Beim Anlegen Ihres Kontos ist ein Fehler aufgetreten!", - "The domain of this email address is blacklisted. Please provide another recovery address.": "Die Domäne dieser E-Mailadresse ist auf der Sperrliste. Bitte geben Sie eine andere E-Mailadresse an." + "The domain of this email address is blacklisted. Please provide another recovery address.": "Die Domäne dieser E-Mailadresse ist auf der Sperrliste. Bitte geben Sie eine andere E-Mailadresse an.", + "Own a Part of Murena!": "Besitzen Sie einen Teil von Murena!" }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/en.js b/l10n/en.js index b25bf722..4136a500 100644 --- a/l10n/en.js +++ b/l10n/en.js @@ -89,6 +89,7 @@ OC.L10N.register( "Captcha is not verified!": "Captcha is not verified!", "A server-side error occurred while processing your request! Please try again later.": "A server-side error occurred while processing your request! Please try again later.", "An error occurred while creating your account!": "An error occurred while creating your account!", - "The domain of this email address is blacklisted. Please provide another recovery address.": "The domain of this email address is blacklisted. Please provide another recovery address." + "The domain of this email address is blacklisted. Please provide another recovery address.": "The domain of this email address is blacklisted. Please provide another recovery address.", + "Own a Part of Murena!": "Own a Part of Murena!" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/en.json b/l10n/en.json index be378a0a..f4f22a4f 100644 --- a/l10n/en.json +++ b/l10n/en.json @@ -85,7 +85,8 @@ "Captcha is not verified!": "Captcha is not verified!", "A server-side error occurred while processing your request! Please try again later.": "A server-side error occurred while processing your request! Please try again later.", "An error occurred while creating your account!": "An error occurred while creating your account!", - "The domain of this email address is blacklisted. Please provide another recovery address.": "The domain of this email address is blacklisted. Please provide another recovery address." + "The domain of this email address is blacklisted. Please provide another recovery address.": "The domain of this email address is blacklisted. Please provide another recovery address.", + "Own a Part of Murena!": "Own a Part of Murena!" }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/es.js b/l10n/es.js index 19fa33c7..940e8f2a 100644 --- a/l10n/es.js +++ b/l10n/es.js @@ -87,6 +87,7 @@ OC.L10N.register( "Captcha is not verified!": "¡Captcha no está verificado!", "A server-side error occurred while processing your request! Please try again later.": "Hubo un error en el servidor al procesar tu solicitud. Por favor, inténtalo más tarde.", "An error occurred while creating your account!": "¡Hubo un error creando tu cuenta!", - "The domain of this email address is blacklisted. Please provide another recovery address.": "El dominio de esta dirección de correo electrónico está en lista negra. Por favor, proporciona otra dirección de recuperación." + "The domain of this email address is blacklisted. Please provide another recovery address.": "El dominio de esta dirección de correo electrónico está en lista negra. Por favor, proporciona otra dirección de recuperación.", + "Own a Part of Murena!": "¡Sea dueño de una parte de Murena!" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/es.json b/l10n/es.json index 867f150d..a935c2d6 100644 --- a/l10n/es.json +++ b/l10n/es.json @@ -86,7 +86,8 @@ "Captcha is not verified!": "¡Captcha no está verificado!", "A server-side error occurred while processing your request! Please try again later.": "Hubo un error en el servidor al procesar tu solicitud. Por favor, inténtalo más tarde.", "An error occurred while creating your account!": "¡Hubo un error creando tu cuenta!", - "The domain of this email address is blacklisted. Please provide another recovery address.": "El dominio de esta dirección de correo electrónico está en lista negra. Por favor, proporciona otra dirección de recuperación." + "The domain of this email address is blacklisted. Please provide another recovery address.": "El dominio de esta dirección de correo electrónico está en lista negra. Por favor, proporciona otra dirección de recuperación.", + "Own a Part of Murena!": "¡Sea dueño de una parte de Murena!" }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/fr.js b/l10n/fr.js index 6efaeeca..36f4bb42 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -86,6 +86,7 @@ OC.L10N.register( "Captcha is not verified!": "Captcha n'est pas vérifié !", "A server-side error occurred while processing your request! Please try again later.": "Erreur du serveur dans la gestion de votre demande ! Merci d'essayer ultérieurement.", "An error occurred while creating your account!": "Une erreur s'est produite lors de la création de votre compte!", - "The domain of this email address is blacklisted. Please provide another recovery address.": "Le domain de cette adresse e-mail est sur liste noire. Merci de bien vouloir fournir une autre adresse de récupération." + "The domain of this email address is blacklisted. Please provide another recovery address.": "Le domain de cette adresse e-mail est sur liste noire. Merci de bien vouloir fournir une autre adresse de récupération.", + "Own a Part of Murena!": "Une partie de Murena vous appartient !" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/fr.json b/l10n/fr.json index 19facc30..a97f62b9 100644 --- a/l10n/fr.json +++ b/l10n/fr.json @@ -85,7 +85,8 @@ "Captcha is not verified!": "Captcha n'est pas vérifié !", "A server-side error occurred while processing your request! Please try again later.": "Erreur du serveur dans la gestion de votre demande ! Merci d'essayer ultérieurement.", "An error occurred while creating your account!": "Une erreur s'est produite lors de la création de votre compte!", - "The domain of this email address is blacklisted. Please provide another recovery address.": "Le domain de cette adresse e-mail est sur liste noire. Merci de bien vouloir fournir une autre adresse de récupération." + "The domain of this email address is blacklisted. Please provide another recovery address.": "Le domain de cette adresse e-mail est sur liste noire. Merci de bien vouloir fournir une autre adresse de récupération.", + "Own a Part of Murena!": "Une partie de Murena vous appartient !" }, "pluralForm": "nplurals=2; plural=(n != 1);" } diff --git a/l10n/it.js b/l10n/it.js index 84c211cd..cafd5717 100644 --- a/l10n/it.js +++ b/l10n/it.js @@ -86,6 +86,7 @@ OC.L10N.register( "Captcha is not verified!": "Il Captcha non è verificato!", "A server-side error occurred while processing your request! Please try again later.": "Si è verificato un errore lato server nel processare la tua richiesta! Ritenta più tardi.", "An error occurred while creating your account!": "Si è verificato un errore nella creazione dell'account!", - "The domain of this email address is blacklisted. Please provide another recovery address.": "Il dominio cui appartiene questo indirizzo e-mail è contenuto in una black list. Inserisci un indirizzo di recovery differente." + "The domain of this email address is blacklisted. Please provide another recovery address.": "Il dominio cui appartiene questo indirizzo e-mail è contenuto in una black list. Inserisci un indirizzo di recovery differente.", + "Own a Part of Murena!": "Possedere una parte di Murena!" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/it.json b/l10n/it.json index 2685c394..57299854 100644 --- a/l10n/it.json +++ b/l10n/it.json @@ -81,7 +81,8 @@ "Captcha is not verified!": "Il Captcha non è verificato!", "A server-side error occurred while processing your request! Please try again later.": "Si è verificato un errore lato server nel processare la tua richiesta! Ritenta più tardi.", "An error occurred while creating your account!": "Si è verificato un errore nella creazione dell'account!", - "The domain of this email address is blacklisted. Please provide another recovery address.": "Il dominio cui appartiene questo indirizzo e-mail è contenuto in una black list. Inserisci un indirizzo di recovery differente." + "The domain of this email address is blacklisted. Please provide another recovery address.": "Il dominio cui appartiene questo indirizzo e-mail è contenuto in una black list. Inserisci un indirizzo di recovery differente.", + "Own a Part of Murena!": "Possedere una parte di Murena!" }, "pluralForm": "nplurals=2; plural=(n != 1);" } -- GitLab From cc8ea9c9b085a5ed1ad18ffad5d44caf9016f13c Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 15:26:33 -0700 Subject: [PATCH 13/16] added translations --- scss/business-banner.scss | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scss/business-banner.scss b/scss/business-banner.scss index 75314a05..ee47853c 100644 --- a/scss/business-banner.scss +++ b/scss/business-banner.scss @@ -24,11 +24,6 @@ p{ margin: 0 auto; } - span { - position: absolute; - right: 20px; - cursor: pointer; - } } a { @@ -38,6 +33,12 @@ font-size: 16px; font-weight: 600; } + + span { + position: absolute; + right: 20px; + cursor: pointer; + } } -- GitLab From c02349098a1d59be359d7d6883e4fee6241e0620 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 15:38:51 -0700 Subject: [PATCH 14/16] removed unncessary code --- .../BeforeTemplateRenderedListener.php | 4 ---- src/business-banner.js | 19 +++++++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lib/Listeners/BeforeTemplateRenderedListener.php b/lib/Listeners/BeforeTemplateRenderedListener.php index 1ccf784b..5023347b 100644 --- a/lib/Listeners/BeforeTemplateRenderedListener.php +++ b/lib/Listeners/BeforeTemplateRenderedListener.php @@ -55,14 +55,10 @@ class BeforeTemplateRenderedListener implements IEventListener { $this->util->addStyle($this->appName, $this->appName . '-userregistration'); } if (($event->getResponse()->getRenderAs() === TemplateResponse::RENDER_AS_USER) && $event->isLoggedIn()) { - // $recoveryEmail = $this->recoveryEmailService->getRecoveryEmail($this->userId); - // if ($recoveryEmail === '') { - // $unverifiedRecoveryEmail = $this->recoveryEmailService->getUnverifiedRecoveryEmail($this->userId); $userLocation = 'USA'; $this->initialState->provideInitialState('userLocation', $userLocation); $this->util->addStyle($this->appName, 'business-banner'); $this->util->addScript($this->appName, $this->appName . '-business-banner'); - // } } } diff --git a/src/business-banner.js b/src/business-banner.js index 829b11d2..29637d8b 100644 --- a/src/business-banner.js +++ b/src/business-banner.js @@ -1,19 +1,21 @@ import { generateUrl } from '@nextcloud/router' -// import { loadState } from '@nextcloud/initial-state' +import { loadState } from '@nextcloud/initial-state' -// const userLocation = loadState('ecloud-accounts', 'userLocation') +const userLocation = loadState('ecloud-accounts', 'userLocation') const APPLICATION_NAME = 'ecloud-accounts' document.addEventListener('DOMContentLoaded', function() { if (!localStorage.getItem('bannerClosed')) { const newDiv = createNewDiv('business-banner') const contentDiv = document.createElement('div') contentDiv.id = 'business-banner-container' - const img = createImageElement(APPLICATION_NAME) + if (userLocation === 'USA') { + const img = createImageElement(APPLICATION_NAME) + contentDiv.appendChild(img) + } const textNode = createTextNode(APPLICATION_NAME) const link = createLinkElement(APPLICATION_NAME) const closeButton = createCloseButton(newDiv) - contentDiv.appendChild(img) contentDiv.appendChild(textNode) newDiv.appendChild(contentDiv) newDiv.appendChild(link) @@ -170,6 +172,15 @@ function createCloseButton(banner) { span.addEventListener('click', function() { banner.style.display = 'none' localStorage.setItem('bannerClosed', 'true') + const bannerHeight = '0' + const topHeight = 'auto' + setTopStyle('#header', bannerHeight) + setMarginTopAndHeight('#content', topHeight) + setMarginTopAndHeight('#content-vue', topHeight) + setTopStyleWhenElementAvailable('#header-menu-user-menu', topHeight) + setTopStyleWhenElementAvailable('#header-menu-notifications', topHeight) + setTopStyle('#header-menu-unified-search', topHeight) + banner.style.height = bannerHeight }) return span } -- GitLab From a333db64c9636e353b3b51e057cdf8070b85d996 Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Mon, 27 May 2024 10:10:59 +0000 Subject: [PATCH 15/16] Apply 3 suggestion(s) to 2 file(s) Co-authored-by: Fahim Salam Chowdhury --- lib/Listeners/BeforeTemplateRenderedListener.php | 2 ++ scss/business-banner.scss | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/Listeners/BeforeTemplateRenderedListener.php b/lib/Listeners/BeforeTemplateRenderedListener.php index 5023347b..6b4b2d54 100644 --- a/lib/Listeners/BeforeTemplateRenderedListener.php +++ b/lib/Listeners/BeforeTemplateRenderedListener.php @@ -30,6 +30,7 @@ class BeforeTemplateRenderedListener implements IEventListener { private const SNAPPYMAIL_AUTOLOGIN_PWD = '1'; private IInitialState $initialState; private $userId; + public function __construct($appName, IUserSession $userSession, IRequest $request, ISession $session, IConfig $config, IAppManager $appManager, Util $util, $userId, IInitialState $initialState) { $this->appName = $appName; $this->userSession = $userSession; @@ -54,6 +55,7 @@ class BeforeTemplateRenderedListener implements IEventListener { if (strpos($pathInfo, '/apps/ecloud-accounts/accounts') !== false) { $this->util->addStyle($this->appName, $this->appName . '-userregistration'); } + if (($event->getResponse()->getRenderAs() === TemplateResponse::RENDER_AS_USER) && $event->isLoggedIn()) { $userLocation = 'USA'; $this->initialState->provideInitialState('userLocation', $userLocation); diff --git a/scss/business-banner.scss b/scss/business-banner.scss index ee47853c..2b4dbf0a 100644 --- a/scss/business-banner.scss +++ b/scss/business-banner.scss @@ -50,6 +50,7 @@ } } } + [data-object-type="business-banner-important"] a.external { background-color: var(--color-primary-element); color: var(--color-primary-element-text); -- GitLab From d77a9fd9d73a077e191983297bed3286b7b18ed4 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 27 May 2024 15:49:32 -0700 Subject: [PATCH 16/16] added new function --- src/business-banner.js | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/business-banner.js b/src/business-banner.js index 29637d8b..f9d0bc3b 100644 --- a/src/business-banner.js +++ b/src/business-banner.js @@ -26,13 +26,7 @@ document.addEventListener('DOMContentLoaded', function() { if (banner) { const bannerHeight = banner.clientHeight + 'px' const topHeight = (banner.clientHeight + 50) + 'px' - setTopStyle('#header', bannerHeight) - setMarginTopAndHeight('#content', topHeight) - setMarginTopAndHeight('#content-vue', topHeight) - setTopStyleWhenElementAvailable('#header-menu-user-menu', topHeight) - setTopStyleWhenElementAvailable('#header-menu-notifications', topHeight) - setTopStyle('#header-menu-unified-search', topHeight) - banner.style.height = bannerHeight + adjustHeaderContent(banner, bannerHeight, topHeight) } } }) @@ -174,13 +168,7 @@ function createCloseButton(banner) { localStorage.setItem('bannerClosed', 'true') const bannerHeight = '0' const topHeight = 'auto' - setTopStyle('#header', bannerHeight) - setMarginTopAndHeight('#content', topHeight) - setMarginTopAndHeight('#content-vue', topHeight) - setTopStyleWhenElementAvailable('#header-menu-user-menu', topHeight) - setTopStyleWhenElementAvailable('#header-menu-notifications', topHeight) - setTopStyle('#header-menu-unified-search', topHeight) - banner.style.height = bannerHeight + adjustHeaderContent(banner, bannerHeight, topHeight) }) return span } @@ -194,3 +182,19 @@ function insertIntoDOM(element) { const parentElement = targetElement.parentNode parentElement.insertBefore(element, targetElement) } + +/** + * + * @param banner + * @param bannerHeight + * @param topHeight + */ +function adjustHeaderContent(banner, bannerHeight, topHeight) { + setTopStyle('#header', bannerHeight) + setMarginTopAndHeight('#content', topHeight) + setMarginTopAndHeight('#content-vue', topHeight) + setTopStyleWhenElementAvailable('#header-menu-user-menu', topHeight) + setTopStyleWhenElementAvailable('#header-menu-notifications', topHeight) + setTopStyle('#header-menu-unified-search', topHeight) + banner.style.height = bannerHeight +} -- GitLab