GearShare Mark ii ------- LOG IN Java Code
At this stage in the process we where working on getting a prototype to a functional level in order to be able to demonstrate how the site flowed and UI would look.
To do this in a way that would look professional, we established that having a working profile log in function would be one of the most important things to have for this aim to be accomplished.
The way i wrote this java script was to enable us to do exactly that.
Lines 18 ---> 31 List 4 functions that perform actions that we can call for other interactions, not just the ones they are currently linked to. This means we can re use the code functions multiple times. EG. “SetLogInState” can be used to then show whatever the user entered in User name as the “name” txt instead of “LogOut”. The purpose being, to resemble DATA handling.
Lines 34 ---> 45 List an action when the user clicks, “Submit” for there log in. Functions can be added in here as we like. EG. We can plug in multiple other functions into this action. Maybe an email checker to validate users email. Or a password strength checker. It could also be manipulated to function for other buttons. Again reducing the amount of Repeating we need to do in code.









