Subversion Repositories SmartDukaan

Rev

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

Rev 20223 Rev 20225
Line 125... Line 125...
125
	  	    }, {scope: 'user_friends, email'});
125
	  	    }, {scope: 'user_friends, email'});
126
	  	  }
126
	  	  }
127
	  	});
127
	  	});
128
  }
128
  }
129
  
129
  
130
  function loginregister(){
130
  function loginregister(src){
131
	  mode = $('#loginText').html();
131
	  mode = $('#loginText').html();
132
	  $('#errormessage').hide();
132
	  $('#errormessage').hide();
133
	  $('#errormessage').html('');
133
	  $('#errormessage').html('');
-
 
134
	  var email;
-
 
135
	  var password;
-
 
136
	  if(src&&src!=undefined){
-
 
137
		  email = $('#lemail').val();;
-
 
138
		  password = $('#lpassword').val();
-
 
139
	  }else{
-
 
140
		  email = $('#email').val();;
-
 
141
		  password = $('#password').val();
-
 
142
	  }
134
	  if(mode =='Login'){
143
	  if(mode =='Login'){
135
		  trackEventWithGA('Account', 'Login from '+window.location.pathname, $('#email').val());
144
		 try{ trackEventWithGA('Account', 'Login from '+window.location.pathname, $('#email').val());}catch(e){}
136
		  $.ajax({
145
		  $.ajax({
137
				type : "POST",
146
				type : "POST",
138
				url : "/login?email="+$('#email').val()+"&password="+$('#password').val(),
147
				url : "/login?email="+email+"&password="+password,
139
				success : function(response) {
148
				success : function(response) {
140
					response = JSON.parse(response);
149
					response = JSON.parse(response);
141
					if(response.status=='success'){
150
					if(response.status=='success'){
142
						if(sourceShip)
151
						if(sourceShip)
143
  							window.location.href='/shipping';
152
  							window.location.href='/shipping';
Line 149... Line 158...
149
					}
158
					}
150
					
159
					
151
				}
160
				}
152
			});
161
			});
153
	  }else{
162
	  }else{
154
		  trackEventWithGA('Account', 'Register from '+window.location.pathname, $('#email').val());
163
		  try{trackEventWithGA('Account', 'Register from '+window.location.pathname, $('#email').val());}catch(e){}
155
		  $.ajax({
164
		  $.ajax({
156
				type : "POST",
165
				type : "POST",
157
				url : "/register?redirectUrl=/&email="+$('#email').val()+"&password="+$('#password').val(),
166
				url : "/register?redirectUrl=/&email="+email+"&password="+password,
158
				success : function(response) {
167
				success : function(response) {
159
					response = JSON.parse(response);
168
					response = JSON.parse(response);
160
					if(response.status=='success'){
169
					if(response.status=='success'){
161
						if(sourceShip)
170
						if(sourceShip)
162
  							window.location.href='/shipping';
171
  							window.location.href='/shipping';
Line 279... Line 288...
279
				    $(this).parent().find('label').removeClass('active');
288
				    $(this).parent().find('label').removeClass('active');
280
				  }
289
				  }
281
				});
290
				});
282
				
291
				
283
				});
292
				});
284
			
-
 
285
			
-
 
286
			
-
 
287
		}
293
		}
288
		openpopup();
294
		openpopup();
289
	}
295
	}
-
 
296
	
-
 
297
	$(document).ready(function(){
-
 
298
		$('input').focusin( function() {
-
 
299
		  $(this).parent().find('label').addClass('active');
-
 
300
		 
-
 
301
		});
-
 
302
 
-
 
303
		$('input').focusout( function() {
-
 
304
		  if (!this.value) {
-
 
305
		    $(this).parent().find('label').removeClass('active');
-
 
306
		  }
-
 
307
		});
-
 
308
		
-
 
309
		});
290
 
310