diff --git a/config.json b/config.json new file mode 100644 index 0000000..e69de29 diff --git a/static/components/stall-details/stall-details.html b/static/components/stall-details/stall-details.html new file mode 100644 index 0000000..e69de29 diff --git a/static/components/stall-details/stall-details.js b/static/components/stall-details/stall-details.js new file mode 100644 index 0000000..5b929e1 --- /dev/null +++ b/static/components/stall-details/stall-details.js @@ -0,0 +1,15 @@ +async function stallDetails(path) { + const template = await loadTemplateAsync(path) + Vue.component('stall-details', { + name: 'stall-details', + template, + + //props: ['stall-id', 'adminkey', 'inkey', 'wallet-options'], + data: function () { + return { + tab: 'info', + relay: null + } + } + }) +} diff --git a/static/js/index.js b/static/js/index.js new file mode 100644 index 0000000..b48f3b1 --- /dev/null +++ b/static/js/index.js @@ -0,0 +1,15 @@ +const stalls = async () => { + Vue.component(VueQrcode.name, VueQrcode) + + await relayDetails('static/components/stall-details/stall-details.html') + + new Vue({ + el: '#vue', + mixins: [windowMixin], + data: function () { + return {} + } + }) +} + +stalls() diff --git a/static/js/utils.js b/static/js/utils.js new file mode 100644 index 0000000..11ebc81 --- /dev/null +++ b/static/js/utils.js @@ -0,0 +1,18 @@ +function loadTemplateAsync(path) { + const result = new Promise(resolve => { + const xhttp = new XMLHttpRequest() + + xhttp.onreadystatechange = function () { + if (this.readyState == 4) { + if (this.status == 200) resolve(this.responseText) + + if (this.status == 404) resolve(`
Page not found: ${path}
`) + } + } + + xhttp.open('GET', path, true) + xhttp.send() + }) + + return result +} diff --git a/templates/nostrmarket/_api_docs.html b/templates/nostrmarket/_api_docs.html new file mode 100644 index 0000000..9ed2f47 --- /dev/null +++ b/templates/nostrmarket/_api_docs.html @@ -0,0 +1,26 @@ + + +

+ Nostr Market
+ + Created by, + motorina0 +

+
+
+ Swagger REST API Documentation +
+
diff --git a/templates/nostrmarket/index.html b/templates/nostrmarket/index.html new file mode 100644 index 0000000..86f0077 --- /dev/null +++ b/templates/nostrmarket/index.html @@ -0,0 +1,29 @@ +{% extends "base.html" %} {% from "macros.jinja" import window_vars with context +%} {% block page %} +
+
+ + section + +
+ +
+ + +
+ {{SITE_TITLE}} Nostr Market Extension +
+
+ + + {% include "nostrmarket/_api_docs.html" %} + +
+
+
+{% endblock%}{% block scripts %} {{ window_vars(user) }} + + + + +{% endblock %}