activate.html HTML Source View


<!!DOCTYPE html>>
<html>
<head>
	<link rel="icon" type="image/png" href="favicon196.png" sizes="196x196">
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<title>Create Wireless Tag Account</title>
	<link rel="stylesheet" href="styles/jquery.mobile-1.0b2.min.css?123" />
	<link rel="stylesheet" href="styles/eth.css?2" />
	<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="activatePage">
		<div data-role="header" data-theme="d" data-position="inline" id="mainHeader">
			<a href="index.html" data-ajax="false" data-icon="delete" data-iconpos="notext">Cancel</a>
			<h1>
				Create an Account</h1>
		</div>
		<div data-role="content" data-theme="c">
			<p>
				Create an account for accessing your Tag Manager*</p>
			<form action="" method="post" id="signupform" data-ajax="false" >
			<div data-role="fieldcontain">
				<label for="mac">Tag Manager Serial Number:</label>
				<input type="text" name="mac" id="mac" value=""/>
			</div>
			<div data-role="fieldcontain">
				<label for="managerName">Name this manager (e.g. Home):</label>
				<input type="text" name="managerName" id="managerName" value=""/>
			</div>
			<fieldset class="ui-corner-all"><legend>Create a User Account for this Tag Manager</legend>
				<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">Choose a Password:</label>
					<input type="password" name="pwd1" id="pwd1" value=""  />
				</div>
				<div data-role="fieldcontain">
					<label for="pwd2">Retype the Password:</label>
					<input type="password" name="pwd2" id="pwd2" value="" />
				</div>
			</fieldset>
			<p>
				<input type="checkbox" id="allowmore" class="custom" />
				<label for="allowmore">	Allow creating more accounts to access this Tag Manager</label>
			</p>
			<button data-inline="1" data-icon="check" type="submit" data-theme="b" id="submitBtn">
				Create</button>
			<a data-role="button" data-ajax="false" data-inline="1"  data-theme="a" href='signin.html'>
				Login to an existing account</a>
			</form>
		</div><p style="margin-left: 20px;">
	*: To add a second tag manager under the same account, from <a href="index.html" data-ajax="false">the Web interface</a> 
	click "Settings..." then "Account" or use <a href="index.html?update_account" data-ajax="false">this direct link</a> if you have already logged in.
</p>
	<div data-role="header" data-position="inline">
		<h1>
			Wireless Tag List
		</h1>
		<a href="https://store.wirelesstag.net/blog/news/" data-icon="info" data-iconpos="notext" data-ajax="false"
		   class="ui-btn-right">Blog</a>
	</div>
	<script src="styles/client.js?27" type="text/javascript"></script> 
	<script type="text/javascript">

		$("#activatePage").live("pagebeforecreate", function () {
			var ua = navigator.userAgent.toLowerCase();
			if (ua.indexOf("iphone") != -1 || ua.indexOf("ipod") != -1) {

				$.each([$("#email"), $("#managerName"), $("#pwd1"), $("#mac"), $("#pwd2")], function (i, o) {
					var lb = o.parent().children("label").eq(0);
					lb.hide(); o.attr("placeholder", lb.text().replace(":", ""));
				});
			}
		});

		$("#mac").blur(function (event) { event.target.value = $(event.target).val().toUpperCase(); });
		$("#mac").blur({ regex: "^\\S{12}$", message: "Serial number is 12 character long.", remote: "ethAccount.asmx/GetTagManagerName", remote_retval: "#managerName" }, validate);
		$("#email").blur({
			regex: VALID_EMAIL_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);
		$("#managerName").blur({ regex: "\\S{3,}", message: "name must be at least 3 characters" }, validate);
		$("#pwd1").blur({ regex: "^\\S{3,}$", message: "password must be at least 3 characters and must not contain space characters." }, validate);
		$("#pwd2").blur({ match: "#pwd1", message: "passwords must match" }, validate);
		$("#signupform").submit(function (event) {
			event.preventDefault();
			$("#signupform input").trigger('blur');
			if ($("label.error").length == 0) {
				var btn = $("#submitBtn");
				var oldhtml = show_finding(btn, "Creating...");
				var mac = $("#mac").val(); var email = $('#email').val(); var pwd = $('#pwd1').val(); var allowmore = $("#allowmore").is(":checked");
				$.ajax({
					url: WSROOT + "ethAccount.asmx/CreateAccount3",
					data: JSON.stringify({ "MAC": mac, "email": email, "password": pwd, "allowMore": allowmore, "managerName": $("#managerName").val(), 'facebook_auth': window.location.search.substring(1) }),
					success: function (retval, textStatus) {
						if (retval.d != null && retval.d != "null" && retval.d.length > 1) {
							WSROOT = retval.d;
							if (window.NC) {
								if (window.NC.updateWsRoot) window.NC.updateWsRoot(WSROOT);
							}
							$.ajax({
								url: WSROOT + "ethAccount.asmx/SignIn",
								data:  JSON.stringify({"email":email, "password":pwd}),
								success: function (retval, textStatus) {
									location.href = WSROOT + 'eth/index.html';
								},
								error: function (xhr, textStatus, exception) {
									restore_finding(btn, oldhtml);
									popup_error(xhr, btn);
								}
							});

						}else
							location.href = retval.d + 'eth/index.html';
					},
					error: function (xhr, textStatus, exception) {
						restore_finding(btn, oldhtml);
						popup_error(xhr, btn);
					}
				});
			}
		});

	</script> 
</div>
</body>
</html>