<commit_before>import elrUI from 'elr-ui';
const $ = require('jquery');

let ui = elrUI();

const elrAlerts = function({
    speed = 300,
    alertClass = 'js-dismissible-alert'
} = {}) {
    const self = {
        showAlert(type, message, $holder) {
            const className = `elr-alert elr-${type}-alert ${alertClass}`;
            const $newAlert = ui.createElement('div', {
                text: message,
                'class': className
            });

            const $close = $('<button></button>', {
                text: 'x',
                'class': 'close'
            });

            $newAlert.prependTo($holder);
            $close.prependTo($newAlert);
        }
    };

    $('body').on('click', `.${alertClass} button.close`, function(e) {
        e.preventDefault();
        ui.clearElement($(this).parent(), speed);
    });

    return self;
};

export default elrAlerts;<commit_msg>update close class<commit_after>import elrUI from 'elr-ui';
const $ = require('jquery');

let ui = elrUI();

const elrAlerts = function({
    speed = 300,
    alertClass = 'js-dismissible-alert'
} = {}) {
    const self = {
        createAlert(type, message) {
            const className = `elr-alert elr-${type}-alert ${alertClass}`;
            return ui.createElement('div', {
                text: message,
                'class': className
            });
        },
        createCloseButton() {
            return ui.createElement('button', {
                text: 'x',
                'class': 'close js-close-alert'
            });
        },
        showAlert(type, message, $holder) {
            const $newAlert = this.createAlert(type, message);
            const $close = this.createCloseButton();

            $newAlert.prependTo($holder);
            $close.prependTo($newAlert);
        }
    };

    $('body').on('click', `.${alertClass} button.js-close-alert`, function(e) {
        e.preventDefault();
        ui.clearElement($(this).parent(), speed);
    });

    return self;
};

export default elrAlerts;
{'fraction_non_alphanumeric': 0.16029411764705884, 'fraction_numerical': 0.0029411764705882353, 'mean_word_length': 1.9366906474820145, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1486374', 'n_tokens_mistral': 609, 'n_tokens_neox': 591, 'n_words': 118}