<commit_before><!doctype html>
<html>
<head>
	<meta charset="utf-8"/>
	<link href="/files/css/testtask-styles.css?data=26.07.2012" rel="stylesheet">
	<title>XIAG test task</title>
	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div class="content">
	<header>URL shortener</header>

	<?php if ($this->error): ?>
	<div class="error"><?=$this->error?></div>
	<?php endif; ?>

	<form method="post" id="form">
		<table>
			<tr>
				<th>Long URL</th>
				<th>Short URL</th>
			</tr>
			<tr>
				<td>
					<input type="url" name="url">
					<input type="submit" value="Do!">
				</td>
				<td id="result"></td>
			</tr>
		</table>
	</form>
</div>
<script type="text/javascript">
	$(document).ready(function(){
		$('#form').submit(function(e){
			$('#result').html('');
			$.ajax(
				{
					url : this.action ? this.action : window.location,
					type: 'POST',
					data : $(this).serializeArray(),
					success:function(data)
					{
						if (data.result)
						{
							var link = document.createElement('a');
							link.setAttribute('href', data.url);
							link.setAttribute('target', '_blank');
							link.appendChild(document.createTextNode(data.url));
							$('#result').html(link);
						}
						else if (data.message)
						{
							$('#result').html(data.message);
						}
					},
					error: function(jqXHR, textStatus, errorThrown)
					{
						alert('Failed to shorten URL, try again');
					}
				});
			e.preventDefault(); //STOP default action
		});	});
</script>
</body>
</html><commit_msg>cosmetic changes<commit_after><!doctype html>
<html>
<head>
	<meta charset="utf-8"/>
	<link href="/files/css/testtask-styles.css?data=26.07.2012" rel="stylesheet">
	<title>XIAG test task</title>
	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div class="content">
	<header>URL shortener</header>

	<?php if ($this->error): ?>
	<div class="error"><?=$this->error?></div>
	<?php endif; ?>

	<form method="post" id="form">
		<table>
			<tr>
				<th>Long URL</th>
				<th>Short URL</th>
			</tr>
			<tr>
				<td>
					<input type="url" name="url">
					<input type="submit" value="Do!">
				</td>
				<td id="result"></td>
			</tr>
		</table>
	</form>
</div>
<script type="text/javascript">
	$(document).ready(function(){
		$('#form').submit(function(e){
			$('#result').html('');
			$.ajax(
				{
					url : this.action ? this.action : window.location,
					type: 'POST',
					data : $(this).serializeArray(),
					success: function(data)
					{
						if (data.result)
						{
							var link = document.createElement('a');
							link.setAttribute('href', data.url);
							link.setAttribute('target', '_blank');
							link.appendChild(document.createTextNode(data.url));
							$('#result').html(link);
						}
						else if (data.message)
						{
							$('#result').html(data.message);
						}
					},
					error: function()
					{
						alert('Failed to shorten URL, try again');
					}
				});
			e.preventDefault();
		});	});
</script>
</body>
</html>
{'fraction_non_alphanumeric': 0.22113502935420742, 'fraction_numerical': 0.008480104370515329, 'mean_word_length': 2.942159383033419, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 91, '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': '3916100', 'n_tokens_mistral': 1400, 'n_tokens_neox': 1077, 'n_words': 194}