Subversion Repositories SmartDukaan

Rev

Rev 24383 | Rev 25086 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 24383 Rev 25085
Line 1... Line 1...
1
var googleProfile;
1
var googleProfile;
2
var partnerName;
2
var partnerName;
-
 
3
 
3
$(function() {
4
$(function() {
4
 
5
 
5
	$(".login").live('click', function() {
6
	$(".login").live('click', login);
6
		console.log("Login DashBoard");
7
	$('form').live('submit', function() {
7
		var emailIdOrMobileNumber = $("#emailormobile").val();
-
 
8
		console.log(emailormobile);
-
 
9
		var password = $("input[type='password']").val();
8
		if($("#recover-password").length==0) {
10
		if (emailIdOrMobileNumber == "" || emailIdOrMobileNumber == undefined || emailIdOrMobileNumber == null) {
-
 
11
			
-
 
12
				alert("Input field emailIdOrMobileNumber can't be empty")
-
 
13
				return;
9
			login();
14
			}
10
		} else {
15
		if (password == "" || password == null || password == undefined) {
-
 
16
			alert("password can't be empty")
11
			$("#recover-password").trigger('click');
17
			return;
-
 
18
		}
12
		}
19
		submitUser(null, emailIdOrMobileNumber, password)
13
		return false;
20
	});
14
	});
-
 
15
	
21
	$(".forgetPassword").live('click', function() {
16
	$(".forgetPassword").live('click', function() {
22
		$("#auth").toggle();
17
		$("#auth").toggle();
23
		$('#forget-password').toggle();
18
		$('#forget-password').toggle();
24
	});
19
	});
25
	$("#recover-password").live('click', function() {
20
	$("#recover-password").live('click', function() {
Line 47... Line 42...
47
		});
42
		});
48
		attachSignin(document.getElementById('customBtn'));
43
		attachSignin(document.getElementById('customBtn'));
49
	});
44
	});
50
};
45
};
51
 
46
 
-
 
47
function login() {
-
 
48
	console.log("Login DashBoard");
-
 
49
	var emailIdOrMobileNumber = $("#emailormobile").val();
-
 
50
	console.log(emailormobile);
-
 
51
	var password = $("input[type='password']").val();
-
 
52
	if (emailIdOrMobileNumber == "" || emailIdOrMobileNumber == undefined || emailIdOrMobileNumber == null) {
-
 
53
		
-
 
54
			alert("Input field emailIdOrMobileNumber can't be empty")
-
 
55
			return;
-
 
56
		}
-
 
57
	if (password == "" || password == null || password == undefined) {
-
 
58
		alert("password can't be empty")
-
 
59
		return;
-
 
60
	}
-
 
61
	submitUser(null, emailIdOrMobileNumber, password)
-
 
62
}
-
 
63
 
52
function attachSignin(element) {
64
function attachSignin(element) {
53
	console.log(element.id);
65
	console.log(element.id);
54
	auth2.attachClickHandler(element, {}, function(googleUser) {
66
	auth2.attachClickHandler(element, {}, function(googleUser) {
55
		googleProfile = googleUser.getBasicProfile();
67
		googleProfile = googleUser.getBasicProfile();
56
		console.log(googleProfile.getImageUrl());
68
		console.log(googleProfile.getImageUrl());