<!DOCTYPE html>
<html>
	<head>
		<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
		<script src="TextParser.js"></script>
	</head>
	<body>
	A minifiable syntax for defining data!<button onclick="$('#d').text(JSON.stringify(TextParser.parseCustomFormat($('#i').val()), null, '\t'))">Parse!</button><br />
	<textarea id="i" style="width: 48%; height: 500px;"></textarea>
	<div id="d" style="width: 48%; display: inline; float: right; white-space: pre; word-wrap: normal;"></div>
	<script>
	$('#i').focus();
	$('#i').val(":myProp\n::myVal\n\n:foo::bar\n\n:array\n::elem0:::anotherVal\n\n\n:array\n::elem1\n :::innerObj\n  ::::anotherArray:::::1\n  ::::anotherArray:::::2");
	$('#d').text(JSON.stringify(TextParser.parseCustomFormat($('#i').val()), null, '\t'));
	</script>
	</body>
</html>
<!DOCTYPE html>
<html>
	<head>
		<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
		<script src="TextParser.js"></script>
	</head>
	<body>
	A minifiable syntax for defining data!<button onclick="parseInput()">Parse!</button><br />
	<textarea id="i" style="width: 48%; height: 500px;"></textarea>
	<div id="d" style="width: 48%; display: inline; float: right; white-space: pre; word-wrap: normal;"></div>
	<div id="m">Minified: </div>
	<script>
	$('#i').focus();
	$('#i').val(":myProp\n::myVal\n\n:foo::bar\n\n:array\n::elem0:::anotherVal\n\n\n:array\n::elem1\n :::innerObj\n  ::::anotherArray:::::1\n  ::::anotherArray:::::2");
	function parseInput() {
		var json = JSON.stringify(TextParser.parseCustomFormat($('#i').val()), null, '\t');
		$('#d').text(json);
		$('#m').text('Minified: '+json.replace(/\n\s*/g, ''));
	}
	parseInput();
	</script>
	</body>
</html>
Add minified input to bottom of page
Add minified input to bottom of page
