<commit_before><!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<title>Myfavouritesandwich - An Unhosted demo</title>
<link rel="stylesheet" href="/css/uncompressed/reset.css" />
<link rel="stylesheet" href="/css/uncompressed/text.css" />
<link rel="stylesheet" href="/css/general.css" />
<link rel="stylesheet" href="/css/uncompressed/layout.css" />

<script src="/unhosted/config.js"></script>
<script src="/unhosted/wallet.js"></script>
<script src="/unhosted/webfinger.js"></script>

<script>
register = function(userName, userDomain, pwd1, pwd2) {
	if((!userName.length) || (userName == 'you')) {
		alert('Please choose a user address, for instance <EMAIL>');
	} else if(!pwd1.length) {
		alert('Please choose a password');
	} else if(pwd1 != pwd2) {
		alert('please enter the same password twice');
	} else {
		var wallet = getWallet();
		xhr = new XMLHttpRequest();
		xhr.open("GET", config.doUrl+"?action=registerLocal&userAddress="+encodeURIComponent(userName+"@"+userDomain)+"&pwd="+encodeURIComponent(pwd1), true);
		xhr.onreadystatechange = function() {
			if(xhr.readyState == 4) {
				if(xhr.status == 200) {
					try {
						var wallet = JSON.parse(xhr.responseText);
					} catch(e) {
						alert('oops! wallet contains non-JSON: "'+xhr.responseText+'"');
					}
					setWallet(wallet);
					window.location = config.appUrl;
				}
			}
		}
		xhr.send();
	}
}
</script>
</head>
<body onload="document.getElementById('atHomeDomain').innerHTML='@'+config.homeDomain;">
<div class="preload"></div>
<div class="preload2 register"></div>
<div id="preheader"></div>
<div id="plateContainer">
	<figure id="plate"></figure>
</div>
<div id="mainWrap">


	<div id="lockedView">



		<header>
			<h1>My Favourite Sandwich</h1>
			
			<form class="register">
				<label>User address</label>
				<input id="user" type="text" size="10" value="you"/>
				<label id="atHomeDomain"></label>
				<label>Password</label></label><input id="pwd1" type="password"/>
				<label>Repeat password</label><input id="pwd2" type="password"/>
				<input class="submit" name="submit" type="submit" value="Submit!"
					 onclick="register(
							document.getElementById('user').value,
							config.homeDomain,
							document.getElementById('pwd1').value,
							document.getElementById('pwd2').value);
						return false;">
			</form>
			<div class="clear"></div>
		</header>	
		<div id="register">
		</div>
	</div>


	<div id="footerSpacer"></div>					
	<footer><commit_msg>register form onblur<commit_after><!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<title>Myfavouritesandwich - An Unhosted demo</title>
<link rel="stylesheet" href="/css/uncompressed/reset.css" />
<link rel="stylesheet" href="/css/uncompressed/text.css" />
<link rel="stylesheet" href="/css/general.css" />
<link rel="stylesheet" href="/css/uncompressed/layout.css" />

<script src="/unhosted/config.js"></script>
<script src="/unhosted/wallet.js"></script>
<script src="/unhosted/webfinger.js"></script>

<script>
register = function(userName, userDomain, pwd1, pwd2) {
	if((!userName.length) || (userName == 'you')) {
		alert('Please choose a user address, for instance <EMAIL>');
	} else if(!pwd1.length) {
		alert('Please choose a password');
	} else if(pwd1 != pwd2) {
		alert('please enter the same password twice');
	} else {
		var wallet = getWallet();
		xhr = new XMLHttpRequest();
		xhr.open("GET", config.doUrl+"?action=registerLocal&userAddress="+encodeURIComponent(userName+"@"+userDomain)+"&pwd="+encodeURIComponent(pwd1), true);
		xhr.onreadystatechange = function() {
			if(xhr.readyState == 4) {
				if(xhr.status == 200) {
					try {
						var wallet = JSON.parse(xhr.responseText);
					} catch(e) {
						alert('oops! wallet contains non-JSON: "'+xhr.responseText+'"');
					}
					setWallet(wallet);
					window.location = config.appUrl;
				}
			}
		}
		xhr.send();
	}
}
</script>
</head>
<body onload="document.getElementById('atHomeDomain').innerHTML='@'+config.homeDomain;">
<div class="preload"></div>
<div class="preload2 register"></div>
<div id="preheader"></div>
<div id="plateContainer">
	<figure id="plate"></figure>
</div>
<div id="mainWrap">


	<div id="lockedView">



		<header>
			<h1>My Favourite Sandwich</h1>
			
			<form class="register">
				<label>User address</label>
				<input id="user" type="text" value="you"
					onfocus="if(this.value=='you'){this.className='formfocus';this.value='';}"
					onblur="if(this.value==''){this.className='formblur';this.value='you';}"/>
				<label id="atHomeDomain"></label>
				<label>Password</label></label><input id="pwd1" type="password"/>
				<label>Repeat password</label><input id="pwd2" type="password"/>
				<input class="submit" name="submit" type="submit" value="Submit!"
					 onclick="register(
							document.getElementById('user').value,
							config.homeDomain,
							document.getElementById('pwd1').value,
							document.getElementById('pwd2').value);
						return false;">
			</form>
			<div class="clear"></div>
		</header>	
		<div id="register">
		</div>
	</div>


	<div id="footerSpacer"></div>					
	<footer>
{'fraction_non_alphanumeric': 0.19938473370505672, 'fraction_numerical': 0.007306287252451452, 'mean_word_length': 4.522292993630574, 'pattern_counts': {'":': 0, '<': 123, '<?xml version=': 0, '>': 123, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '520419', 'n_tokens_mistral': 2050, 'n_tokens_neox': 1773, 'n_words': 318}