Rushabh Mehta | acd3367 | 2013-08-26 16:17:50 +0530 | [diff] [blame] | 1 | $(document).ready(function() { |
| 2 | $(".navbar, footer, .banner, #user-tools").toggle(false); |
| 3 | |
| 4 | $("#login_btn").click(function() { |
| 5 | var me = this; |
Anand Doshi | c8e39b0 | 2013-08-30 18:22:58 +0530 | [diff] [blame] | 6 | $(this).html("Logging In...").prop("disabled", true); |
Rushabh Mehta | acd3367 | 2013-08-26 16:17:50 +0530 | [diff] [blame] | 7 | wn.call({ |
| 8 | "method": "login", |
| 9 | args: { |
| 10 | usr: "demo@erpnext.com", |
| 11 | pwd: "demo", |
| 12 | lead_email: $("#lead-email").val(), |
| 13 | }, |
| 14 | callback: function(r) { |
Anand Doshi | c8e39b0 | 2013-08-30 18:22:58 +0530 | [diff] [blame] | 15 | $(me).prop("disabled", false); |
Rushabh Mehta | acd3367 | 2013-08-26 16:17:50 +0530 | [diff] [blame] | 16 | if(r.exc) { |
Anand Doshi | 3bed5ab | 2013-11-05 20:05:52 +0530 | [diff] [blame] | 17 | alert("Error, please contact support@erpnext.com"); |
Rushabh Mehta | acd3367 | 2013-08-26 16:17:50 +0530 | [diff] [blame] | 18 | } else { |
Anand Doshi | 3bed5ab | 2013-11-05 20:05:52 +0530 | [diff] [blame] | 19 | console.log("Logged In"); |
Rushabh Mehta | acd3367 | 2013-08-26 16:17:50 +0530 | [diff] [blame] | 20 | window.location.href = "app.html"; |
| 21 | } |
| 22 | } |
| 23 | }) |
| 24 | return false; |
| 25 | }) |
Anand Doshi | c8e39b0 | 2013-08-30 18:22:58 +0530 | [diff] [blame] | 26 | .prop("disabled", false); |
Rushabh Mehta | acd3367 | 2013-08-26 16:17:50 +0530 | [diff] [blame] | 27 | }) |