From bb356c3c836e45e839aa98f813ea6d114fdba5d8 Mon Sep 17 00:00:00 2001 From: Derek Milne Date: Mon, 27 Sep 2021 12:23:37 -0700 Subject: [PATCH 1/3] add .idea to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4f18d42..d56c4f8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ package-lock.json .DS_Store _SpecRunner.html .grunt/ +.idea/ From 542b131f36f1a57e5782109c73d29fd8c2a3ac4b Mon Sep 17 00:00:00 2001 From: Derek Milne Date: Mon, 27 Sep 2021 12:24:51 -0700 Subject: [PATCH 2/3] patch Element.remove --- lib/rxp-hpp.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rxp-hpp.js b/lib/rxp-hpp.js index 192ff75..e98eeeb 100644 --- a/lib/rxp-hpp.js +++ b/lib/rxp-hpp.js @@ -1,6 +1,8 @@ /*jslint browser:true */ Element.prototype.remove = function() { - this.parentElement.removeChild(this); + if (this.parentElement) { + this.parentElement.removeChild(this); + } }; NodeList.prototype.remove = HTMLCollection.prototype.remove = function() { for(var i = this.length - 1; i >= 0; i--) { From ed420a4cc18c28510abe7a2c276170755587e030 Mon Sep 17 00:00:00 2001 From: Derek Milne Date: Mon, 27 Sep 2021 12:25:56 -0700 Subject: [PATCH 3/3] bump version and build --- dist/rxp-js.js | 6 ++++-- dist/rxp-js.min.js | 4 ++-- package.json | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dist/rxp-js.js b/dist/rxp-js.js index 6b7b1ef..c781644 100644 --- a/dist/rxp-js.js +++ b/dist/rxp-js.js @@ -1,10 +1,12 @@ -/*! rxp-js - v1.5.0 - 2021-07-27 +/*! rxp-js - v1.5.1 - 2021-09-27 * The official Realex Payments JS Library * https://github.com/realexpayments/rxp-js * Licensed MIT */ Element.prototype.remove = function() { - this.parentElement.removeChild(this); + if (this.parentElement) { + this.parentElement.removeChild(this); + } }; NodeList.prototype.remove = HTMLCollection.prototype.remove = function() { for(var i = this.length - 1; i >= 0; i--) { diff --git a/dist/rxp-js.min.js b/dist/rxp-js.min.js index 56ad758..09ca3ba 100644 --- a/dist/rxp-js.min.js +++ b/dist/rxp-js.min.js @@ -1,7 +1,7 @@ -/*! rxp-js - v1.5.0 - 2021-07-27 +/*! rxp-js - v1.5.1 - 2021-09-27 * The official Realex Payments JS Library * https://github.com/realexpayments/rxp-js * Licensed MIT */ -Element.prototype.remove=function(){this.parentElement.removeChild(this)},NodeList.prototype.remove=HTMLCollection.prototype.remove=function(){for(var e=this.length-1;e>=0;e--)this[e]&&this[e].parentElement&&this[e].parentElement.removeChild(this[e])};var RealexHpp=function(){"use strict";var e,t,n="https://pay.realexpayments.com/pay",A=A||Math.random().toString(16).substr(2,8),i=360,o=/Windows Phone|IEMobile/.test(navigator.userAgent),r=/Android|iPad|iPhone|iPod/.test(navigator.userAgent),a=function(){return(window.innerWidth>0?window.innerWidth:screen.width)<=i||(window.innerHeight>0?window.innerHeight:screen.Height)<=i},d=o,s=function(){return!o&&(r||a())},c={evtMsg:[],addEvtMsgListener:function(e){this.evtMsg.push({fct:e,opt:!1}),window.addEventListener?window.addEventListener("message",e,!1):window.attachEvent("message",e)},removeOldEvtMsgListener:function(){if(this.evtMsg.length>0){var e=this.evtMsg.pop();window.addEventListener?window.removeEventListener("message",e.fct,e.opt):window.detachEvent("message",e.fct)}},base64:{encode:function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e=escape(e);var n,A,i,o,r,a="",d="",s="",c=0;do{i=(n=e.charCodeAt(c++))>>2,o=(3&n)<<4|(A=e.charCodeAt(c++))>>4,r=(15&A)<<2|(d=e.charCodeAt(c++))>>6,s=63&d,isNaN(A)?r=s=64:isNaN(d)&&(s=64),a=a+t.charAt(i)+t.charAt(o)+t.charAt(r)+t.charAt(s),n=A=d="",i=o=r=s=""}while(c