<commit_before>(function($) {
    $.Toolbar = function(items, text, options){
        var base = this;
        base.items = items;
        base.nb_items = items.length;

        base.init = function(){
            base.current = 0;
            base.text = text;
            base.options = $.extend({}, $.Toolbar.defaultOptions, options);
            base.threshold = localStorage.threshold || base.options.thresholds[0];
            base.folding();
            base.create();
        };

        base.create = function() {
            var t = '<div id="toolbar"><span id="toolbar_items">{toolbar.text} : ' +
                    '  <span id="toolbar_current_item">{toolbar.current}</span> / ' +
                    '  <span id="toolbar_nb_items">{toolbar.nb_items}</span> ' +
                    '  <a href="#" accesskey="<" class="prev">&lt;</a> | ' +
                    '  <a href="#" accesskey=">" class="next">&gt;</a>' +
                    '</span><span id="toolbar_threshold">Seuil : ' +
                    '  <a href="#" class="change">{toolbar.threshold}</a>' +
                    '</span></div>';
            $('body').append($.nano(t, {toolbar: base}));
            $('#toolbar .prev').click(base.prev_item);
            $('#toolbar .next').click(base.next_item);
            $('#toolbar .change').click(base.change_threshold);
            /* Use the '<' and '>' to navigate in the items */
            $(document).bind('keypress', '<',       function() { return base.prev_item(); })
                       .bind('keypress', 'shift+>', function() { return base.next_item(); })
                       .bind('keypress', 'k',       function() { return base.prev_item(); })
                       .bind('keypress', 'j',       function() { return base.next_item(); });
        };

        base.next_item = function() {
            base.current += 1;
            if (base.current > base.nb_items) { base.current -= base.nb_items; }
            return base.go_to_current();
        };

        base.prev_item = function() {
            base.current -= 1;
            if (base.current <= 0) { base.current += base.nb_items; }
            return base.go_to_current();
        };

        base.go_to_current = function() {
            if (base.nb_items === 0) { return ; }
            var item = base.items[base.current - 1];
            var pos = $(item).offset().top;
            $('html,body').animate({scrollTop: pos}, 500);
            $('#toolbar_current_item').text(base.current);
            return false;
        };

        base.change_threshold = function() {
            var ths = base.options.thresholds;
            var index = $.inArray(parseInt($(this).text(), 10), ths) + 1;
            localStorage.threshold = base.threshold = ths[index % ths.length];
            $(this).text(base.threshold);
            base.folding();
            return false;<commit_msg>Fix on JS for konqueror<commit_after>(function($) {
    $.Toolbar = function(items, text, options){
        var base = this;
        base.items = items;
        base.nb_items = items.length;

        base.init = function(){
            base.current = 0;
            base.text = text;
            base.options = $.extend({}, $.Toolbar.defaultOptions, options);
            base.storage = ('localStorage' in window && window['localStorage'] !== null) ? window['localStorage'] : {};
            base.threshold = base.storage.threshold || base.options.thresholds[0];
            base.folding();
            base.create();
        };

        base.create = function() {
            var t = '<div id="toolbar"><span id="toolbar_items">{toolbar.text} : ' +
                    '  <span id="toolbar_current_item">{toolbar.current}</span> / ' +
                    '  <span id="toolbar_nb_items">{toolbar.nb_items}</span> ' +
                    '  <a href="#" accesskey="<" class="prev">&lt;</a> | ' +
                    '  <a href="#" accesskey=">" class="next">&gt;</a>' +
                    '</span><span id="toolbar_threshold">Seuil : ' +
                    '  <a href="#" class="change">{toolbar.threshold}</a>' +
                    '</span></div>';
            $('body').append($.nano(t, {toolbar: base}));
            $('#toolbar .prev').click(base.prev_item);
            $('#toolbar .next').click(base.next_item);
            $('#toolbar .change').click(base.change_threshold);
            /* Use the '<' and '>' to navigate in the items */
            $(document).bind('keypress', '<',       function() { return base.prev_item(); })
                       .bind('keypress', 'shift+>', function() { return base.next_item(); })
                       .bind('keypress', 'k',       function() { return base.prev_item(); })
                       .bind('keypress', 'j',       function() { return base.next_item(); });
        };

        base.next_item = function() {
            base.current += 1;
            if (base.current > base.nb_items) { base.current -= base.nb_items; }
            return base.go_to_current();
        };

        base.prev_item = function() {
            base.current -= 1;
            if (base.current <= 0) { base.current += base.nb_items; }
            return base.go_to_current();
        };

        base.go_to_current = function() {
            if (base.nb_items === 0) { return ; }
            var item = base.items[base.current - 1];
            var pos = $(item).offset().top;
            $('html,body').animate({scrollTop: pos}, 500);
            $('#toolbar_current_item').text(base.current);
            return false;
        };

        base.change_threshold = function() {
            var ths = base.options.thresholds;
            var index = $.inArray(parseInt($(this).text(), 10), ths) + 1;
            base.storage.threshold = base.threshold = ths[index % ths.length];
            $(this).text(base.threshold);
            base.folding();
            return false;
{'fraction_non_alphanumeric': 0.17549219280380177, 'fraction_numerical': 0.004412763068567549, 'mean_word_length': 1.7757889778615168, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3609960', 'n_tokens_mistral': 1672, 'n_tokens_neox': 1628, 'n_words': 306}