From 44a2078a9fb0ac6c17cef8082af4373ae9cb37d6 Mon Sep 17 00:00:00 2001 From: Override-6 Date: Sat, 4 Feb 2023 15:55:51 +0100 Subject: [PATCH] minor internal changes to make POST form requests to server's page handlers --- browser | 1 + drone/deliver.sh | 5 +++- www/js/counter.js | 27 ------------------- www/js/utils.js | 0 www/login/index.html | 6 ++--- .../register.html => register/index.html} | 6 ++--- 6 files changed, 11 insertions(+), 34 deletions(-) create mode 120000 browser delete mode 100644 www/js/counter.js create mode 100644 www/js/utils.js rename www/{login/register.html => register/index.html} (93%) diff --git a/browser b/browser new file mode 120000 index 0000000..99a72d8 --- /dev/null +++ b/browser @@ -0,0 +1 @@ +/home/maxime/Projects/WebstormProjects/tactique-basket-app/platforms/browser \ No newline at end of file diff --git a/drone/deliver.sh b/drone/deliver.sh index c6d6791..89e6feb 100755 --- a/drone/deliver.sh +++ b/drone/deliver.sh @@ -33,7 +33,10 @@ case "$TYPE" in ;; "browser") OUT_DIR="platforms/browser/www/" - SERV_DIR="/server/apache/TBasket/" + if [ "$DRONE_BRANCH" = "production" ]; then + SERV_DIR="public_html/basket" + else SERV_DIR="/server/apache/TBasket/" + fi ;; "electron") OUT_DIR="platforms/electron/build" diff --git a/www/js/counter.js b/www/js/counter.js deleted file mode 100644 index abc4a12..0000000 --- a/www/js/counter.js +++ /dev/null @@ -1,27 +0,0 @@ -import {ADDRESS} from "./constants.js"; - -let counter = 0; - -window.onload = () => initCounter(); -window.makeIncrement = () => makeIncrement(); - -function updateText() { - document.getElementById("counter").innerHTML = counter -} - -async function makeIncrement() { - fetch(`http://${ADDRESS}/counter`, {method: 'POST'}) - .then(response => { //TODO verify if it's not an error - counter++ - updateText() - }) -} - -function initCounter() { - fetch(`http://${ADDRESS}/counter`, {method: 'GET'}) - .then(response => response.json()) - .then(json => { - counter = json.value - updateText() - }) -} diff --git a/www/js/utils.js b/www/js/utils.js new file mode 100644 index 0000000..e69de29 diff --git a/www/login/index.html b/www/login/index.html index 75cd2b4..f67b43e 100644 --- a/www/login/index.html +++ b/www/login/index.html @@ -9,7 +9,7 @@
-
+

Se connecter :

Identifiant (eMail) @@ -17,7 +17,7 @@
- +
@@ -39,7 +39,7 @@
J'ai oublier mon mot de passe -
Je n'ai pas encore de compte +
Je n'ai pas encore de compte diff --git a/www/login/register.html b/www/register/index.html similarity index 93% rename from www/login/register.html rename to www/register/index.html index 095a867..dadeaf5 100644 --- a/www/login/register.html +++ b/www/register/index.html @@ -3,13 +3,13 @@ Connection - +
-
+

S'inscrire :

Adresse e-mail @@ -65,7 +65,7 @@
-
J'ai déjà un compte +
J'ai déjà un compte