From 81fcf22fc300d2dc1c14c2ab98936ea568ba3234 Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki Date: Thu, 7 May 2020 11:55:59 +0200 Subject: [PATCH 1/2] copied js over from user-account --- js/headfootLogout.js | 209 ------------------------------------------- 1 file changed, 209 deletions(-) delete mode 100644 js/headfootLogout.js diff --git a/js/headfootLogout.js b/js/headfootLogout.js deleted file mode 100644 index db3a42a..0000000 --- a/js/headfootLogout.js +++ /dev/null @@ -1,209 +0,0 @@ -var menu = [{'name':'Informationen', 'combos':[{'name':'Projekte', 'link':'/project'}, {'name':'Über das M4_LAB', 'link':'/projectoverview?projectID=1'}], 'type':'dropdown', 'link':'#'},{'name':'Zusammenarbeit', 'combos':[{'name':'Mailinglisten', 'link':'/mailinglists'},{'name':'Videokonferenzen', 'link':'/videoconferences'},/* {'name':'...', 'link':'#'}*/], 'type':'dropdown', 'link':'#'},{'name':'Events', 'combos':[{'name':'Veranstaltungen der HfT', 'link':'http://www.hft-stuttgart.de/Aktuell/Veranstaltungen/'},{'name':'Veranstaltungen der HfT Forschung', 'link':'https://www.hft-stuttgart.de/forschung/veranstaltungen'}], 'type':'dropdown', 'link':'#'},{'name':'Benutzerkonto', 'combos': [], 'type':'', 'link':'/account/'}]; - - -var hft_links = [{'url':'hhttps://www.hft-stuttgart.de/forschung/innovative-hochschule-m4-lab', 'name':'Kontakt'},{'url':'hhttps://www.hft-stuttgart.de/impressum', 'name':'Impressum'},{'url':'https://www.hft-stuttgart.de/datenschutz', 'name':'Datenschutz'}] - -var socialmedias = [{'url':'https://twitter.com/InnolabM4', 'name': 'fa-twitter'}, {'url':'https://www.facebook.com/HfTStuttgart/', 'name': 'fa-facebook-square'}, {'url':'https://www.instagram.com/m4_lab/', 'name': 'fa-instagram'}, {'url':'https://de.linkedin.com/school/hochschule-f%C3%BCr-technik-stuttgart-%E2%80%93-university-of-applied-sciences/', 'name': 'fa-linkedin'}, {'url':'https://www.youtube.com/channel/UCi0_JfF2qMZbOhOnNH5PyHA', 'name': 'fa-youtube'}]; - -var footer_images = [/*{'src':'/images/demo/bbf_logo.png', 'alt':'BMBF'},*/ {'src':'/images/demo/Innovative_Hochschule_Initiative_BMBF_GWK_RGB.jpg', 'alt':'Innovative Hochschule'}] - -function prependChild(parent,child){ - parent.insertBefore(child, parent.childNodes[0]); -} - -function readCookie(cname) { - var name = cname + "="; - var decodedCookie = decodeURIComponent(document.cookie); - var ca = decodedCookie.split(';'); - for(var i = 0; i Date: Thu, 7 May 2020 11:56:06 +0200 Subject: [PATCH 2/2] copied js over from user-account --- js/generalFunction.js | 9 +++++++++ js/registration.js | 38 ++++++++++++++++++++++++++++++++++++++ js/security.js | 30 ++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 js/generalFunction.js create mode 100644 js/registration.js create mode 100644 js/security.js diff --git a/js/generalFunction.js b/js/generalFunction.js new file mode 100644 index 0000000..5aeafdc --- /dev/null +++ b/js/generalFunction.js @@ -0,0 +1,9 @@ +// password requirement +function checkPasswordReq(pwd) { + if (pwd.length < 8) { + isBest = false; + } else { + isBest = true; + } + return isBest +} \ No newline at end of file diff --git a/js/registration.js b/js/registration.js new file mode 100644 index 0000000..8f2c1b5 --- /dev/null +++ b/js/registration.js @@ -0,0 +1,38 @@ +var isEmailValid = false +var isPasswordValid = false + +// check if email already exist +$('#inputEmail').change(function(){ + var email = $('#inputEmail').val() + $.get("email/"+email, function(data) { + $('#emailWarning').empty() + isEmailValid = data + if(!isEmailValid) { + $('#emailWarning').html('Mit dieser E-Mail-Adresse existiert bereits ein Benutzerkonto in unserem Transferportal.') + } + switchSubmitButton() + }) + .fail(function() { + console.log("cannot check email") + }) +}); + +// check password +$('#inputPassword').on('keyup', function () { + isPasswordValid = checkPasswordReq($('#inputPassword').val()) + $('#passwordWarning').empty(); + if (!isPasswordValid) { + //$('#passwordWarning').html('Must be at least 8 characters') + $('#passwordWarning').html('Das Passwort muss mindestens 8 Zeichen haben') + } + switchSubmitButton() +}); + +function switchSubmitButton() { + if (isEmailValid && isPasswordValid) { + $('#submitBtn').prop('disabled', false) + } + else { + $('#submitBtn').prop('disabled', true) + } +} \ No newline at end of file diff --git a/js/security.js b/js/security.js new file mode 100644 index 0000000..535a95a --- /dev/null +++ b/js/security.js @@ -0,0 +1,30 @@ +// check password and password confirmation input fields +// used in Security and Reset Password +$('#inputNewPwd, #inputConfirm').on('keyup', function () { + var isBest, isMatch; + + isBest = checkPasswordReq($('#inputNewPwd').val()) + $('#recommendation').empty(); + if (!isBest) { + //$('#recommendation').html('Must be at least 8 characters').css('color', 'red'); + $('#recommendation').html('Das Passwort muss mindestens 8 Zeichen haben').css('color', 'red'); + } + + // match or not? + if ($('#inputNewPwd').val() == $('#inputConfirm').val()) { + //$('#message').html('Matching').css('color', 'green'); + $('#message').html('Übereinstimmend').css('color', 'green'); + isMatch = true; + } else { + //$('#message').html('Not Matching').css('color', 'red'); + $('#message').html('Nicht übereinstimmend').css('color', 'red'); + isMatch = false; + } + + // enable/disable update button + if (isBest && isMatch) { + $('#updateBtn').prop('disabled', false); + } else { + $('#updateBtn').prop('disabled', true); + } +}); \ No newline at end of file -- GitLab