signin.html HTML Source View


<!!DOCTYPE html>>
<html>
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<title>Wireless Tag List</title>
	<link rel="stylesheet" href="styles/jquery.mobile-1.0b2.min.css" />
	<link rel="stylesheet" href="styles/eth.css" />
	<script src="styles/jquery-1.6.4.min.js" type="text/javascript"></script> 
	<script src="styles/jquery.mobile-1.0b2.min.js?2" type="text/javascript"></script> 
</head>
<body>
	<div data-role="page" id="loginPage">
		<div data-role="header" data-theme="d" data-position="inline">
			<h1>Login</h1>

			<a href="activate.html" data-theme="e" data-ajax="false" data-icon="plus" class="ui-btn-right">Create an Account</a>

		</div>
		<div data-role="content" data-theme="c">
		
			<form action="" method="post" id="loginform" data-ajax="false" class="ui-body ui-body-c ui-corner-all">
			<div data-role="fieldcontain">
				<label for="email">Email:</label>
				<input type="email" name="email" id="email" value="" />
			</div>
			<div data-role="fieldcontain">
				<label for="pwd1">Password:</label>
				<input type="password" name="pwd1" id="pwd1" value="" />
			</div>
			<button data-icon="check" data-inline="1" type="submit" data-theme="b" id="login_submitBtn">
				Login</button>			
			<button data-icon="delete" data-inline="1" type="reset" data-theme="c" id="login_cancelBtn">
				Cancel</button>
			</form>
			<p>
			<a href="http://www.mytaglist.com/recoverpassword.aspx" data-ajax=false class="ui-btn-right">Password Recovery</a>
			</p>
			<center><button data-inline="1" data-icon="facebook" data-theme="b" class="facebook_login">Facebook Login</button></center>
		</div>
		<script type="text/javascript">
			$("#loginPage").live("pagebeforecreate", function () {
				var ua = navigator.userAgent.toLowerCase();
				if (ua.indexOf("iphone") != -1 || ua.indexOf("ipod") != -1) {
					$.each([$("#email"), $("#pwd1")], function (i, o) {
						var lb = o.parent().children("label").eq(0);
						lb.hide(); o.attr("placeholder", lb.text().replace(":", ""));
					});
				}

			});
		</script> 
		<script src="styles/client.js?2" type="text/javascript"></script> 
		<script type="text/javascript">
			if (window.navigator.standalone) {
				$("#login_cancelBtn").click(function () {
					document.webkitCancelFullScreen();
				});

			} else {
			$("#login_cancelBtn").click(function () {
				if (window.NC) {
					window.NC.quitApp();
				} else {
					if (window["localStorage"] != null) {
						localStorage["mytaglist.signin.email"] = "";
						localStorage["mytaglist.signin.pwd"] = "";
					}
					location.href = "index.html";
				}
			});
			}
			if (window["localStorage"] != null) {
				$("#email").val(localStorage["mytaglist.signin.email"]);
				$("#pwd1").val(localStorage["mytaglist.signin.pwd"]);
			}
			$("#email").blur({ regex: "^[^\\W][a-zA-Z0-9\\_\\-\\.]+([a-zA-Z0-9\\_\\-\\.]+)*\\@[-a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)*\\.[a-zA-Z]{2,4}$",
				message: "Valid email address required for password recovery."
			}, validate);
			$("#pwd1").blur({ regex: "^\\S{3,}$", message: "password must be at least 3 characters" }, validate);
			$("#loginform").submit(function (event) {
				event.preventDefault();
				if (window["localStorage"] != null) {
					localStorage["mytaglist.signin.email"] = $("#email").val();
					localStorage["mytaglist.signin.pwd"] = $("#pwd1").val();
				}
				$("#loginform input").trigger('blur');
				if ($("label.error").length == 0) {
					var btn = $("#login_submitBtn");
					var oldhtml = show_finding(btn, "Logging In...");
					var email = $('#email').val(); var pwd = $('#pwd1').val();
					$.ajax({
						url: WSROOT + "ethAccount.asmx/SignIn",
						data:  JSON.stringify({"email":email, "password":pwd}),
						success: function (retval, textStatus) {
							var urls = window.location.search.split('=');
							location.href = (urls.length == 2 ? decodeURIComponent(urls[1]) : 'index.html');
						},
						error: function (xhr, textStatus, exception) {
							restore_finding(btn, oldhtml);
							popup_error(xhr, btn);
						}
					});
				}
			});
		</script> 
	</div>
</body>
</html>