<commit_before>(function($){
    $.fn.metroSelect = function(options) {
        var settings = $.extend( {
            'peeking'           : '2',
            'active-class'      : 'sel-active',
            'onchange'          : function(){}
        }, options);

        var uniq = this.attr("id") + "-";
        var sel = $("<div id='" + uniq + "selector'></div>");
        var select = this;
        sel.attr("class", select.attr("class"));
        select.parent().append(sel);
        
        select.hide();
        var max_width = 0;
        select.children().each(function(key, val) {
			var opt = $("<span class='sel-opt " + uniq + "sel " + $(val).prop('class') + "' id='" + uniq + "sel-" + key + "'>" + val.text + "</span>");
            sel.append(opt);
        });

        $('.' + uniq + 'sel').click(function () {
            select.attr('selectedIndex', $(this).attr('id').replace(uniq + 'sel-', ''));
            $('.' + uniq + 'sel').removeClass(settings['active-class']);
			$(this).addClass(settings['active-class']);
            settings.onchange();
        });

        //set the default visibilities
//		console.log("#" + uniq + "sel-" + select.prop('selectedIndex'));
        //$("#" + uniq + "sel-" + select.prop('selectedIndex')).click();
		var elem = $("#" + uniq + "sel-" + select.prop('selectedIndex'));
		select.attr('selectedIndex', elem.attr('id').replace(uniq + 'sel-', ''));
		$('.' + uniq + 'sel').removeClass(settings['active-class']);
		elem.addClass(settings['active-class']);
    };
})(jQuery);
<commit_msg>Moved to support angularJS and (maybe) better syntax<commit_after>(function($){
    $.fn.metroSelect = function(options) {
        var settings = $.extend( {
            'peeking'           : '2',
            'active-class'      : 'sel-active',
            'onchange'          : function(){}
        }, options);

        var uniq = this.attr("id") + "-";
        var sel = $("<div id='" + uniq + "selector'></div>");
        var select = this;
        sel.attr("class", select.attr("class"));
        select.parent().append(sel);
        
        select.hide();
        var max_width = 0;
        select.children().each(function(key, val) {
			var opt = $("<span class='sel-opt " + uniq + "sel " + $(val).prop('class') + "' id='" + uniq + "sel-" + key + "'>" + val.text + "</span>");
            sel.append(opt);
        });

        $('.' + uniq + 'sel').click(function () {
            select.attr('selectedIndex', $(this).attr('id').replace(uniq + 'sel-', ''));
            $('.' + uniq + 'sel').removeClass(settings['active-class']);
			$(this).addClass(settings['active-class']);
            settings.onchange();
        });

        //set the default visibilities
//		console.log("#" + uniq + "sel-" + select.prop('selectedIndex'));
        //$("#" + uniq + "sel-" + select.prop('selectedIndex')).click();
        // console.log(select);
        // console.log(select.attr('selectedIndex'));
		var elem = $("#" + uniq + "sel-" + select.attr('selectedIndex'));
//        console.log(elem)
//        console.log($('#menu'))
//		select.attr('selectedIndex', elem.attr('id').replace(uniq + 'sel-', ''));
		$('.' + uniq + 'sel').removeClass(settings['active-class']);
		elem.addClass(settings['active-class']);
    };
})(jQuery);

{'fraction_non_alphanumeric': 0.23480916030534352, 'fraction_numerical': 0.0012213740458015267, 'mean_word_length': 2.3258883248730964, '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': '5766475', 'n_tokens_mistral': 1029, 'n_tokens_neox': 1005, 'n_words': 171}