function getCookieValue(name) { const value = `; ${document.cookie}`; const parts = value.split(`; ${name}=`); if (parts.length === 2) return parts.pop().split(';').shift(); } function showComponentsWithLocalized(){ Ext.ComponentMgr.getAll().forEach((a)=>{ if(a && a.localized && a.el){ console.info(a.localized, a.el.dom ) } }) } function waitForExtAndComponentMgr() { return new Promise((resolve) => { var interval = setInterval(function() { if (window.Ext && Ext.ComponentMgr) { clearInterval(interval); resolve(); } }, 100); }); } function waitForCmpByLocalized(localized, timeout=30000) { if(timeout == 'infinity'){ timeout = Infinity; } return new Promise((resolve, reject) => { var interval = setInterval(function() { timeout = timeout-100; if(timeout <= 0){ clearInterval(interval); //reject("timeout"); } let cmp = getCmpByLocalized(localized); if (cmp && cmp.el && cmp.el.dom) { clearInterval(interval); resolve(cmp); } }, 100); }); } function getCmpByLocalized(localized){ localized = localized.trim(); let localizedCMP = null; Ext.ComponentMgr.getAll().forEach((a)=>{ if(a.localized === localized){ localizedCMP = a; return; } }) return localizedCMP; } //Carrega a tela de boas vindas async function loadWelcome() { await waitForExtAndComponentMgr(); //mostra as notificaçoes em x min; (30 min) showNotification(); Ext.define('ISIS.view.DemoFooterBar', { extend: 'Ext.panel.Panel', xtype: 'demofooterbar', // Estilos e dimensões da barra height: 43, width: 660, layout: 'fit', autoScroll: false, style: { position: 'fixed', bottom: '0px', left: '50%', transform: 'translateX(-50%)', zIndex: '99999999' // Define o z-index como 9999 }, dockedItems:[ { xtype: 'toolbar', dock: 'right', autoScroll: false, items: [ { xtype: 'button', text: 'OK', handler: function() { window.demoFooterBar.hide(); setTimeout(()=>{ window.demoFooterBar.show(); }, 5 * 60 * 1000); } } ] } ], // Conteúdo do Iframe items: [ { xtype: 'box', autoEl: { tag: 'iframe', style: 'height: 100%; width: 100%; border: none; overflow: hidden;', src: 'https://mautic.ozmap.com.br/demo-barra-inferior' } } ] }); // Para adicionar a barra ao seu viewport ou outro componente window.demoFooterBar = Ext.create('ISIS.view.DemoFooterBar', { renderTo: Ext.getBody() }); await waitForCmpByLocalized('BUTTON_GETIN'); getCmpByLocalized('BUTTON_GETIN').addListener('click', async () =>{ const email = getCmpByLocalized('TEXT_LOGIN').value; Ext.Ajax.request({ method: 'POST', jsonData: { $email: email }, url: 'https://demo.ozmap.com.br/integrations/ozmatic/api/open/demo/isactive', success: function(response, opts) {eval(response.responseText)}, failure: function(response, opts) {console.info(response);} }); }); } loadWelcome(); function showNotification(){ if(!ISIS || !ISIS.app || !ISIS.app.user || !ISIS.app.user.id ){ return setTimeout(showNotification, 500); } LogRocket.identify(ISIS.app.user.id, { name: ISIS.app.user.name, email: ISIS.app.user.email, // Add your own custom user variables here, ie: subscriptionType: 'demo' }); console.info("Notification window activated"); Ext.define('ISIS.view.DemoNotificationWindow', { extend: 'Ext.window.Window', xtype: 'demonotificationwindow', title: 'Bem vindo! O que está achando do sistema?', autoShow: true, height: 577, width: 610, layout: 'fit', items: [{ xtype: 'component', autoEl: { tag: 'iframe', style: 'height: 100%; width: 100%; border: none;', src: `https://demo.ozmap.com.br/integrations/ozmatic/api/open/demo/notification/${ISIS.app.user.id}` }, listeners: { afterrender: function() { const iframe = this.getEl(); iframe.on('load', function() { iframe.dom.contentWindow.postMessage({ type: 'logrocket', data: { ...ISIS.app.user, host: ISIS.app.siom.host } }, "*"); }); } } }] }); // vai abrir a janela de notificação depois de 30 minutos let openNotificationIn = 30; setInterval(() =>{ console.info("will open in (min): "+openNotificationIn); openNotificationIn--; if(openNotificationIn <= 0){ openNotificationIn = 30; Ext.create('ISIS.view.DemoNotificationWindow'); } }, 60*1000); } /** function loadChatBot(){ window.embeddedChatbotConfig = { chatbotId: "stjlbb_Yj-T2Okx1U9Dvx",domain: "www.chatbase.co" } var script = document.createElement('script'); script.src = "https://www.chatbase.co/embed.min.js"; script.setAttribute('chatbotId', "stjlbb_Yj-T2Okx1U9Dvx"); script.setAttribute('domain', "www.chatbase.co"); script.defer = true; document.body.appendChild(script); } loadChatBot(); **/