<commit_before>/*
 * notify.me
 * https://github.com/oltodo/notify.me
 * Copyright 2013 Oltodo, Inc. and other contributors; Licensed MIT
 */

(function () {

    var types = {
        info: {
            icon: 'icon icon-info',
            duration: 5 // seconds
        },
        warning: {
            icon: 'icon icon-warning',
            duration: 10 // seconds
        },
        success: {
            icon: 'icon icon-success',
            duration: 5 // seconds
        },
        error: {
            icon: 'icon icon-error',
            duration: false // no duration
        }
    };

    var stacks = {
        'top': null,
        'top-left': null,
        'top-right': null,
        'bottom': null,
        'bottom-left': null,
        'bottom-right': null,
        'center': null
    };

    // Notice class
    var notice = function (type, options) {

        var
            stack = Stack.getStack(options.stack || 'top-right'),
            timer = null;

        // Get type
        var tmp = type;
        type = types[tmp];
        type.name = tmp;

        // Get options
        options = $.extend({
            icon: type.icon,
            duration: type.duration,
            frozen: false
        }, options);


        // Show method
        var show = function () {
            $view.addClass('ni-shown');
        };

        // Close method
        var close = function () {
            $view.addClass('ni-hidden');

            setTimeout(function () {
                $view.remove();
                stack._calculPositionsForCenterStack();
            }, 300);
        };

        var clearTimer = function () {
            if(timer !== null) {
                clearTimeout(timer);
            }
        };

        var setTimer = function () {
            clearTimer();
            timer = setTimeout(close, options.duration*1000);
        };

        // Init view
        var content = '';

        content += '<div class="notifyme-item ni-'+type.name+'">';

        if(!options.frozen) {
            content += '    <span class="ni-close">&times;</span>';
        }

        if(options.icon) {
            content += '    <span class="ni-icon">';
            content += '        <i class="'+options.icon+'"></i>';
            content += '    </span>';
        }

        if(options.title) {
            content += '<p class="ni-title">'+options.title+'</p>';
        }

        if(options.text) {
            content += '<p class="ni-text">'+options.text+'</p>';
        }

        content += '</div>';

        var $view = $(content);

        // Set events
        $view.find('.ni-close').on('click', function () {
            close();
        });

        // Set duration
        if(options.duration) {
            setTimer();
            $view.hover(clearTimer, setTimer);
        }

        // Add view to stack
        if(/^bottom/.test(stack.name)) {
            stack.prepend($view);
        } else {
            stack.append($view);
        }

        setTimeout(show, 10);

        return {
            show: show,
            close: close<commit_msg>Remove show method<commit_after>/*
 * notify.me
 * https://github.com/oltodo/notify.me
 * Copyright 2013 Oltodo, Inc. and other contributors; Licensed MIT
 */

(function () {

    var types = {
        info: {
            icon: 'icon icon-info',
            duration: 5 // seconds
        },
        warning: {
            icon: 'icon icon-warning',
            duration: 10 // seconds
        },
        success: {
            icon: 'icon icon-success',
            duration: 5 // seconds
        },
        error: {
            icon: 'icon icon-error',
            duration: false // no duration
        }
    };

    var stacks = {
        'top': null,
        'top-left': null,
        'top-right': null,
        'bottom': null,
        'bottom-left': null,
        'bottom-right': null,
        'center': null
    };

    // Notice class
    var notice = function (type, options) {

        var
            stack = Stack.getStack(options.stack || 'top-right'),
            timer = null;

        // Get type
        var tmp = type;
        type = types[tmp];
        type.name = tmp;

        // Get options
        options = $.extend({
            icon: type.icon,
            duration: type.duration,
            frozen: false
        }, options);


        // Show method
        var show = function () {
            $view.addClass('ni-shown');
        };

        // Close method
        var close = function () {
            $view.addClass('ni-hidden');

            setTimeout(function () {
                $view.remove();
                stack._calculPositionsForCenterStack();
            }, 300);
        };

        var clearTimer = function () {
            if(timer !== null) {
                clearTimeout(timer);
            }
        };

        var setTimer = function () {
            clearTimer();
            timer = setTimeout(close, options.duration*1000);
        };

        // Init view
        var content = '';

        content += '<div class="notifyme-item ni-'+type.name+'">';

        if(!options.frozen) {
            content += '    <span class="ni-close">&times;</span>';
        }

        if(options.icon) {
            content += '    <span class="ni-icon">';
            content += '        <i class="'+options.icon+'"></i>';
            content += '    </span>';
        }

        if(options.title) {
            content += '<p class="ni-title">'+options.title+'</p>';
        }

        if(options.text) {
            content += '<p class="ni-text">'+options.text+'</p>';
        }

        content += '</div>';

        var $view = $(content);

        // Set events
        $view.find('.ni-close').on('click', function () {
            close();
        });

        // Set duration
        if(options.duration) {
            setTimer();
            $view.hover(clearTimer, setTimer);
        }

        // Add view to stack
        if(/^bottom/.test(stack.name)) {
            stack.prepend($view);
        } else {
            stack.append($view);
        }

        setTimeout(show, 10);

        return {
            close: close
{'fraction_non_alphanumeric': 0.14963562753036438, 'fraction_numerical': 0.005506072874493927, 'mean_word_length': 1.2798080472499078, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 2, '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': '191692', 'n_tokens_mistral': 1723, 'n_tokens_neox': 1642, 'n_words': 363}