<commit_before>/**
 * MLJLib
 * MeshLabJS Library
 * 
 * Copyright(C) 2015
 * <NAME> 
 * Visual Computing Lab
 * ISTI - CNR
 * 
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it under 
 * the terms of the GNU General Public License as published by the Free Software 
 * Foundation; either version 2 of the License, or (at your option) any later 
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
 * FOR A PARTICULAR PURPOSE. See theGNU General Public License 
 * (http://www.gnu.org/licenses/gpl.txt) for more details.
 * 
 */

/**
 * @file Defines and installs the SearchTool widget 
 * @author <NAME>
 */
(function () {

    /**         
     * @class Create a new SearchTool widget
     * @augments  MLJ.gui.widget.Widget
     * @private
     * @memberOf MLJ.gui.widget
     * @author <NAME> 
     */
    var _SearchTool = function () {
        var _elements = [];
        var _$searchTool = $('<div id="mlj-search-widget"></div>');
        var _$input = $('<input placeholder="Search">');

        function refresh(select) {
            $(document).trigger("mljSearchSelect", [select]);
        }

        /**
         * @author <NAME>         
         */
        this._make = function () {//build function 
            _$searchTool.append(_$input);
            var select;
            _$input.keyup(function () {
                var matcher = new RegExp("(^)" + $.ui.autocomplete.escapeRegex($(this).val()), "i");
                select = $.grep(_elements, function (item) {
                    return matcher.test(item);
                });

                refresh(select);
            });

            return _$searchTool;
        };

        /**
         * Adds a new tag in the search list
         * @param {String} tag The tag to insert in the search list
         */
        this.addItem = function (tag) {
            var split = tag.split(" ");<commit_msg>search tool should have focus when page load<commit_after>/**
 * MLJLib
 * MeshLabJS Library
 * 
 * Copyright(C) 2015
 * <NAME> 
 * Visual Computing Lab
 * ISTI - CNR
 * 
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it under 
 * the terms of the GNU General Public License as published by the Free Software 
 * Foundation; either version 2 of the License, or (at your option) any later 
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
 * FOR A PARTICULAR PURPOSE. See theGNU General Public License 
 * (http://www.gnu.org/licenses/gpl.txt) for more details.
 * 
 */

/**
 * @file Defines and installs the SearchTool widget 
 * @author <NAME>
 */
(function () {

    /**         
     * @class Create a new SearchTool widget
     * @augments  MLJ.gui.widget.Widget
     * @private
     * @memberOf MLJ.gui.widget
     * @author <NAME> 
     */
    var _SearchTool = function () {
        var _elements = [];
        var _$searchTool = $('<div id="mlj-search-widget"></div>');
        var _$input = $('<input placeholder="Search" autofocus>');

        function refresh(select) {
            $(document).trigger("mljSearchSelect", [select]);
        }

        /**
         * @author <NAME>         
         */
        this._make = function () {//build function 
            _$searchTool.append(_$input);
            var select;
            _$input.keyup(function () {
                var matcher = new RegExp("(^)" + $.ui.autocomplete.escapeRegex($(this).val()), "i");
                select = $.grep(_elements, function (item) {
                    return matcher.test(item);
                });

                refresh(select);
            });

            return _$searchTool;
        };

        /**
         * Adds a new tag in the search list
         * @param {String} tag The tag to insert in the search list
         */
        this.addItem = function (tag) {
            var split = tag.split(" ");
{'fraction_non_alphanumeric': 0.11972000965483949, 'fraction_numerical': 0.0024137098720733766, 'mean_word_length': 1.992057761732852, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4868725', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1107, 'n_words': 376}