From 8eb49fc460cee4625819058b02c015e19accbbea Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Sun, 18 Oct 2020 19:45:09 +0200 Subject: [PATCH] Fix JS for mobile/iOS seems static class variables are not supported --- files/assets/lnme.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/files/assets/lnme.js b/files/assets/lnme.js index 5454620..bbebe0b 100644 --- a/files/assets/lnme.js +++ b/files/assets/lnme.js @@ -1,3 +1,4 @@ +'use strict'; /*! https://github.com/robiveli/jpopup */ !function(e,n){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define([],function(){return e.jPopup=n()}):"object"==typeof module&&module.exports?module.exports=n():e.jPopup=n()}(this,function(){"use strict";var n,o,t=function(){var e=0\n \n
'.concat(e,"
\n ")))},s=function(e){1==e?window.location.hash=o:window.history.back()},d=function(e){27==e.keyCode&&t.prototype.close(!0)},c=function(){window.location.hash!==o&&t.prototype.close(!1)},a=function(){document.getElementsByClassName("jCloseBtn")[0].addEventListener("click",function(){t.prototype.close(!0)}),window.addEventListener("keydown",d),1==n&&window.addEventListener("hashchange",c)},u=document.querySelector("html");return t.prototype={close:function(e){u.classList.add("jPopupClosed"),1==n&&(e&&s(!1),window.removeEventListener("hashchange",c)),window.removeEventListener("keydown",d),document.getElementsByClassName("jPopup")[0].addEventListener("animationend",function(e){e.target.parentNode.removeChild(this),u.classList.remove("jPopupClosed"),u.classList.remove("jPopupOpen")})},open:function(e){t(e)}},t}); @@ -30,9 +31,8 @@ d=0;d=p;p+=1)if(!(0> [39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e={I:function(b,a){var e=c(b,a);if("undefined"== typeof e)throw Error("bad rs block @ typeNumber:"+b+"/errorCorrectLevel:"+a);b=e.length/3;a=[];for(var d=0;d +// no static class variables because those are not supported on mobile +var paymentRequestTemplate = `

Sats

@@ -43,7 +43,9 @@ class LnMe {
`; - static paymentConfirmationTemplate = `

Payment sent!

`; +var paymentConfirmationTemplate = `

Payment sent!

`; + +class LnMe { constructor(options) { this.script = document.getElementById('lnme-script'); @@ -65,7 +67,6 @@ class LnMe { if (document.getElementById('lnme-style')) { return; } // get the CSS file from the same source as the JS widget file let source = this.script.src.replace(/\.js$/, ".css"); - console.log(source); let head = document.getElementsByTagName('head')[0]; let css = document.createElement('link'); css.id = "lnme-style"; @@ -133,7 +134,7 @@ class LnMe { } showPaymentRequest() { - this.render(LnMe.paymentRequestTemplate); + this.render(LnMePaymentRequestTemplate); this.populatePaymentRequest() return Promise.resolve(); // be compatible to payWithWebln() } @@ -199,6 +200,6 @@ class LnMe { } thanks() { - this.target.innerHTML = LnMe.paymentConfirmationTemplate; + this.target.innerHTML = LnMePaymentConfirmationTemplate; } }