<commit_before>// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @externs_url https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/jquery-1.9.js
// ==/ClosureCompiler==
/** @preserve    Library by <NAME> (<EMAIL>) 054-5655765
 MIT License!
 */
(function($){

    function touchById(touches, touchId) {
        for (var i = 0; i < touches.length; i++) {
            if (touches[i].identifier === touchId) return touches[i];
        }
        return null;
    }

    /** @expose */
    $.fn.fakebutton = function (tabIndex) {
        if (tabIndex !== false) {
            if (tabIndex === true) {
                tabIndex = 0;
            }
            this.each(function(){
                if (this.tabIndex === -1) {
                    this.tabIndex = tabIndex;
                }
            });
        }

        this.on('keydown.fakebutton', function (event) {
            var $this = $(this);
            if (event.target === this && (event.which === 13 || event.which === 32)) {
                event.preventDefault();
                $this
                    .addClass('active') // Add active class
                    .on('keyup.fakebutton', function (event) { // Hook event for keyup
                        if (event.target === this && (event.which === 13 || event.which === 32)) {
                            event.preventDefault();
                            $this
                                .removeClass('active') // Remove active class
                                .off('keyup.fakebutton') // Unhook keypress
                                .click(); // Trigger click
                        }
                    });
            }
        }).on('touchstart.fakebutton', function (startEvent) {
            var $this = $(this),
                didScroll = false,
                scrollHandler = function () {
                    didScroll = true;
                },
                touchId = startEvent.originalEvent.changedTouches[0].identifier,
                active = true;

            var onCancel = function () {
                $this
                    .removeClass('active') // Remove active class
                    .off('touchmove.fakebutton') // Unhook touchmove
                    .off('touchend.fakebutton') // Unhook touchend
                    .off('touchcancel.fakebutton'); // Unhook touchcancel

                trackedScrolling.off('scroll.fakebutton', scrollHandler) // Stop tracking scroll;
            };

            var trackedScrolling = $this.parents().add(window);
            trackedScrolling.on('scroll.fakebutton', scrollHandler); // Start tracking scroll to prevent "click" after scroll

            $this
                .addClass('active') // Add active class
                .on('touchmove.fakebutton', function (event) { // Start tracking touch movement to see if we are still on top

                    var touch = touchById(event.originalEvent.changedTouches, touchId);
                    if (!touch) return;

                    var element = document.elementFromPoint(touch.pageX, touch.pageY);
                    active = element && (this === element || $.contains(this, element));
                    $this.toggleClass('active', active);

                }).on('touchend.fakebutton', function (event) { // Hook event for keyup

                    var touch = touchById(event.originalEvent.changedTouches, touchId);<commit_msg>Silence Closure Compiler<commit_after>// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @externs_url https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/jquery-1.9.js
// ==/ClosureCompiler==
/** @preserve    Library by <NAME> (<EMAIL>) 054-5655765
 MIT License!
 */
(function($){

    function touchById(touches, touchId) {
        for (var i = 0; i < touches.length; i++) {
            if (touches[i].identifier === touchId) return touches[i];
        }
        return null;
    }

    /** @expose */
    $.fn.fakebutton = function (tabIndex) {
        if (tabIndex !== false) {
            if (tabIndex === true) {
                tabIndex = 0;
            }
            this.each(function(){
                if (this.tabIndex === -1) {
                    this.tabIndex = tabIndex;
                }
            });
        }

        this.on('keydown.fakebutton', function (event) {
            var $this = $(this);
            if (event.target === this && (event.which === 13 || event.which === 32)) {
                event.preventDefault();
                $this
                    .addClass('active') // Add active class
                    .on('keyup.fakebutton', function (event) { // Hook event for keyup
                        if (event.target === this && (event.which === 13 || event.which === 32)) {
                            event.preventDefault();
                            $this
                                .removeClass('active') // Remove active class
                                .off('keyup.fakebutton') // Unhook keypress
                                .click(); // Trigger click
                        }
                    });
            }
        }).on('touchstart.fakebutton', function (startEvent) {
            var $this = $(this),
                didScroll = false,
                scrollHandler = function () {
                    didScroll = true;
                },
                touchId = startEvent.originalEvent.changedTouches[0].identifier,
                active = true;

            var onCancel = function () {
                $this
                    .removeClass('active') // Remove active class
                    .off('touchmove.fakebutton') // Unhook touchmove
                    .off('touchend.fakebutton') // Unhook touchend
                    .off('touchcancel.fakebutton'); // Unhook touchcancel

                trackedScrolling.off('scroll.fakebutton', scrollHandler) // Stop tracking scroll;
            };

            var trackedScrolling = $this.parents().add(window);
            trackedScrolling.on('scroll.fakebutton', scrollHandler); // Start tracking scroll to prevent "click" after scroll

            $this
                .addClass('active') // Add active class
                .on('touchmove.fakebutton', function (event) { // Start tracking touch movement to see if we are still on top

                    var touch = touchById(event.originalEvent.changedTouches, touchId);
                    if (!touch) return;

                    var element = document.elementFromPoint(touch.pageX, touch.pageY);
                    active = element && (this === element || $.contains(this, element));
                    $this.toggleClass('active', !!active);

                }).on('touchend.fakebutton', function (event) { // Hook event for keyup

                    var touch = touchById(event.originalEvent.changedTouches, touchId);
{'fraction_non_alphanumeric': 0.12530748082766605, 'fraction_numerical': 0.006945449283750542, 'mean_word_length': 1.4854368932038835, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '4078841', 'n_tokens_mistral': 1806, 'n_tokens_neox': 1668, 'n_words': 395}