<commit_before><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

	<title>Shorten Link</title>
	
	<link rel="stylesheet" href="utilitywindow.css" type="text/css" media="screen" title="no title" charset="utf-8">
	<script src="app:/assets/air/AIRAliases.js" type="text/javascript" charset="utf-8"></script>
	<script src="app:/assets/jquery/jquery.js" type="text/javascript" charset="utf-8"></script>
	<script src="app:/assets/spaz/spaz.js" type="text/javascript" charset="utf-8"></script>	
	<script src="app:/assets/spaz/spaz.debug.js" type="text/javascript" charset="utf-8"></script>
	<script src="app:/assets/spaz/spaz.sys.js" type="text/javascript" charset="utf-8"></script>
	<script src="app:/assets/spaz/spaz.shortlink.js" type="text/javascript" charset="utf-8"></script>
	<script src="app:/assets/lib/webtoolkit.trim.js" type="text/javascript" charset="utf-8"></script>
	
	<script type="text/javascript" charset="utf-8">
		Spaz.Prefs = window.opener.Spaz.Prefs;
	</script>
	
	<script type="text/javascript" charset="utf-8">
		$(document).ready(function() {

			// get the pref
			var service = Spaz.Prefs.get('url-shortener');
			air.trace("service is "+ service);
			
			// populate the dropdown
			for (method in Spaz.Shortlink.services) {
				air.trace(method)
				if (method[0] != '$') {
					if (method == service) {
						$('#url-shortener').append('<option value="'+method+'" selected="selected">'+method+'</option>');
					} else {
						$('#url-shortener').append('<option value="'+method+'">'+method+'</option>');
					}
				}
			}
			
			$('#url-shortener').bind('change', function() {
				air.trace($('#url-shortener').val());
				Spaz.Prefs.set('url-shortener', $('#url-shortener').val());
			});
			

			
			// Spaz.dump("val:"+$('#shorten-original-link').val());
			$('#shorten-original-link').focus();
			$('#shorten-original-link').val('http://');
			// Spaz.dump(air.Clipboard.generalClipboard.formats);
			if(air.Clipboard.generalClipboard.hasFormat(air.ClipboardFormats.TEXT_FORMAT)) {
			    var cliptext = air.Clipboard.generalClipboard.getData(air.ClipboardFormats.TEXT_FORMAT);
				if (/^https?:\/\//.test(cliptext)) { // if it starts with http://, we assume this is an URL and put it in the form field
					$('#shorten-original-link').val(cliptext);
					Spaz.Shortlink.services[service](cliptext);
				}
				$('#shorten-original-link').select();
			}
			
			
			// bind click to shorten action
			$('#prefs-update-button').bind('click', function() {
				var service = Spaz.Prefs.get('url-shortener');
				air.trace("service is "+ service);
				Spaz.Shortlink.services[service]($('#shorten-original-link').val());
			});
			
			// air.trace(air.NativeApplication.nativeApplication.spazPrefs);
		})
	</script>
	
	
</head>

<body id="shortLinkWindow">

<h1>Shorten Link</h1>

<div id="content">
	<form id="shortenLink-form" onsubmit="return false;">
		<div class="formrow">
			<label for="url-shortener">Service</label>
			<select id="url-shortener" name="url-shortener" onChange="">
				<!-- stuff goes here -->
			</select>
		</div>

		<div class="formrow">
			<label for="original-link">Link</label>
			<input type="text" name="original-link" id="shorten-original-link" value="http://" />
		</div>
		<div class="formrow">
			<label for="short-link">Short</label>
			<input type="text" name="short-link" id="shorten-short-link" value="" />
		</div>
		
		<div class="formrow" style="text-align:right; margin-top:15px">
			<input type="button" id="prefs-update-button" name="update" value="Shorten &bull;" /> 
		</div>
		<div id="verification-result" align="center">&nbsp;</div>
	</form>
</div>
</div>

</body>
</html><commit_msg>tweaked shorten-url dialog: Button is now type="submit" and so Enter key will work for URL submission<commit_after><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

	<title>Shorten Link</title>
	
	<link rel="stylesheet" href="utilitywindow.css" type="text/css" media="screen" title="no title" charset="utf-8">
	<script src="app:/assets/air/AIRAliases.js" type="text/javascript" charset="utf-8"></script>
	<script src="app:/assets/jquery/jquery.js" type="text/javascript" charset="utf-8"></script>
	<script src="app:/assets/spaz/spaz.js" type="text/javascript" charset="utf-8"></script>	
	<script src="app:/assets/spaz/spaz.debug.js" type="text/javascript" charset="utf-8"></script>
	<script src="app:/assets/spaz/spaz.sys.js" type="text/javascript" charset="utf-8"></script>
	<script src="app:/assets/spaz/spaz.shortlink.js" type="text/javascript" charset="utf-8"></script>
	<script src="app:/assets/lib/webtoolkit.trim.js" type="text/javascript" charset="utf-8"></script>
	
	<script type="text/javascript" charset="utf-8">
		Spaz.Prefs = window.opener.Spaz.Prefs;
	</script>
	
	<script type="text/javascript" charset="utf-8">
		$(document).ready(function() {

			// get the pref
			var service = Spaz.Prefs.get('url-shortener');
			air.trace("service is "+ service);
			
			// populate the dropdown
			for (method in Spaz.Shortlink.services) {
				air.trace(method)
				if (method[0] != '$') {
					if (method == service) {
						$('#url-shortener').append('<option value="'+method+'" selected="selected">'+method+'</option>');
					} else {
						$('#url-shortener').append('<option value="'+method+'">'+method+'</option>');
					}
				}
			}
			
			$('#url-shortener').bind('change', function() {
				air.trace($('#url-shortener').val());
				Spaz.Prefs.set('url-shortener', $('#url-shortener').val());
			});
			
      $('#url-shortener').bind('change', function() {
				air.trace($('#url-shortener').val());
				Spaz.Prefs.set('url-shortener', $('#url-shortener').val());
			});
			
			// Spaz.dump("val:"+$('#shorten-original-link').val());
			$('#shorten-original-link').focus();
			$('#shorten-original-link').val('http://');
			// Spaz.dump(air.Clipboard.generalClipboard.formats);
			if(air.Clipboard.generalClipboard.hasFormat(air.ClipboardFormats.TEXT_FORMAT)) {
			    var cliptext = air.Clipboard.generalClipboard.getData(air.ClipboardFormats.TEXT_FORMAT);
				if (/^https?:\/\//.test(cliptext)) { // if it starts with http://, we assume this is an URL and put it in the form field
					$('#shorten-original-link').val(cliptext);
					Spaz.Shortlink.services[service](cliptext);
				}
				$('#shorten-original-link').select();
			}
						
			$('#shortenLink-form').bind('submit', function() {
		  	var service = Spaz.Prefs.get('url-shortener');
				air.trace("service is "+ service);
				Spaz.Shortlink.services[service]($('#shorten-original-link').val());
			});
			
			// air.trace(air.NativeApplication.nativeApplication.spazPrefs);
		})
	</script>
	
	
</head>

<body id="shortLinkWindow">

<h1>Shorten Link</h1>

<div id="content">
	<form id="shortenLink-form" onsubmit="return false;">
		<div class="formrow">
			<label for="url-shortener">Service</label>
			<select id="url-shortener" name="url-shortener" onChange="">
				<!-- stuff goes here -->
			</select>
		</div>

		<div class="formrow">
			<label for="original-link">Link</label>
			<input type="text" name="original-link" id="shorten-original-link" value="http://" />
		</div>
		<div class="formrow">
			<label for="short-link">Short</label>
			<input type="text" name="short-link" id="shorten-short-link" value="" />
		</div>
		
		<div class="formrow" style="text-align:right; margin-top:15px">
			<input type="submit" id="prefs-update-button" name="update" value="Shorten &bull;" /> 
		</div>
		<div id="verification-result" align="center">&nbsp;</div>
	</form>
</div>
</div>

</body>
</html>
{'fraction_non_alphanumeric': 0.2192244949178065, 'fraction_numerical': 0.006776257999749027, 'mean_word_length': 4.222804718217562, 'pattern_counts': {'":': 0, '<': 127, '<?xml version=': 0, '>': 127, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 4}, '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': '2091566', 'n_tokens_mistral': 3129, 'n_tokens_neox': 2737, 'n_words': 430}