<commit_before>$(function(){
	var obtainFormMeta=function(formId){
		return $(formId).data();
	};

    var refreshApplicationList = function () {
        $.ajax({
            url: "https://localhost:9443/store/apis/applications", success: function (result) {
                var partial = 'list_applications';
                var container = 'list_applications';
                var data = {};
                data.applications = result;
                renderPartial(partial, container, result);
            }
        });
    };

    var partial = function (name) {
        return '/extensions/assets/api/themes/' + caramel.themer + '/partials/' + name + '.hbs';
    };
    var id = function (name) {
        return '#' + name;
    };

    var renderPartial = function (partialName, containerName, data, fn) {
        fn = fn || function () {
        };
        if (!partialName) {
            throw 'A template name has not been specified for template key ' + partialKey;
        }
        if (!containerName) {
            throw 'A container name has not been specified for container key ' + containerKey;
        }
        var obj = {};
        obj[partialName] = partial(partialName);
        caramel.partials(obj, function () {
            var template = Handlebars.partials[partialName](data);
            $(id(containerName)).html(template);
            fn(containerName);
        });
    };

	$(document).ready(function(){
		var appName = $('#overview_name').val();
		$('#form-application-create').ajaxForm({
			success:function(){
				var options=obtainFormMeta('#form-application-create');
				var message = {};
				message.text = '<div><i class="icon-briefcase"></i> Application: '+appName+' has been created.</div>';
				message.type = 'success';
				message.layout ='topRight';
				noty(message);
                refreshApplicationList();
			},
			error:function(){
				var message ={};
				message.text = '<div><i class="icon-briefcase"></i> Application: '+appName+' has not been created.</div>';
				message.type = 'error';
				message.layout = 'topRight';
				noty(message);
			}
		});
	});

});<commit_msg>Removing hardcoded context<commit_after>$(function(){
	var obtainFormMeta=function(formId){
		return $(formId).data();
	};

    var refreshApplicationList = function () {
        $.ajax({
            url: caramel.context + '/apis/applications', success: function (result) {
                var partial = 'list_applications';
                var container = 'list_applications';
                var data = {};
                data.applications = result;
                renderPartial(partial, container, result);
            }
        });
    };

    var partial = function (name) {
        return '/extensions/assets/api/themes/' + caramel.themer + '/partials/' + name + '.hbs';
    };
    var id = function (name) {
        return '#' + name;
    };

    var renderPartial = function (partialName, containerName, data, fn) {
        fn = fn || function () {
        };
        if (!partialName) {
            throw 'A template name has not been specified for template key ' + partialKey;
        }
        if (!containerName) {
            throw 'A container name has not been specified for container key ' + containerKey;
        }
        var obj = {};
        obj[partialName] = partial(partialName);
        caramel.partials(obj, function () {
            var template = Handlebars.partials[partialName](data);
            $(id(containerName)).html(template);
            fn(containerName);
        });
    };

	$(document).ready(function(){
		var appName = $('#overview_name').val();
		$('#form-application-create').ajaxForm({
			success:function(){
				var options=obtainFormMeta('#form-application-create');
				var message = {};
				message.text = '<div><i class="icon-briefcase"></i> Application: '+appName+' has been created.</div>';
				message.type = 'success';
				message.layout ='topRight';
				noty(message);
                refreshApplicationList();
			},
			error:function(){
				var message ={};
				message.text = '<div><i class="icon-briefcase"></i> Application: '+appName+' has not been created.</div>';
				message.type = 'error';
				message.layout = 'topRight';
				noty(message);
			}
		});
	});

});
{'fraction_non_alphanumeric': 0.15266996000940955, 'fraction_numerical': 0.0009409550693954364, 'mean_word_length': 2.355958958168903, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 1, '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': '6967477', 'n_tokens_mistral': 1271, 'n_tokens_neox': 1145, 'n_words': 269}