From 08fbdd224fc2259aae70d19e51240267c288dcc9 Mon Sep 17 00:00:00 2001 From: Laniran Peter Date: Thu, 15 Feb 2024 15:01:27 +0100 Subject: [PATCH] new var for options --- dist/bundle.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/bundle.js b/dist/bundle.js index 8bc58b9..a6b3be4 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -1 +1 @@ -!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(e.document)return t(e);throw new Error("Okra requires a window with a document")}:t(e)}("undefined"!=typeof window?window:this,function(a,e){var t={loader:null,iframe:null,baseUrl:"https://app.okra.ng",url:"",onSuccess:null,id:null,onClose:null,version:2,init:function(){var e=this;e.addOverlay(),e.setIframe(),e.listen()},removeFunctions:function(e){e=JSON.stringify(e);return JSON.parse(e)},buildWithShortUrl:function(e){var t=this,a=(t.id="okra-iframe-"+Math.floor(1e4*Math.random()),t.url=t.baseUrl+"/?&withOptions=true&isIframe=true",e);a.hideCardOnExit=!0,a.iframeData=!0,a.ref=e.short_url,a.source=e.source||"integration",a.withShortURL=!0,delete a.short_url,t.cleanObj=a,t.onSuccess=e&&e.onSuccess,t.onClose=e&&e.onClose,t.onError=e&&e.onError,t.beforeClose=e&&e.beforeClose,t.onEvent=e&&e.onEvent,t.init()},buildWithOptions:function(e){var t=this,a=(t.id="okra-iframe-"+Math.floor(1e4*Math.random()),e);a.env="production"===e.env?"production":"production-sandbox",a.source=e.source||"integration",a.hideCardOnExit=!0,a.iframeData=!0,a.withOptions=!0,t.cleanObj=a,t.url=t.baseUrl+"/?isIframe=true&withOptions=true",t.onSuccess=e&&e.onSuccess,t.onClose=e&&e.onClose,t.onError=e&&e.onError,t.beforeClose=e&&e.beforeClose,t.onEvent=e&&e.onEvent,t.init()},sendObj:function(e){var t=this,a=!1,n=document.getElementById(t.iframe.id);n&&n.contentWindow&&(n.contentWindow.postMessage(e,t.url),a=!0),n.onload=function(){a||n.contentWindow.postMessage(e,t.url)}},listen:function(){a.addEventListener("message",this)},handleEvent:function(e){var t=this;e.origin.startsWith(t.baseUrl)&&(e&&e.data&&e.data.close?(t.forceClose(t),t.onClose&&t.onClose()):e&&e.data&&e.data&&e.data.success?t.onSuccess&&t.onSuccess(e&&e.data):e&&e.data&&e.data&&e.data.error?t.onError&&t.onError(e&&e.data):e&&e.data&&e.data&&e.data.beforeClose?t.beforeClose&&t.beforeClose(e&&e.data):e&&e.data&&e.data.ifameLoaded?t.cleanObj&&(t.sendObj(t.removeFunctions(t.cleanObj)),t.removeOverlay(t)):e&&e.data&&e.data&&e.data.event&&t.onEvent&&t.onEvent(e&&e.data))},addOverlay:function(){var e=document.createElement("div");e.id="okra-base-"+Math.floor(1e4*Math.random()),e.style.cssText="background-color: rgba(98, 103, 109, 0.54); box-shadow: rgba(0, 0, 0, 0.16) 0px 0px 5px 3px; position: fixed;width: 100%; height: 100%; top: 0; left: 0; z-index: 9999999; overflow: hidden;";(this.loader=e).innerHTML=' Okra Spinner
',document.body.appendChild(e)},removeOverlay:function(e){(e=e||this)&&e.loader&&e.loader.id&&(document.querySelector("#"+e.loader.id).outerHTML="")},setIframe:function(){var e=document.createElement("iframe");e.setAttribute("frameBorder","0"),e.setAttribute("allowtransparency","true"),e.id=this.id,e.name="okra-popup-"+e.id,e.style.cssText="z-index: 9999999999999999999999;background: transparent; border: 0px none transparent;overflow-x: hidden;overflow-y: hidden;margin: 0;padding: 0;-webkit-tap-highlight-color: transparent;-webkit-touch-callout: none;position: fixed;left: 0;top: 0;width: 100%;height: 100%;",e.src=this.url,this.iframe=e,document.body.appendChild(e)},closeIframe:function(e,t){var a;e&&e.outerHTML&&((a=e.previousSibling)&&t.iframe&&(t.iframe="",a.parentElement.removeChild(e)))},forceClose:function(e){var e=this.Okra||e,t=e.iframe;t&&e.closeIframe(t,e),a.removeEventListener("message",e)}},n=a.Okra;return t.noConflict=function(e){return e&&a.Okra===t&&(a.Okra=n),t},void 0===e&&(a.Okra=t),t}); \ No newline at end of file +!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(e.document)return t(e);throw new Error("Okra requires a window with a document")}:t(e)}("undefined"!=typeof window?window:this,function(a,e){var t={loader:null,iframe:null,baseUrl:"https://app.okra.ng",url:"",onSuccess:null,id:null,onClose:null,version:2,init:function(){var e=this;e.addOverlay(),e.setIframe(),e.listen()},removeFunctions:function(e){e=JSON.stringify(e);return JSON.parse(e)},buildWithShortUrl:function(e){var t=this,a=(t.id="okra-iframe-"+Math.floor(1e4*Math.random()),t.url=t.baseUrl+"/?&withOptions=true&isIframe=true",e);a.hideCardOnExit=!0,a.iframeData=!0,a.ref=e.short_url,a.source=e.source||"integration",a.withShortURL=!0,delete a.short_url,t.cleanObj=a,t.onSuccess=e&&e.onSuccess,t.onClose=e&&e.onClose,t.onError=e&&e.onError,t.beforeClose=e&&e.beforeClose,t.onEvent=e&&e.onEvent,t.init()},buildWithOptions:function(e){var t=this,a=(t.id="okra-iframe-"+Math.floor(1e4*Math.random()),e),a=(a.env="production"===e.env?"production":"production-sandbox",a.source=e.source||"integration",a.hideCardOnExit=!0,a.iframeData=!0,a.withOptions=!0,t.cleanObj=a,e&&e.reauth_account&&e.reauth_bank?"&isQuickRUX=true":"");t.url=t.baseUrl+"/?isIframe=true&withOptions=true"+a,t.onSuccess=e&&e.onSuccess,t.onClose=e&&e.onClose,t.onError=e&&e.onError,t.beforeClose=e&&e.beforeClose,t.onEvent=e&&e.onEvent,t.init()},sendObj:function(e){var t=this,a=!1,n=document.getElementById(t.iframe.id);n&&n.contentWindow&&(n.contentWindow.postMessage(e,t.url),a=!0),n.onload=function(){a||n.contentWindow.postMessage(e,t.url)}},listen:function(){a.addEventListener("message",this)},handleEvent:function(e){var t=this;e.origin.startsWith(t.baseUrl)&&(e&&e.data&&e.data.close?(t.forceClose(t),t.onClose&&t.onClose()):e&&e.data&&e.data&&e.data.success?t.onSuccess&&t.onSuccess(e&&e.data):e&&e.data&&e.data&&e.data.error?t.onError&&t.onError(e&&e.data):e&&e.data&&e.data&&e.data.beforeClose?t.beforeClose&&t.beforeClose(e&&e.data):e&&e.data&&e.data.ifameLoaded?t.cleanObj&&(t.sendObj(t.removeFunctions(t.cleanObj)),t.removeOverlay(t)):e&&e.data&&e.data&&e.data.event&&t.onEvent&&t.onEvent(e&&e.data))},addOverlay:function(){var e=document.createElement("div");e.id="okra-base-"+Math.floor(1e4*Math.random()),e.style.cssText="background-color: rgba(98, 103, 109, 0.54); box-shadow: rgba(0, 0, 0, 0.16) 0px 0px 5px 3px; position: fixed;width: 100%; height: 100%; top: 0; left: 0; z-index: 9999999; overflow: hidden;";(this.loader=e).innerHTML=' Okra Spinner
',document.body.appendChild(e)},removeOverlay:function(e){(e=e||this)&&e.loader&&e.loader.id&&(document.querySelector("#"+e.loader.id).outerHTML="")},setIframe:function(){var e=document.createElement("iframe");e.setAttribute("frameBorder","0"),e.setAttribute("allowtransparency","true"),e.id=this.id,e.name="okra-popup-"+e.id,e.style.cssText="z-index: 9999999999999999999999;background: transparent; border: 0px none transparent;overflow-x: hidden;overflow-y: hidden;margin: 0;padding: 0;-webkit-tap-highlight-color: transparent;-webkit-touch-callout: none;position: fixed;left: 0;top: 0;width: 100%;height: 100%;",e.src=this.url,this.iframe=e,document.body.appendChild(e)},closeIframe:function(e,t){var a;e&&e.outerHTML&&(a=e.previousSibling)&&t.iframe&&(t.iframe="",a.parentElement.removeChild(e))},forceClose:function(e){var e=this.Okra||e,t=e.iframe;t&&e.closeIframe(t,e),a.removeEventListener("message",e)}},n=a.Okra;return t.noConflict=function(e){return e&&a.Okra===t&&(a.Okra=n),t},void 0===e&&(a.Okra=t),t}); \ No newline at end of file diff --git a/package.json b/package.json index 8386b66..a434378 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "okra-js", - "version": "2.1.0", + "version": "2.1.1", "description": "JS library for implementing Okra widget", "main": "index.js", "repository": {