<commit_before>/**
 * nuContextMenu - jQuery Plugin
 * Copyright (c) 2015, <NAME>
 * Copyrights licensed under The MIT License (MIT)
 */
;
(function($, window, document, undefined) {

    'use strict';

    var plugin = 'nuContextMenu';

    var defaults = {
        contextMenuClass: 'nu-context-menu',
        activeClass: 'active',
    };

    var nuContextMenu = function(container, options) {
        this.container = $(container);
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = plugin;
        this.init();
    };

    $.extend(nuContextMenu.prototype, {
        init: function() {

            if (this.options.items) {
                this.items = $(this.options.items);
            }

            if (this._buildContextMenu()) {
                this._bindEvents();
                this._menuVisible = this._menu.hasClass(this.options.activeClass);
            }
        },

        _getCallback: function() {

            var callback = function() {};

            if (this.options.callback && typeof this.options.callback === 'function') {
                callback = this.options.callback;
            }

            return callback;
        },

        _buildContextMenu: function() {

            if (!this.options.menu || typeof this.options.menu !== 'object') {
                return false;
            }

            // Create context menu
            this._menu = $('<div>')
                .addClass(this.options.contextMenuClass)
                .append('<ul>');

            var menuObject = this.options.menu,
                menuList = this._menu.children('ul');

            // Create menu items 
            $.each(menuObject, function(key, value) {

                var item;

                if (value === 'separator') {
                    item = $('<hr>');
                }

                if (value && typeof value === 'object') {
<commit_msg>Update jquery.nu-context-menu.js<commit_after>/**
 * nuContextMenu - jQuery Plugin
 * Copyright (c) 2015, <NAME>
 * Copyrights licensed under The MIT License (MIT)
 */
;
(function($, window, document, undefined) {

    'use strict';

    var plugin = 'nuContextMenu';

    var defaults = {
        contextMenuClass: 'nu-context-menu',
        activeClass: 'active',
    };

    var nuContextMenu = function(container, options) {
        this.container = $(container);
        this.options = $.extend({}, defaults, options);
        this._defaults = defaults;
        this._name = plugin;
        this.init();
    };

    $.extend(nuContextMenu.prototype, {
        init: function() {

            if (this.options.items) {
                this.items = $(this.options.items);
            }

            if (this._buildContextMenu()) {
                this._bindEvents();
                this._menuVisible = this._menu.hasClass(this.options.activeClass);
            }
        },

        _getCallback: function() {
            return ((this.options.callback && typeof this.options.callback === 'function') ? this.options.callback : function () {});
        },

        _buildContextMenu: function() {

            if (!this.options.menu || typeof this.options.menu !== 'object') {
                return false;
            }

            // Create context menu
            this._menu = $('<div>')
                .addClass(this.options.contextMenuClass)
                .append('<ul>');

            var menuObject = this.options.menu,
                menuList = this._menu.children('ul');

            // Create menu items 
            $.each(menuObject, function(key, value) {

                var item;

                if (value === 'separator') {
                    item = $('<hr>');
                }

                if (value && typeof value === 'object') {

{'fraction_non_alphanumeric': 0.13561103810775296, 'fraction_numerical': 0.002102496714848883, 'mean_word_length': 1.6230186078566506, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4501145', 'n_tokens_mistral': 1025, 'n_tokens_neox': 949, 'n_words': 216}