public_html/layouts/basic/modules/MailIntegration/resources/outlookMessageDetail.min.js.map
{"version":3,"file":"outlookMessageDetail.min.js","sources":["outlookMessageDetail.js"],"sourcesContent":["/* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */\nwindow.MailIntegration_Start = {\n\tiframe: {},\n\t/**\n\t * Set iframe element.\n\t */\n\tsetIframe() {\n\t\tthis.iframe = $('#js-iframe');\n\t},\n\t/**\n\t * Show detail view.\n\t *\n\t * @param {object} mailItem Office mailbox.item\n\t */\n\tshowDetailView(mailItem) {\n\t\tAppConnector.request(\n\t\t\t$.extend(\n\t\t\t\t{\n\t\t\t\t\tmodule: 'MailIntegration',\n\t\t\t\t\tview: 'Iframe',\n\t\t\t\t\tmailFrom: mailItem.from.emailAddress,\n\t\t\t\t\tmailSender: mailItem.sender.emailAddress,\n\t\t\t\t\tmailSubject: mailItem.subject,\n\t\t\t\t\tmailNormalizedSubject: mailItem.normalizedSubject,\n\t\t\t\t\tmailMessageId: mailItem.internetMessageId,\n\t\t\t\t\tmailDateTimeCreated: mailItem.dateTimeCreated.toISOString()\n\t\t\t\t},\n\t\t\t\twindow.PanelParams\n\t\t\t)\n\t\t)\n\t\t\t.done((responseData) => {\n\t\t\t\t$('#page').html(responseData);\n\t\t\t\tthis.registerLogoutEvents();\n\t\t\t})\n\t\t\t.fail((_) => {\n\t\t\t\tOffice.context.mailbox.item.notificationMessages.replaceAsync('error', {\n\t\t\t\t\ttype: 'errorMessage',\n\t\t\t\t\tmessage: app.vtranslate('JS_ERROR')\n\t\t\t\t});\n\t\t\t});\n\t},\n\t/**\n\t * Register logout events\n\t */\n\tregisterLogoutEvents() {\n\t\tthis.setIframe();\n\t\tlet reloadPanelAfterLogout = () => {\n\t\t\tif (!this.isUserLoggedIn()) {\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t};\n\t\tthis.iframe.on('load', reloadPanelAfterLogout);\n\t},\n\t/**\n\t * Register login events.\n\t */\n\tregisterLoginEvents() {\n\t\tlet loader;\n\t\tlet reloadPanelAfterLogin = () => {\n\t\t\tif (this.isUserLoggedIn()) {\n\t\t\t\twindow.location.reload();\n\t\t\t} else {\n\t\t\t\tloader.progressIndicator({ mode: 'hide' });\n\t\t\t}\n\t\t};\n\t\tlet showLoader = () => {\n\t\t\tloader = $.progressIndicator({\n\t\t\t\tblockInfo: { enabled: true },\n\t\t\t\tmessage: false,\n\t\t\t\tblockOverlayCSS: {\n\t\t\t\t\t'background-color': 'white',\n\t\t\t\t\topacity: 1\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\tthis.iframe.on('load', reloadPanelAfterLogin);\n\t\t$(this.iframe[0].contentWindow).on('unload', showLoader);\n\t\tlet src = this.iframe[0].getAttribute('src-a');\n\t\tif (src && this.iframe[0].getAttribute('src') == undefined) {\n\t\t\tthis.iframe[0].removeAttribute('src-a');\n\t\t\tthis.iframe[0].setAttribute('src', src);\n\t\t}\n\t},\n\t/**\n\t * Is user logged in.\n\t *\n\t * @return {boolean}\n\t */\n\tisUserLoggedIn() {\n\t\treturn !(\n\t\t\tthis.iframe[0].contentWindow.document.body.dataset.module == 'Users' &&\n\t\t\tthis.iframe[0].contentWindow.document.body.dataset.view == 'Login'\n\t\t);\n\t},\n\tshowConsole() {\n\t\tlet s = '';\n\t\tlet x = '';\n\t\tfor (var p in navigator) {\n\t\t\ts += p + ' : ' + navigator[p] + '<br>';\n\t\t\tx += p + ' : ' + navigator[p] + '\\n';\n\t\t}\n\t\tconsole.log(x);\n\t\tdocument.body.innerHTML +=\n\t\t\t'<div style=\"position:absolute;width:100%;height:100%;z-index:100;background:#fff;left: 0px; top: 50%;overflow-y: auto;\">' +\n\t\t\ts +\n\t\t\t'</div>';\n\t},\n\t/**\n\t * Register events.\n\t *\n\t * @param {object} mailbox Office mailbox\n\t */\n\tregisterEvents(mailbox) {\n\t\t//this.showConsole();\n\t\tif (!$('.js-exception-error').length) {\n\t\t\tthis.setIframe();\n\t\t\tif (this.iframe.data('view') === 'login') {\n\t\t\t\tthis.registerLoginEvents();\n\t\t\t} else {\n\t\t\t\tthis.showDetailView(mailbox.item);\n\t\t\t}\n\t\t}\n\t},\n\treloadView(data) {\n\t\twindow.MailIntegration_Start.showDetailView(Office.context.mailbox.item);\n\t}\n};\nif (typeof Office === 'undefined') {\n\tapp.showNotify({\n\t\ttitle: app.vtranslate('JS_ERROR'),\n\t\ttype: 'error'\n\t});\n} else {\n\tOffice.onReady((info) => {\n\t\twindow.PanelParams = {\n\t\t\tsource: 'Outlook',\n\t\t\tdevice: Office.context.mailbox.diagnostics.hostName\n\t\t};\n\t\tif (info.host === Office.HostType.Outlook) {\n\t\t\twindow.MailIntegration_Start.registerEvents(Office.context.mailbox);\n\t\t\tOffice.context.mailbox.addHandlerAsync(Office.EventType.ItemChanged, window.MailIntegration_Start.reloadView);\n\t\t}\n\t});\n}\n"],"names":["window","MailIntegration_Start","iframe","setIframe","$","showDetailView","mailItem","_this","AppConnector","request","extend","module","view","mailFrom","from","emailAddress","mailSender","sender","mailSubject","subject","mailNormalizedSubject","normalizedSubject","mailMessageId","internetMessageId","mailDateTimeCreated","dateTimeCreated","toISOString","PanelParams","done","responseData","html","registerLogoutEvents","fail","Office","context","mailbox","item","notificationMessages","replaceAsync","type","message","app","vtranslate","_this2","on","reloadPanelAfterLogout","isUserLoggedIn","location","reload","registerLoginEvents","loader","_this3","reloadPanelAfterLogin","progressIndicator","mode","contentWindow","showLoader","blockInfo","enabled","blockOverlayCSS","\"background-color\"","opacity","src","getAttribute","removeAttribute","setAttribute","document","body","dataset","showConsole","s","x","p","navigator","console","log","innerHTML","registerEvents","length","data","reloadView","showNotify","title","onReady","info","source","device","diagnostics","hostName","host","HostType","Outlook","addHandlerAsync","EventType","ItemChanged"],"mappings":";;AAAA,kKACAA,MAAM,CAACC,qBAAqB,CAAG,CAC9BC,MAAM,CAAE,EAAE;AAEX;AACA,IACCC,SAAS,CAAA,SAAAA,SAAA,EAAG,CACX,I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