<commit_before>'use strict';
/**
* @desc Cookie info dialog plugin
* examples novicell.cookieInfo.init();
* @author <NAME> - DLA
* @requires jquery
*/

var novicell = novicell || {};

novicell.cookieInfo = novicell.cookieInfo || function($){
    var $body = $('body');

    function init() {
        var $cookieInfo = $('#cookie-info');
        var $cookieClose = $('#cookie-info-close');
        var $cookieOpen = $('#cookie-info-open');

        if ($cookieInfo.length) {
            // If we have displayed it once, set cookie for one year
            if (getCookie("cookieAccept") === "displayed") {
                setCookie("cookieAccept", "accepted", 365);
            }

            // Check if the cookie info has been displayed, if not set session cookie
            if (getCookie("cookieAccept") === "") {
                setCookie("cookieAccept", "displayed");

                setTimeout(function() {
                    $body.addClass('cookie-info-show');
                }, 1000);
            }

            // Button eventlisteners
            $cookieOpen.click(function() {
                showCookie();
            });

            $cookieClose.click(function() {
                hideCookie();
                setCookie("cookieAccept", "accepted", 365);
            });
        }
    }

    // Functions for opening an closing the cookie-info
    function showCookie(){
        $body.addClass('cookie-info-show');
    }

    function hideCookie(){
        $body.removeClass('cookie-info-show');
    }

    return {
        init: init
    };
}(jQuery);

/* Cookie helper functions
*******************************/

// Get cookie<commit_msg>Update novicell.cookieinfo.js<commit_after>'use strict';
/**
* @desc Cookie info dialog plugin
* @author <NAME> - DLA & <NAME> - MSL
* @example novicell.cookieInfo.init();
* @requires none
*/

var novicell = novicell || {};

novicell.cookieInfo = novicell.cookieInfo || function(){
    var body = document.querySelector("body");

    function init() {
        var cookieInfo = document.querySelector('#cookie-info');
        var cookieClose = document.querySelector('#cookie-info-close');
        var cookieOpen = document.querySelector('#cookie-info-open');
        if (cookieInfo) {
            // If we have displayed it once, set cookie for one year
            if (getCookie("cookieAccept") === "displayed") {
                setCookie("cookieAccept", "accepted", 365);
            }

            // Check if the cookie info has been displayed, if not set session cookie
            if (getCookie("cookieAccept") === "") {
                setCookie("cookieAccept", "displayed");

                setTimeout(function() {
                    body.classList.add('cookie-info-show');
                }, 1000);
            }

            // Button eventlisteners
            if(cookieOpen) {
                cookieOpen.addEventListener('click', function(e) {
                    showCookie();
                });
            }

            if(cookieClose) {
                cookieClose.addEventListener('click', function(e) {
                    hideCookie();
                    setCookie("cookieAccept", "accepted", 365);
                });
            }
        }
    }

    // Functions for opening an closing the cookie-info
    function showCookie(){
        body.classList.add('cookie-info-show');
    }

    function hideCookie(){
        body.classList.remove('cookie-info-show');
    }

    return {
        init: init
    };
}();

/* Cookie helper functions
*******************************/

// Get cookie
{'fraction_non_alphanumeric': 0.15165081141578063, 'fraction_numerical': 0.005595970900951315, 'mean_word_length': 1.9112377850162867, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '7647520', 'n_tokens_mistral': 951, 'n_tokens_neox': 893, 'n_words': 213}