<commit_before>﻿/*! Provides some functionality for displaying Bootstrap alert messages when working with jQuery Ajax methods and, in particular, ASP.NET MVC Ajax forms.
 * 
 * Geocrest.Web.AjaxAlerts v1.0.1 (https://github.com/geocrest/jquery-ajax-alerts)
 * Copyright 2013, 2014 Geocrest Mapping, LLC.
 * Licensed under GPL v2.0 (https://github.com/geocrest/jquery-ajax-alerts/blob/master/LICENSE)
 *
 */
(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        define(['jquery'], function ($) {
            root.AjaxAlerts = factory($);
        });
    } else {
        root.AjaxAlerts = factory(root.$);
    }
}(this, function ($) {
    var ajaxResultElementId = 'ajaxresult';
    if ($.fn.alert == null) throw new Error('AjaxAlerts requires the Bootstrap Alert plugin.');
    var bootstrapVersion = $.fn.alert.Constructor.VERSION;
    /**
     * The global Ajax Alerts object.
     * @module AjaxAlerts
     */
    var exports =
    {
        VERSION: '1.0.1',
        /** Displays a success message within an alert
         * @param {object} a - a JSON object returned from the server containing a boolean value
         *  for success, a string value for a message, and the content for the updatetargetid.
         *  * It is up to you to return this object from your controller! *
         * @param {string} [b] - the jQuery selector of the element to receive the updated content (i.e. updatetargetid).
         * @param {string} [c] - the jQuery Selector of the modal displaying the content.
         * @param {string} [d] - the jQuery selector of the submit button element.
         */
        onSuccess: function (a, b, c, d) {
            var $container = addContainer(ajaxResultElementId);
            $(d).button('reset');
            if (a.success) {
                $(c).modal('hide');
                $(b).html(a.content);
                $container.html(addClose() + a.message)
                    .addClass('alert alert-success fade in')
                    .alert();
                setTimeout(function () {
                    $container.alert('close');
                }, 5000);
            }
            else {
                $container.html(addClose() + a.message)
                    .addClass('alert alert-error fade in')
                    .alert();
            }
        },
        /** Removes an element from the DOM after it has been deleted. 
         * @param {object} a - a JSON object returned from the server containing a boolean value
         * for success, a string value for message, and the id of the object deleted.
         * * It is up to you to return this object from your controller! *
         * @param {string} b - the jQuery selector of the element to remove from display (e.g. '#row3').
         */
        onDelete: function (a, b) {
            var $container = addContainer(ajaxResultElementId);
            if (a.success) {
                $(b).fadeOut(1000, function () {
                    $container.html(addClose() + a.message)
                        .addClass('alert alert-success fade in')<commit_msg>parse validation controls after request completes<commit_after>﻿/*! Provides some functionality for displaying Bootstrap alert messages when working with jQuery Ajax methods and, in particular, ASP.NET MVC Ajax forms.
 * 
 * Geocrest.Web.AjaxAlerts v1.0.1 (https://github.com/geocrest/jquery-ajax-alerts)
 * Copyright 2013, 2014 Geocrest Mapping, LLC.
 * Licensed under GPL v2.0 (https://github.com/geocrest/jquery-ajax-alerts/blob/master/LICENSE)
 *
 */
(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        define(['jquery'], function ($) {
            root.AjaxAlerts = factory($);
        });
    } else {
        root.AjaxAlerts = factory(root.$);
    }
}(this, function ($) {
    var ajaxResultElementId = 'ajaxresult';
    if ($.fn.alert == null) throw new Error('AjaxAlerts requires the Bootstrap Alert plugin.');
    var bootstrapVersion = $.fn.alert.Constructor.VERSION;
    /**
     * The global Ajax Alerts object.
     * @module AjaxAlerts
     */
    var exports =
    {
        VERSION: '1.0.1',
        /** Displays a success message within an alert
         * @param {object} a - a JSON object returned from the server containing a boolean value
         *  for success, a string value for a message, and the content for the updatetargetid.
         *  * It is up to you to return this object from your controller! *
         * @param {string} [b] - the jQuery selector of the element to receive the updated content (i.e. updatetargetid).
         * @param {string} [c] - the jQuery Selector of the modal displaying the content.
         * @param {string} [d] - the jQuery selector of the submit button element.
         */
        onSuccess: function (a, b, c, d) {
            var $container = addContainer(ajaxResultElementId);
            $(d).button('reset');
            if (a.success) {
                $(c).modal('hide');
                $(b).html(a.content);
                $container.html(addClose() + a.message)
                    .addClass('alert alert-success fade in')
                    .alert();
                setTimeout(function () {
                    $container.alert('close');
                }, 5000);
            }
            else {
                $container.html(addClose() + a.message)
                    .addClass('alert alert-error fade in')
                    .alert();
            }
            $.validator.unobtrusive.parse(document);
        },
        /** Removes an element from the DOM after it has been deleted. 
         * @param {object} a - a JSON object returned from the server containing a boolean value
         * for success, a string value for message, and the id of the object deleted.
         * * It is up to you to return this object from your controller! *
         * @param {string} b - the jQuery selector of the element to remove from display (e.g. '#row3').
         */
        onDelete: function (a, b) {
            var $container = addContainer(ajaxResultElementId);
            if (a.success) {
                $(b).fadeOut(1000, function () {
                    $container.html(addClose() + a.message)
                        .addClass('alert alert-success fade in')
{'fraction_non_alphanumeric': 0.11408114558472554, 'fraction_numerical': 0.007955449482895784, 'mean_word_length': 1.9819734345351043, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '3180345', 'n_tokens_mistral': 1729, 'n_tokens_neox': 1636, 'n_words': 569}