From 99fa6ef9b19dc81f10b582ca6749bf1c8cf32c44 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 26 Feb 2019 13:56:08 +0200 Subject: Working on machine service downloads site. --- .../Tango.MachineService/Scripts/Account/Login.js | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Software/Visual_Studio/Web/Tango.MachineService/Scripts/Account/Login.js (limited to 'Software/Visual_Studio/Web/Tango.MachineService/Scripts/Account') diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Scripts/Account/Login.js b/Software/Visual_Studio/Web/Tango.MachineService/Scripts/Account/Login.js new file mode 100644 index 000000000..fbb21c935 --- /dev/null +++ b/Software/Visual_Studio/Web/Tango.MachineService/Scripts/Account/Login.js @@ -0,0 +1,43 @@ +$(document).ready(function () { + + var state = false; + + //$("input:text:visible:first").focus(); + + $('#accesspanel').on('submit', function (e) { + + e.preventDefault(); + + state = !state; + + document.getElementById("litheader").className = "poweron"; + document.getElementById("go").className = ""; + document.getElementById("go").value = "Initializing..."; + + $.ajax({ + type: "POST", + url: "Login", + // The key needs to match your method's input parameter (case-sensitive). + data: JSON.stringify({ Email: $("#email").val(), Password: $("#password").val() }), + contentType: "application/json; charset=utf-8", + success: function (data) { + window.location.href = "/Downloads/index"; + }, + error: function (errMsg) { + document.getElementById("litheader").className = ""; + document.getElementById("go").className = "denied"; + document.getElementById("go").value = "Access Denied"; + + setTimeout(function () { + + document.getElementById("litheader").className = ""; + document.getElementById("go").className = ""; + document.getElementById("go").value = "Authorize"; + + }, 1500); + }, + }); + + }); + +}); \ No newline at end of file -- cgit v1.3.1