From dcf61354050bfe81d6983f1aec34d7d3d6733a0d Mon Sep 17 00:00:00 2001 From: Alex Vitkov Date: Fri, 29 Jan 2021 13:43:53 +0200 Subject: index.html + login.html => index.php those files had the entire HTML tree duplicated, which would make it difficult to make any changes to the front end. this commit combines the two files in one, with some front-end JS to switch between the login and register forms. --- js/validate_hero.js | 58 ----------------------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 js/validate_hero.js (limited to 'js/validate_hero.js') diff --git a/js/validate_hero.js b/js/validate_hero.js deleted file mode 100644 index 6d29a53..0000000 --- a/js/validate_hero.js +++ /dev/null @@ -1,58 +0,0 @@ - -function clear_hero_errors() -{ - var errors = document.getElementsByClassName("hero_form_error"); - var i; - for (i = 0; i < errors.length; i++) - { - errors[i].hidden = true; - } -} -function validate_hero_login_form() -{ - var username=document.forms["hero_form"]["username"].value; - var flag=true; - clear_hero_errors(); - - if(username.length==0) - { - document.getElementById("username-length-error").hidden=false; - flag=false; - } - document.activeElement.blur(); - return flag; -} -function validate_hero_form() -{ - var username=document.forms["hero_form"]["username"].value; - var email=document.forms["hero_form"]["email"].value; - var password=document.forms["hero_form"]["password"].value; - var password2=document.forms["hero_form"]["password2"].value; - - var flag=true; - clear_hero_errors(); - - if(username.length==0) - { - document.getElementById("username-length-error").hidden=false; - flag=false; - } - if(!email.match(/\S+@\S+/)) - { - document.getElementById("email-error").hidden=false; - flag=false; - } - if(password.length==0) - { - document.getElementById("password-length-error").hidden=false; - flag=false; - } - if(password !== password2) - { - document.getElementById("password-match-error").hidden=false; - flag=false; - } - document.activeElement.blur(); - return flag; - -} -- cgit v1.2.3