summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-06-01 12:22:04 -0300
committerSebastian <sebasjm@gmail.com>2023-06-01 12:24:06 -0300
commit67fe4e8c20dd810aa6bf124c457bf8161ce56589 (patch)
treeaa33b12a1c2d67447876de7849e98125600f7701 /packages/taler-wallet-webextension/src
parentb4966b33f4e806a4009c9a208b82e8f8d1ab14dc (diff)
downloadwallet-core-67fe4e8c20dd810aa6bf124c457bf8161ce56589.tar.gz
wallet-core-67fe4e8c20dd810aa6bf124c457bf8161ce56589.tar.bz2
wallet-core-67fe4e8c20dd810aa6bf124c457bf8161ce56589.zip
move folder to catch up the reload on save
Diffstat (limited to 'packages/taler-wallet-webextension/src')
-rw-r--r--packages/taler-wallet-webextension/src/spa/index.html93
-rw-r--r--packages/taler-wallet-webextension/src/spa/manifest.json82
-rw-r--r--packages/taler-wallet-webextension/src/spa/popup.html39
-rw-r--r--packages/taler-wallet-webextension/src/spa/service_worker.js11
-rw-r--r--packages/taler-wallet-webextension/src/spa/static/font/import.css35
-rw-r--r--packages/taler-wallet-webextension/src/spa/static/font/roboto-italic-400.ttfbin0 -> 130872 bytes
-rw-r--r--packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-300.tffbin0 -> 128256 bytes
-rw-r--r--packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-400.ttfbin0 -> 129584 bytes
-rw-r--r--packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-500.ttfbin0 -> 129768 bytes
-rw-r--r--packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-700.ttfbin0 -> 128676 bytes
-rw-r--r--packages/taler-wallet-webextension/src/spa/stories.html12
-rw-r--r--packages/taler-wallet-webextension/src/spa/tests.html23
-rw-r--r--packages/taler-wallet-webextension/src/spa/wallet.html29
13 files changed, 324 insertions, 0 deletions
diff --git a/packages/taler-wallet-webextension/src/spa/index.html b/packages/taler-wallet-webextension/src/spa/index.html
new file mode 100644
index 000000000..f352c7bf4
--- /dev/null
+++ b/packages/taler-wallet-webextension/src/spa/index.html
@@ -0,0 +1,93 @@
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <link rel="manifest" href="manifest.json" />
+ <style>
+ .overlay {
+ position: absolute;
+ top: 0px;
+ display: none;
+width: 100%;
+height: 100%;
+background-color: rgba(0,0,0,0.5);
+color:white;
+justify-content: center;
+ }
+ .overlay > iframe {
+ margin: auto;
+ }
+ </style>
+ </head>
+ <body>
+ <script>
+ function openPopup() {
+ document.getElementById("popup-overlay").style.display = "flex"
+ window.frames["popup"].location = "popup.html";
+ window.frames["popup"]
+ }
+ function closePopup() {
+ document.getElementById("popup-overlay").style.display = "none"
+ }
+ function redirectWallet(url) {
+ window.frames["wallet"].location = url
+ }
+ function openWallet() {
+ redirectWallet("wallet.html")
+ }
+ function closeWallet() {
+ redirectWallet("about:blank")
+ }
+ function openPage() {
+ window.frames["other"].location =
+ document.getElementById("page-url").value;
+ }
+ </script>
+ <button value="asd" onclick="openPopup()">open popup</button>
+ <button value="asd" onclick="closeWallet();openWallet()">
+ reload wallet page
+ </button>
+<br />
+ <iframe
+ id="wallet-window"
+ name="wallet"
+ src="wallet.html"
+ width="1000"
+ height="100%"
+ >
+ <input id="page-url" type="text" />
+ <button onclick="openPage()">open</button>
+ <!-- <a
+ href='javascript:void(window.frames["other"].location = "http://bank.taler:5882")'
+ >open local bank</a
+ >
+ <hr />
+ <iframe
+ id="other-window"
+ name="other"
+ src="http://bank.taler:5882"
+ width="100%"
+ height="325"
+ >
+ </iframe> -->
+ <hr />
+ <div class="overlay" id="popup-overlay">
+ <iframe
+ id="popup-window"
+ name="popup"
+ src="about:blank"
+ width="500"
+ height="325"
+ >
+ </iframe>
+ </div>
+ <hr />
+ </iframe>
+ <!-- <hr />
+ <iframe src="tests.html" name="wallet" width="800" height="100%"> </iframe> -->
+ <!-- <hr />
+ <iframe src="stories.html" name="wallet" width="800" height="100%"> -->
+ </iframe>
+ <hr />
+ <script type="module" src="background.dev.js"></script>
+ </body>
+</html>
diff --git a/packages/taler-wallet-webextension/src/spa/manifest.json b/packages/taler-wallet-webextension/src/spa/manifest.json
new file mode 100644
index 000000000..d871bf7e8
--- /dev/null
+++ b/packages/taler-wallet-webextension/src/spa/manifest.json
@@ -0,0 +1,82 @@
+{
+ "name": "GNU Taler Wallet",
+ "description": "Privacy preserving and transparent payments",
+ "author": "GNU Taler Developers",
+ "version": "0.9.3.13",
+ "version_name": "0.9.3-dev.13",
+ "icons": {
+ "16": "static/img/taler-logo-16.png",
+ "19": "static/img/taler-logo-19.png",
+ "32": "static/img/taler-logo-32.png",
+ "38": "static/img/taler-logo-38.png",
+ "48": "static/img/taler-logo-48.png",
+ "64": "static/img/taler-logo-64.png",
+ "128": "static/img/taler-logo-128.png",
+ "256": "static/img/taler-logo-256.png",
+ "512": "static/img/taler-logo-512.png"
+ },
+ "manifest_version": 3,
+ "minimum_chrome_version": "88",
+ "permissions": [
+ "unlimitedStorage",
+ "storage",
+ "activeTab",
+ "scripting",
+ "declarativeContent",
+ "alarms"
+ ],
+ "commands": {
+ "_execute_action": {
+ "suggested_key": {
+ "default": "Alt+W"
+ }
+ }
+ },
+ "content_scripts": [
+ {
+ "id": "taler-wallet-interaction",
+ "matches": [
+ "file://*/*",
+ "http://*/*",
+ "https://*/*"
+ ],
+ "js": [
+ "dist/taler-wallet-interaction-loader.js"
+ ]
+ }
+ ],
+ "web_accessible_resources": [
+ {
+ "resources": [
+ "static/wallet.html",
+ "dist/taler-wallet-interaction-loader.js.map",
+ "dist/taler-wallet-interaction-loader.js",
+ "dist/taler-wallet-interaction-support.js.map",
+ "dist/taler-wallet-interaction-support.js"
+ ],
+ "matches": [
+ "https://*/*",
+ "http://*/*",
+ "file://*/*"
+ ]
+ }
+ ],
+ "action": {
+ "default_icon": {
+ "16": "static/img/taler-logo-16.png",
+ "19": "static/img/taler-logo-19.png",
+ "32": "static/img/taler-logo-32.png",
+ "38": "static/img/taler-logo-38.png",
+ "48": "static/img/taler-logo-48.png",
+ "64": "static/img/taler-logo-64.png",
+ "128": "static/img/taler-logo-128.png",
+ "256": "static/img/taler-logo-256.png",
+ "512": "static/img/taler-logo-512.png"
+ },
+ "default_title": "GNU Taler Wallet",
+ "default_popup": "static/popup.html"
+ },
+ "background": {
+ "service_worker": "service_worker.js"
+ }
+}
diff --git a/packages/taler-wallet-webextension/src/spa/popup.html b/packages/taler-wallet-webextension/src/spa/popup.html
new file mode 100644
index 000000000..34d1d019c
--- /dev/null
+++ b/packages/taler-wallet-webextension/src/spa/popup.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <style>
+ html {
+ font-family: sans-serif; /* 1 */
+ }
+ body {
+ margin: 0;
+ }
+ </style>
+ <style>
+ html {
+ }
+ h1 {
+ font-size: 2em;
+ }
+ input {
+ font: inherit;
+ }
+ body {
+ margin: 0;
+ font-size: 100%;
+ padding: 0;
+ overflow: hidden;
+ background-color: #f8faf7;
+ font-family: Arial, Helvetica, sans-serif;
+ }
+ </style>
+
+ <link rel="stylesheet" type="text/css" href="popupEntryPoint.dev.css" />
+ <script type="module" src="popupEntryPoint.dev.js"></script>
+ </head>
+
+ <body>
+ <taler-popup id="container" class="popup-container"></taler-popup>
+ </body>
+</html>
diff --git a/packages/taler-wallet-webextension/src/spa/service_worker.js b/packages/taler-wallet-webextension/src/spa/service_worker.js
new file mode 100644
index 000000000..38064e245
--- /dev/null
+++ b/packages/taler-wallet-webextension/src/spa/service_worker.js
@@ -0,0 +1,11 @@
+/* eslint-disable no-undef */
+/**
+ * Wrapper to catch any initialization error and show it in the logs
+ */
+try {
+ importScripts("dist/background.js");
+ self.skipWaiting();
+ console.log("SERVICE WORKER init: ok");
+} catch (e) {
+ console.error("SERVICE WORKER failed:", e);
+}
diff --git a/packages/taler-wallet-webextension/src/spa/static/font/import.css b/packages/taler-wallet-webextension/src/spa/static/font/import.css
new file mode 100644
index 000000000..05edddb51
--- /dev/null
+++ b/packages/taler-wallet-webextension/src/spa/static/font/import.css
@@ -0,0 +1,35 @@
+@font-face {
+ font-family: 'Roboto';
+ font-style: italic;
+ font-weight: 400;
+ font-display: swap;
+ src: url(/static/font/roboto-italic-400.ttf) format('truetype');
+}
+@font-face {
+ font-family: 'Roboto';
+ font-style: normal;
+ font-weight: 300;
+ font-display: swap;
+ src: url(/static/font/roboto-normal-300.ttf) format('truetype');
+}
+@font-face {
+ font-family: 'Roboto';
+ font-style: normal;
+ font-weight: 400;
+ font-display: swap;
+ src: url(/static/font/roboto-normal-400.ttf) format('truetype');
+}
+@font-face {
+ font-family: 'Roboto';
+ font-style: normal;
+ font-weight: 500;
+ font-display: swap;
+ src: url(/static/font/roboto-normal-500.ttf) format('truetype');
+}
+@font-face {
+ font-family: 'Roboto';
+ font-style: normal;
+ font-weight: 700;
+ font-display: swap;
+ src: url(/static/font/roboto-normal-700.ttf) format('truetype');
+}
diff --git a/packages/taler-wallet-webextension/src/spa/static/font/roboto-italic-400.ttf b/packages/taler-wallet-webextension/src/spa/static/font/roboto-italic-400.ttf
new file mode 100644
index 000000000..1e746d17f
--- /dev/null
+++ b/packages/taler-wallet-webextension/src/spa/static/font/roboto-italic-400.ttf
Binary files differ
diff --git a/packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-300.tff b/packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-300.tff
new file mode 100644
index 000000000..ec821b577
--- /dev/null
+++ b/packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-300.tff
Binary files differ
diff --git a/packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-400.ttf b/packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-400.ttf
new file mode 100644
index 000000000..9d4b32b47
--- /dev/null
+++ b/packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-400.ttf
Binary files differ
diff --git a/packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-500.ttf b/packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-500.ttf
new file mode 100644
index 000000000..4b4e1c656
--- /dev/null
+++ b/packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-500.ttf
Binary files differ
diff --git a/packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-700.ttf b/packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-700.ttf
new file mode 100644
index 000000000..58d877c58
--- /dev/null
+++ b/packages/taler-wallet-webextension/src/spa/static/font/roboto-normal-700.ttf
Binary files differ
diff --git a/packages/taler-wallet-webextension/src/spa/stories.html b/packages/taler-wallet-webextension/src/spa/stories.html
new file mode 100644
index 000000000..f18307669
--- /dev/null
+++ b/packages/taler-wallet-webextension/src/spa/stories.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stories</title>
+ <link rel="stylesheet" type="text/css" href="stories.css" />
+ <link rel="stylesheet" type="text/css" href="/static/font/import.css" />
+ <script src="stories.js"></script>
+ </head>
+ <body>
+ <taler-stories id="container"></taler-stories>
+ </body>
+</html>
diff --git a/packages/taler-wallet-webextension/src/spa/tests.html b/packages/taler-wallet-webextension/src/spa/tests.html
new file mode 100644
index 000000000..383f13d03
--- /dev/null
+++ b/packages/taler-wallet-webextension/src/spa/tests.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Mocha Tests</title>
+ <link rel="stylesheet" href="/mocha.css" />
+ </head>
+ <body>
+ <div id="mocha"></div>
+ <script src="/mocha.js"></script>
+ <script>
+ mocha.setup("bdd");
+ </script>
+
+ <!-- load code you want to test here -->
+ <script src="stories.test.js"></script>
+ <script src="hooks/useTalerActionURL.test.js"></script>
+ <!-- load your test files here -->
+
+ <script>
+ mocha.run();
+ </script>
+ </body>
+</html>
diff --git a/packages/taler-wallet-webextension/src/spa/wallet.html b/packages/taler-wallet-webextension/src/spa/wallet.html
new file mode 100644
index 000000000..366615dff
--- /dev/null
+++ b/packages/taler-wallet-webextension/src/spa/wallet.html
@@ -0,0 +1,29 @@
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <link rel="stylesheet" type="text/css" href="walletEntryPoint.dev.css" />
+ <style>
+ html {
+ font-family: sans-serif; /* 1 */
+ }
+ h1 {
+ font-size: 2em;
+ }
+ input {
+ font: inherit;
+ }
+ body {
+ margin: 0;
+ font-size: 100%;
+ padding: 0;
+ background-color: #f8faf7;
+ font-family: Arial, Helvetica, sans-serif;
+ }
+ </style>
+ <script type="module" src="walletEntryPoint.dev.js"></script>
+ </head>
+
+ <body>
+ <div id="container" class="wallet-container"></div>
+ </body>
+</html>