<commit_before>$jq = jQuery.noConflict();

/**
 * Create and trigger raw DOM event on a jQuery object
 * @param jQuery $el
 * @param string type event type
 * @param boolean bubbles
 * @param boolean cancelable
 */
function triggerDOMEvent($el, type, bubbles, cancelable) {

    if (typeof bubbles == "undefined") {
        bubbles = true;
    }
    if (typeof cancelable == "undefined") {
        cancelable = true;
    }

    $el.each(function() {
        var evt = document.createEvent("HTMLEvents");
        evt.initEvent(type, bubbles, cancelable);
        console.log('dispatchEvent on ');
        console.log(this);
        this.dispatchEvent(evt);
    });
}

;(function($) {
    $('.recording_content .menu_content').each(function() {
        var $this = $(this);
        var $select = $this.find('select');
        var closeDiv = $this.find('div.close');

        $select.chosen({ width: '260px' })
        .bind('change', function(e) {
            e.stopImmediatePropagation();

            $(this).unbind('change');

            triggerDOMEvent($(this), 'change', false, true);
        });

        $('<a class="refresh" href="#">Refresh</a>')
            .on('click', function(e) {
                e.preventDefault();
                $select.trigger("chosen:updated");
            })
            .insertAfter(closeDiv)
        ;
    });
})(jQuery);<commit_msg>update chosen when clicking on open link<commit_after>$jq = jQuery.noConflict();

/**
 * Create and trigger raw DOM event on a jQuery object
 * @param jQuery $el
 * @param string type event type
 * @param boolean bubbles
 * @param boolean cancelable
 */
function triggerDOMEvent($el, type, bubbles, cancelable) {

    if (typeof bubbles == "undefined") {
        bubbles = true;
    }
    if (typeof cancelable == "undefined") {
        cancelable = true;
    }

    $el.each(function() {
        var evt = document.createEvent("HTMLEvents");
        evt.initEvent(type, bubbles, cancelable);
        console.log('dispatchEvent on ');
        console.log(this);
        this.dispatchEvent(evt);
    });
}

;(function($) {
    $('.recording_content .menu_content').each(function() {
        var $this = $(this);
        var $select = $this.find('select');
        var closeDiv = $this.find('div.close');

        $select.chosen({ width: '260px' })
        .bind('change', function(e) {
            e.stopImmediatePropagation();

            $(this).unbind('change');

            triggerDOMEvent($(this), 'change', false, true);
        });

        $('<a class="refresh" href="#">Refresh</a>')
            .on('click', function(e) {
                e.preventDefault();
                $select.trigger("chosen:updated");
            })
            .insertAfter(closeDiv)
        ;
    });

    $('.recording_content .menu_target').click(function() {
        $(this).parent().find('.menu_content select').trigger('chosen:updated');
    });
})(jQuery);
{'fraction_non_alphanumeric': 0.1656966792194454, 'fraction_numerical': 0.0020540910647038686, 'mean_word_length': 2.3858632676709153, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7101666', 'n_tokens_mistral': 868, 'n_tokens_neox': 836, 'n_words': 181}