diff --git a/public/css/style.css b/public/css/style.css index 47952b5..e273b67 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -103,6 +103,38 @@ header.header img { margin: 5px auto; text-align: center; } + +/******************************************************************/ +/* LOADING PUBKEY */ +/******************************************************************/ + +/*.loadingPubkey { +// display: none; + position: fixed; + z-index: 1000; + top: 0; + left: 0; + height: 100%; + width: 100%; + background: rgba( 255, 255, 255, .8 ) + url('http://i.stack.imgur.com/FhHRx.gif') + 50% 50% + no-repeat; +}*/ + +.loadingPubkey { + display: none; + height: 20px; + width: 20px; + content:url('../images/ajax-loader.gif') +} + +body.loading .loadingPubkey { + overflow: hidden; + display: block; +} + + /******************************************************************/ /* POUR MOBILES */ /******************************************************************/ diff --git a/public/images/ajax-loader.gif b/public/images/ajax-loader.gif new file mode 100644 index 0000000..5bf5193 Binary files /dev/null and b/public/images/ajax-loader.gif differ diff --git a/src/Account/views/signup.twig b/src/Account/views/signup.twig index 5d13cbc..463c88c 100644 --- a/src/Account/views/signup.twig +++ b/src/Account/views/signup.twig @@ -6,6 +6,7 @@
{{ csrf_input() }} {{ field('username', user.username, "Pseudo") }} +
{{ field('pubkey', user.pubkey, "Clé publique") }}
{{ field('firstname', user.firstname, "Prénom") }} {{ field('lastname', user.lastname, "Nom") }} @@ -22,6 +23,9 @@ var textInput = document.getElementById('username'); var timeout = null; +$body = $("body"); +noPubKey("hide") + textInput.onkeyup = function (e) { clearTimeout(timeout); timeout = setTimeout(function () { @@ -38,12 +42,14 @@ textInput.onkeyup = function (e) { (pubkeyIsNull) ? noPubKey("block") : noPubKey("hide"); } } + $body.addClass("loading"); xmlhttp.open("GET","/ajax/getG1PubKey.php?vendeur="+textInput.value,true); xmlhttp.send(); }, 800); }; function noPubKey(state) { + $body.removeClass("loading"); var textMbr = document.getElementById("cle_pub"); if (state == "hide"){ textMbr.style.display = "none"; @@ -52,6 +58,7 @@ function noPubKey(state) { } } + {% endblock %}