<commit_before>/*
 * Trivial modal to replace Thickbox from WordPress,
 * since it doesn't work as expected.
 */

define(['jquery'], function($) {
    var overlay = $('<div class="neochic-woodlets-modal" />');
    var contentFrame = null;
    var closeButton = $('<div class="tb-close-icon">Close</div>');
    var breadCrumbTrail = $('<ul class="woodlets-breadcrumb"></ul>');
    var $body = $('body');
    var stack = [];

    var clear = function() {
        $(contentFrame).trigger('neochic-woodlets-modal-stack', contentFrame);
        closeButton.detach();
        breadCrumbTrail.detach();
        contentFrame.detach();
        overlay.detach();
        $body.removeClass('neochic-woodlets-modal-active');
    };

    var open = function(content, title) {
        if (contentFrame) {
            clear();<commit_msg>* fixed js bug<commit_after>/*
 * Trivial modal to replace Thickbox from WordPress,
 * since it doesn't work as expected.
 */

define(['jquery'], function($) {
    var overlay = $('<div class="neochic-woodlets-modal" />');
    var contentFrame = null;
    var closeButton = $('<div class="tb-close-icon">Close</div>');
    var breadCrumbTrail = $('<ul class="woodlets-breadcrumb"></ul>');
    var $body = $();
    var stack = [];

    $(document).ready(function() {
       $body = $('body');
    });

    var clear = function() {
        $(contentFrame).trigger('neochic-woodlets-modal-stack', contentFrame);
        closeButton.detach();
        breadCrumbTrail.detach();
        contentFrame.detach();
        overlay.detach();
        $body.removeClass('neochic-woodlets-modal-active');
    };

    var open = function(content, title) {
        if (contentFrame) {
            clear();
{'fraction_non_alphanumeric': 0.17416715371127994, 'fraction_numerical': 0.0, 'mean_word_length': 2.953810623556582, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3768773', 'n_tokens_mistral': 523, 'n_tokens_neox': 511, 'n_words': 110}