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 App Login</title>
	<link rel="stylesheet" href="styles/jquery.mobile-1.0b2.min.css?123" />
	<link rel="stylesheet" href="styles/eth.css" />
	<link rel="icon" type="image/png" href="favicon196.png" sizes="196x196">
	<script src="styles/jquery-1.6.4.min.js" type="text/javascript"></script> 
	<script src="styles/jquery.mobile-1.0b2.min.js" type="text/javascript"></script> 
</head>
<body>
	<div data-role="page" id="loginPage">
		<div data-role="header" data-theme="d" data-position="inline">
			<h1>Login to Web App</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 method="post" id="loginform" data-ajax="false">
					<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>
					<div style="margin-top:15px;">
						<button data-icon="check" data-inline="1" data-theme="b" id="login_submitBtn" >
							Login&nbsp;&nbsp;
						</button>
						<button data-icon="delete" data-inline="1" type="reset" data-theme="c" id="login_cancelBtn">
							Cancel
						</button>
						<button data-icon="info" data-inline="1" type="button" data-theme="a" onclick="location.href='http://www.mytaglist.com/recoverpassword.aspx'; ">Password Recovery</button>
					</div>
				</form>
			<!--<button data-inline="1" data-icon="facebook" data-theme="b" class="facebook_login">Facebook Login</button>-->
		</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" 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["localStorage"] != null) {
					localStorage["mytaglist.signin.email"] = "";
					localStorage["mytaglist.signin.pwd"] = "";
				}
				if (window.NC) {
					window.NC.quitApp();
				} else {
					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: "^.{3,}$", message: "password must be at least 3 characters" }, validate);
			$("#login_submitBtn").click(function (event) {
				event.preventDefault();
				if (window["localStorage"] != null) {
					try{
						localStorage["mytaglist.signin.email"] = $("#email").val();
						localStorage["mytaglist.signin.pwd"] = $("#pwd1").val();
					}catch(e){}
				}
				$("#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>