From 57e202798506fbda91380a7a9b8dd7fdadfae546 Mon Sep 17 00:00:00 2001 From: Hubert depesz Lubaczewski Date: Tue, 21 May 2019 10:33:57 +0200 Subject: [PATCH] Show info when calculating contact nonce prefix --- public/css/style.css | 4 +++ public/js/contact.js | 6 ++-- templates/controller/contact.html.ep | 48 ++++++++++++++++------------ 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 2d65ff9..b17c9e8 100755 --- a/public/css/style.css +++ b/public/css/style.css @@ -425,3 +425,7 @@ div.plea { float: right; color: #666; } .user-history div.date {background:#ddd;text-align:center;font-style:italic;color:#333;} +#contactForm { display: none; } +#contactWait { border: 2px solid #00f; padding: 0.5em; text-align: center; background: #006; margin: 1em; padding: 1em;} +#contactWait p { font-weight: bold; font-size: 2em; color: #ccc; padding: 0; margin: 0; margin-bottom: 1em; } +#contactWait p.hint { font-weight: normal; font-size: 1.5em; margin-bottom: 0em; } diff --git a/public/js/contact.js b/public/js/contact.js index c0b0b9a..e5e04fd 100644 --- a/public/js/contact.js +++ b/public/js/contact.js @@ -1,7 +1,4 @@ ( function( $ ) { - var submit = $('#send_email'); - submit.hide(); - // MD5 function taken from // https://stackoverflow.com/questions/14733374/how-to-generate-md5-file-hash-on-javascript var MD5 = function(d){result = M(V(Y(X(d),8*d.length)));return result.toLowerCase()};function M(d){for(var _,m="0123456789ABCDEF",f="",r=0;r>>4&15)+m.charAt(15&_);return f}function X(d){for(var _=Array(d.length>>2),m=0;m<_.length;m++)_[m]=0;for(m=0;m<8*d.length;m+=8)_[m>>5]|=(255&d.charCodeAt(m/8))<>5]>>>m%32&255);return _}function Y(d,_){d[_>>5]|=128<<_%32,d[14+(_+64>>>9<<4)]=_;for(var m=1732584193,f=-271733879,r=-1732584194,i=271733878,n=0;n>16)+(_>>16)+(m>>16)<<16|65535&m}function bit_rol(d,_){return d<<_|d>>>32-_} @@ -29,6 +26,7 @@ if (found) { $('#nonceprefix').val(prefix); - submit.show(); + $('#contactWait').hide(); + $('#contactForm').show(); } } )( jQuery ); diff --git a/templates/controller/contact.html.ep b/templates/controller/contact.html.ep index f7eb2b3..cd4a4c3 100755 --- a/templates/controller/contact.html.ep +++ b/templates/controller/contact.html.ep @@ -23,31 +23,37 @@ % } -
- - +
+

Checking if you can send contact form...

+

If you're seeing this message for over 10 seconds, something is wrong.

+
-
- - -
+
+ + + -
- - -
+
+ + +
-
- - -
+
+ + +
-
- -
+
+ + +
-

Or you can simply mail me at depesz@depesz.com

+
+ +
-

All fields marked by * are required.

+

All fields marked by * are required.

+ +
- +

Alternatively, you can simply mail me at depesz@depesz.com.