'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ""+ "
"+ translation.alreadyRegisterd +"
"+ "
" + emailID +" "+ translation.alreadyRegisterdErrorMsg +""+ ""+ translation.alreadyRegisterdLoginMsg +"
"+ "
"+ ""+ "
"+ translation.resetPassword +"
"; document.body.appendChild(errorPopup); document.getElementById('error-login').onclick = function() { redirection('login'); } document.getElementById('overlay-reset-password').onclick = function() { sessionStorage.setItem('overlayResetpassword',true); redirection('register'); } } function increaseHeight() { var totalHeight = iFrameDocument.querySelector(".new-register-flow-container").offsetHeight; if(totalHeight > 440) { var continueButton = iFrameDocument.querySelector(".continue-button-container"); if(continueButton) { continueButton.classList.remove("h56"); continueButton.classList.add("h37"); } let inputfieldContainer = iFrameDocument.querySelector(".new-register-main"); !!inputfieldContainer && inputfieldContainer.classList.add("padding-bottom-10"); iFrame.style.height = totalHeight + 28 +'px' ; } else { document.querySelector("#iframeContainer").style["margin-top"] = '2.5em' iFrame.style.height = totalHeight + 61 +'px' ; } } function attachIframeLoadEvent() { iFrame = document.getElementById("signupOverlayIframe"); if (!iFrame) return; iFrame.onload = function() { iFrameDocument = iFrame.contentDocument; if(!iFrameDocument) return; }; } function close() { if(!!sessionStorage.getItem('HideIframe')){ _popup.style.display = "none"; }else{ _popup.remove(); } } function inIframe() { try { return window.location !== window.parent.location; //check page is loaded in IFrame or not } catch (e) { return true; } }; // Show notification after login/signup function signinNotification(translations) { const div = document.createElement("div"); div.className = "signin-notification"; var notificationHtml = "

" + translations["notification-title"] + "

" + "

" + "" + translations["notification-sub-title"] + "

"; div.innerHTML = notificationHtml; var header = document.getElementsByTagName("header")[0]; if (!!header) { header.after(div); sessionStorage.removeItem('loggedInByOverlay'); if (!!div) { // on change of url notification will get removed window.addEventListener('popstate', function () { div.remove(); }); } } } // create iframe and attach it to current page dom loadSignUpOverlay = function () { _popup.style.display = "flex"; getIframeDocument() removeSpinner(); increaseHeight(); logAMplitudeEvent(); iframeLoaded = true; // flag to show iframe is loaded }; function getIframeDocument(){ iFrame = document.getElementById("signupOverlayIframe"); if (!iFrame) return; iFrameDocument = iFrame.contentDocument; if(!iFrameDocument) return; } function removeSpinner() { var spinnerSpace = iFrameDocument.querySelector(".spinner-wrapper"); if(!!spinnerSpace) { spinnerSpace.remove(); } } function logAMplitudeEvent() { var eventType = sessionStorage.getItem("overlay_Event"); var eventInfo = sessionStorage.getItem("overlay_EventInfo") || '{}'; eventInfo = JSON.parse(eventInfo); if(eventType && eventInfo) { amplitude.getInstance().logEvent(eventType, eventInfo); } sessionStorage.removeItem("overlay_Event"); sessionStorage.removeItem("overlay_EventInfo"); } // on ifram page change callback from individual contained pages _window.onSignUpOverlayPageChange = function (pageName) { pageName = pageName.toLowerCase(); if (pageName === "smo" || pageName === "history" || pageName === "receiver") { sessionStorage.setItem("loggedInByOverlay", 'true'); _popup.style.display = "none"; parent.location.reload(); } else if (pageName === 'verify-email-overlay') { const overlayFrame = document.getElementById('popupContainer'); if (overlayFrame) { overlayFrame.classList.add('emailPinPopUp'); } logAMplitudeEvent(); } else if(pageName === 'redirect-to-login') { redirection('login'); } else if(pageName == 'existing-email') { addErrorpopup(); return; } else if(pageName == 'increase-height') { increaseHeightIframe(15); return; } else if(pageName =="register") { if(!sessionStorage.getItem('disableCallback')) { sessionStorage.setItem('signupOverlayTriggered', 'true'); loadSignUpOverlay(); } } }; function increaseHeightIframe(height) { var totalHeight = iFrame.offsetHeight; iFrame.style.height = totalHeight + height +'px' ; } function isUsserLoggedIn() { var isLoggedIn = false try{ var app = sessionStorage.getItem('app') || "{}"; app = JSON.parse(app); if(app.sender && app.sender.isLoggedIn){ isLoggedIn = true; } } catch (e) { // No need to handle } return isLoggedIn; } function redirection(page) { window.parent.location.href = getPageUrl(page); } function redirectToResetPassword() { sessionStorage.setItem("overlayResetpassword"); window.parent.location.href = getPageUrl('register'); } function isSmoOrNTPage() { var pageUrl = window.location.href ; var showNotification = false ; if(pageUrl.includes('start') || pageUrl.includes('.html')) { showNotification = true; } return showNotification; } function fetchTranslation() { storageKey = 'translate_web_wucom_'+ currentCountry +'_'+ current语言; translations = sessionStorage.getItem(storageKey) ? JSON.parse(sessionStorage.getItem(storageKey))['signup-overlay'] : null; return translations; } // display notification function successfullRegistrationNotification() { get语言(); getCountry(); translations = fetchTranslation(); if (isSmoOrNTPage() && sessionStorage.getItem('loggedInByOverlay') === 'true' && translations) { signinNotification(translations); } } document.addEventListener('click', function(event) { if(!!_popup){ var isClickInsideElement = _popup.contains(event.target); if (isClickInsideElement) { sessionStorage.setItem("outsideClickOverlay","true"); close() //close iframe if click is outside iframe } } }); } catch(e) { console.log(e); } successfullRegistrationNotification(); })(window);