<commit_before>/* global Backbone, jQuery, _, ENTER_KEY */
var app = app || {};

$(function() {
    'use strict';

    function send() {
	var item = {
	    apiUrl : $("#apiUrl").val(),
	    methodType : $(".apiRequestType").val(),
	    apiBody : $("#apiBody").val()
	};

	$.ajax({
	    url : '/api/processor',
	    type : 'post',
	    dataType : 'json',
	    contentType : "application/json",
	    success : function(response) {
		console.log("####" + response);
		$("#response-wrapper").html('<pre class="prettyprint">' + JSON.stringify(response, null, 4) + '</pre>');
		prettyPrint();
	    },
	    data : JSON.stringify(item)
	});
    }

    function saveWorkspace() {
	var newWorkspace = new app.Workspace({
	    name : $("#workspaceTextField").val(),
	});
	newWorkspace.save();
    }

    $("#run").bind("click", send);
    $("#saveWorkspaceBtn").bind("click", saveWorkspace);

});<commit_msg>Hiding Modal after workspace got saved.<commit_after>/* global Backbone, jQuery, _, ENTER_KEY */
var app = app || {};

$(function() {
    'use strict';

    function send() {
	var item = {
	    apiUrl : $("#apiUrl").val(),
	    methodType : $(".apiRequestType").val(),
	    apiBody : $("#apiBody").val()
	};

	$.ajax({
	    url : '/api/processor',
	    type : 'post',
	    dataType : 'json',
	    contentType : "application/json",
	    success : function(response) {
		console.log("####" + response);
		$("#response-wrapper").html('<pre class="prettyprint">' + JSON.stringify(response, null, 4) + '</pre>');
		prettyPrint();
	    },
	    data : JSON.stringify(item)
	});
    }

    function saveWorkspace() {
		var newWorkspace = new app.Workspace({
		    name : $("#workspaceTextField").val(),
		});
		newWorkspace.save(null, {success : function(){
			$("#workspaceModal").modal("hide");
		}, error : function(e){
			$("#workspaceModal").modal("hide");
			alert('Some unexpected error occured Please try later.');
		}});
    }

    $("#run").bind("click", send);
    $("#saveWorkspaceBtn").bind("click", saveWorkspace);

});
{'fraction_non_alphanumeric': 0.21909000989119684, 'fraction_numerical': 0.0009891196834817012, 'mean_word_length': 3.3599137931034484, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6097816', 'n_tokens_mistral': 667, 'n_tokens_neox': 633, 'n_words': 130}