From bf23bee2827d9197b646168c1a6606c13f890ed4 Mon Sep 17 00:00:00 2001 From: Yannick Francois Date: Sat, 20 Oct 2018 00:12:58 +0200 Subject: [PATCH] Changement du nom, sans javascript, ou avec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sans javascript, il manque encore l'aspect formulaire et enregistrement serveur à chaque passage de page --- public/name_form.html | 28 ---------------------------- public/parametres.html | 2 +- public/script.js | 18 +++++++++++++----- public/style.css | 2 ++ 4 files changed, 16 insertions(+), 34 deletions(-) delete mode 100644 public/name_form.html diff --git a/public/name_form.html b/public/name_form.html deleted file mode 100644 index d3e44290..00000000 --- a/public/name_form.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - Framadate - - - - - - - - - - -
- - -

Par exemple : Stéphane ou Caroline

-
- - - diff --git a/public/parametres.html b/public/parametres.html index 9a3996dc..266eee0f 100644 --- a/public/parametres.html +++ b/public/parametres.html @@ -19,7 +19,7 @@

- Je m'appelle henri + Je m'appelle et le titre de ce sondage `); }); const removeOverlay = () => { $('body').removeChild($('.overlay')) + $('body').removeChild($('.modal')) } const createModal = (text) => { @@ -27,11 +29,17 @@ const createModal = (text) => { popin.innerHTML = text popin.className = 'modal' overlay.className = 'overlay' - overlay.appendChild(popin) + $('body').appendChild(overlay) + $('body').appendChild(popin) + overlay.addEventListener('click', removeOverlay) $('body').insertBefore(overlay, $('main')) -} + $("#submitTextField").addEventListener("click", () => { + $("#name").innerHTML = $("#nameUpdateField").value + removeOverlay() + }); +} $$('input').forEach((inputElement) => { inputElement.addEventListener("change", () => { diff --git a/public/style.css b/public/style.css index ae14a052..726e7998 100644 --- a/public/style.css +++ b/public/style.css @@ -58,10 +58,12 @@ input[type="text"], input[type="email"] { width: 100%; z-index: 5; } + .modal { background: #fff; top: 10%; left: 40%; padding: 10px; position: absolute; + z-index: 10; }