<commit_before><h1>Welcome to Canvas Spaces</h1>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>

<style>
fieldset {
	width: 500px;
}

legend {
	font-size: 20px;
}

label.field {
	text-align: right;
	width: 100px;
	float: left;
	font-weight: bold;
}

input.textbox-300 {
	width: 300px;
	float: left;
}

fieldset p {
	clear: both;
	padding: 5px;
}

</style>

<form>

<fieldset>
	<legend>New Group</legend>
	<p><label class="field" for="name">New Group Name:</label><input type="text" name="name">
	<p><label class="field" for="description">Description:</label><input type="text" name="description">
	<p><label class="field" for="membership_type">Membership restrictions:</label>
	<p><input class="field" type="radio" name="membership_type" value="invite_only" checked><label for="membership_type"> Invite only.</label>
	<p><input class="field" type="radio" name="membership_type" value="self_signup"><label for="membership_type"> Self signup.</label>
	<p><label class="field" for="leader_id">Leader id: (sfu id)</label><input type="text" name="leader_id"></div>
</fieldset>

</form>
<br>
<div style="float: clear">
<a href="" onClick="createGroup()">Create group.</a><br>
<a href="" onClick="listGroups()">List groups.</a>
</div>

<script>
function createGroup() 
{
  $.ajax('/api/v1/canvasspaces/groups', 
               { 
               	  type: "POST",
                  data: {group_name: "newgroup11", join_level: 1, leader_id: null, desc: "Pump up the volume."},
                  success: function (data, textStatus, jqXHR) {
                    console.log(JSON.stringify(data));
                    alert("Data received successfully!");
		          }
               });
}

function listGroups()
{
	$.ajax('/api/v1/canvasspaces/groups',
			{
				type: "GET",
				success: function (data, textStatus, jqXKR) {
					console.log(JSON.stringify(data));
					alert("Data received successfully!");
				}	
			});
}
</script><commit_msg>Fixed test login page. Better error reporting.<commit_after><h1>Welcome to Canvas Spaces</h1>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>

<br>
<div style="float: clear">
<a href="" onClick="createGroup()">Create group.</a><br>
<a href="" onClick="listGroups()">List groups.</a>
</div>

<script>
function createGroup() 
{
  $.ajax('/api/v1/canvasspaces/groups', 
               { 
               	  type: "POST",
                  data: {name: "newgroup11", join_type: "free_to_join", leader_id: null, desc: "Pump up the volume."},
                  success: function (data, textStatus, jqXHR) {
                    console.log(JSON.stringify(data));
                    alert("Data received successfully!");
		          },
				  error: function(jqXHR, textStatus, errorThrown) {
					console.log("createGroup error:" + jqXHR.responseText);
					console.log(JSON.stringify(textStatus));
				  }	
               });
}

function listGroups()
{
	$.ajax('/api/v1/canvasspaces/groups',
			{
				type: "GET",
				success: function (data, textStatus, jqXKR) {
					console.log(JSON.stringify(data));
					alert("Data received successfully!");
				},
				error: function(jqXHR, textStatus, errorThrown) {
					console.log("listGroups error:" + jqXHR.responseText);
					console.log(JSON.stringify(textStatus));
				}	
			});
}
</script>
{'fraction_non_alphanumeric': 0.17745302713987474, 'fraction_numerical': 0.010736653742916791, 'mean_word_length': 3.327741935483871, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 63, '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': '103796', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1097, 'n_words': 218}