Compare commits

...

5 Commits

Author SHA1 Message Date
bumi 7cac6ba7fc Update rice box 2020-10-24 18:12:37 +02:00
bumi ad6f109c95 Fix widget usage 2020-10-24 18:03:10 +02:00
bumi cb0386059a Working example 2020-10-24 18:02:55 +02:00
bumi 559838d49a
Update tipping.html 2020-10-24 15:52:43 +02:00
bumi d185001b22
Update README.md 2020-10-24 15:33:58 +02:00
4 changed files with 25 additions and 15 deletions

View File

@ -116,6 +116,12 @@ Use `go run` to ron the service locally:
$ go run lnme.go --address=127.0.0.1:10009 --cert=/home/bitcoin/lightning/tls.cert --macaroon=/home/bitcoin/lightning/invoice.macaroon
## Build
LnMe uses [go.rice](https://github.com/GeertJohan/go.rice) to embed assets (HTML, JS, and CSS files). run `rice embed-go`
$ rice embed-go
$ go build
## Contributing

View File

@ -1,12 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script lntip-host="http://localhost:1323" src="http://localhost:1323/static/lntip.js" id="lntip-script"></script>
<head>
<meta charset="UTF-8">
<title>LnMe</title>
</head>
<body>
<a href="#" onclick="javascript:new LnTip({ value: 1000, memo: 'thanks' }).request();return false;">Tip me</a>
</body>
<script data-lnme-base-url="https://lnme.michaelbumann.com" src="https://lnme.michaelbumann.com/lnme/lnme.js"></script>
<a href="#" onclick="javascript:new LnMe({ value: 100, memo: 'Thanks!' }).request();return false;">
Send me some sats
</a>
</body>
</html>

View File

@ -32,7 +32,7 @@ d=0;d<a;d+=1)for(var g=0;g<a;g+=1){for(var e=0,t=b.a(d,g),p=-1;1>=p;p+=1)if(!(0>
typeof e)throw Error("bad rs block @ typeNumber:"+b+"/errorCorrectLevel:"+a);b=e.length/3;a=[];for(var d=0;d<b;d+=1)for(var g=e[3*d],h=e[3*d+1],t=e[3*d+2],p=0;p<g;p+=1){var q=t,f={};f.o=h;f.j=q;a.push(f)}return a}};return e}();return C}());
// no static class variables because those are not supported on mobile
var paymentRequestTemplate = `<div id="lnme-wrapper" class="lnme-wrapper">
var LnMePaymentRequestTemplate = `<div id="lnme-wrapper" class="lnme-wrapper">
<h1 class="lnme-headline"><span class="lnme-memo"><span></h1>
<h2 class="lnme-headline"><span class="lnme-value"></span> Sats</h2>
<div class="lnme-qrcode"></div>
@ -43,13 +43,13 @@ var paymentRequestTemplate = `<div id="lnme-wrapper" class="lnme-wrapper">
</div>
</div>
</div>`;
var paymentConfirmationTemplate = `<h1 class="lnme-header lnme-confirmation">Payment sent!</h1>`;
var LnMePaymentConfirmationTemplate = `<h1 class="lnme-header lnme-confirmation">Payment sent!</h1>`;
class LnMe {
constructor(options) {
options = options || {};
this.script = document.getElementById('lnme-script');
this.script = document.querySelector("[src*='lnme.js']");
if (options.baseURL) {
this.baseURL = options.baseURL;
} else if (this.script && this.script.dataset.lnmeBaseUrl) {

File diff suppressed because one or more lines are too long