diff --git a/__pycache__/__init__.cpython-39.pyc b/__pycache__/__init__.cpython-39.pyc index 68e4005..65868ff 100644 Binary files a/__pycache__/__init__.cpython-39.pyc and b/__pycache__/__init__.cpython-39.pyc differ diff --git a/__pycache__/crud.cpython-39.pyc b/__pycache__/crud.cpython-39.pyc index fef9c1a..bf7857d 100644 Binary files a/__pycache__/crud.cpython-39.pyc and b/__pycache__/crud.cpython-39.pyc differ diff --git a/__pycache__/lnurl.cpython-39.pyc b/__pycache__/lnurl.cpython-39.pyc index 51da517..b1abb96 100644 Binary files a/__pycache__/lnurl.cpython-39.pyc and b/__pycache__/lnurl.cpython-39.pyc differ diff --git a/__pycache__/migrations.cpython-39.pyc b/__pycache__/migrations.cpython-39.pyc index c7ec11a..00c79e2 100644 Binary files a/__pycache__/migrations.cpython-39.pyc and b/__pycache__/migrations.cpython-39.pyc differ diff --git a/__pycache__/models.cpython-39.pyc b/__pycache__/models.cpython-39.pyc index 7a67f3a..0212888 100644 Binary files a/__pycache__/models.cpython-39.pyc and b/__pycache__/models.cpython-39.pyc differ diff --git a/__pycache__/tasks.cpython-39.pyc b/__pycache__/tasks.cpython-39.pyc index 47235a1..bf5d020 100644 Binary files a/__pycache__/tasks.cpython-39.pyc and b/__pycache__/tasks.cpython-39.pyc differ diff --git a/__pycache__/views.cpython-39.pyc b/__pycache__/views.cpython-39.pyc index f3e2fee..199c8a5 100644 Binary files a/__pycache__/views.cpython-39.pyc and b/__pycache__/views.cpython-39.pyc differ diff --git a/__pycache__/views_api.cpython-39.pyc b/__pycache__/views_api.cpython-39.pyc index 23a3239..666151c 100644 Binary files a/__pycache__/views_api.cpython-39.pyc and b/__pycache__/views_api.cpython-39.pyc differ diff --git a/config.json b/config.json index 4750a20..4a75bb2 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,7 @@ { "name": "MyExtension", "short_description": "Minimal extension to build on", - "tile": "/myextension/static/myextension.png", + "tile": "/myextension/static/image/myextension.png", "contributors": ["arcbtc"], "min_lnbits_version": "0.0.1" } diff --git a/static/myextension.png b/static/image/myextension.png similarity index 100% rename from static/myextension.png rename to static/image/myextension.png diff --git a/templates/myextension/myextension.html b/templates/myextension/myextension.html index fd51eb1..c4c9cfe 100644 --- a/templates/myextension/myextension.html +++ b/templates/myextension/myextension.html @@ -19,13 +19,6 @@ -
-
- lnurlpay - -
-
-
@@ -36,7 +29,7 @@ Moat extensions have a public page that can be shared (this page will still be accessible even if you have restricted access to your LNbits install). -
+

In this example when a user pays the LNURLpay it triggers an event via a websocket waiting for the payment.

.

@@ -56,70 +49,16 @@ mixins: [windowMixin], data: function () { return { - qrValue: '', + qrValue: '{{myextension_id}}', myExtensionID: '' } }, created: function () { - this.qrValue = '{{lnurlpay}}' - this.myExtensionID = '{{myextension_id}}' - this.connectWebocket(this.myExtensionID) + // Will trigger payment reaction when payment received, sent from tasks.py + eventReactionWebocket(this.myExtensionID) }, methods: { - makeItRain() { - document.getElementById("vue").disabled = true - var end = Date.now() + (2 * 1000) - var colors = ['#FFD700', '#ffffff'] - function frame() { - confetti({ - particleCount: 2, - angle: 60, - spread: 55, - origin: { x: 0 }, - colors: colors, - zIndex: 999999 - }) - confetti({ - particleCount: 2, - angle: 120, - spread: 55, - origin: { x: 1 }, - colors: colors, - zIndex: 999999 - }) - if (Date.now() < end) { - requestAnimationFrame(frame) - } - else { - document.getElementById("vue").disabled = false - } - } - frame() - }, - connectWebocket(id) { - ////////////////////////////////////////////////// - ///wait for pay action to happen and do a thing//// - /////////////////////////////////////////////////// - self = this - if (location.protocol !== 'http:') { - localUrl = - 'wss://' + - location.host + - '/api/v1/ws/' + - id - } else { - localUrl = - 'ws://' + - location.host + - '/api/v1/ws/' + - id - } - this.connection = new WebSocket(localUrl) - this.connection.onmessage = function (e) { - self.makeItRain() - } - } - }, + } }) {% endblock %} \ No newline at end of file