<commit_before>$(function() {
    function revealStatement() {
        $(this).hide()
            .parent().children('.fadeout').hide()
            .parent().children('.truncated').animate({
                maxHeight: '800px'
            }, 'slow', 'linear',
            function () {
                $(this).addClass('displayall').css('max-height', 'none').removeClass('truncated');
        });
    }
    
    function addMoreLinks() {
        $('.statement .focus:not(.truncated)').each(function() {
           if (this.clientHeight < this.scrollHeight) {
               $(this).addClass('truncated');
               var $morelink = $(document.createElement('div')).addClass('morelink').click(revealStatement);
               var $fadeout = $(document.createElement('div')).addClass('fadeout');
               $(this).parent().append($morelink).append($fadeout);
           }
        });
    }
    if ($('.statement_browser').length) {
        addMoreLinks();
    }
    var $paginated = $('#paginated');
    $('.pagelink').live('click', function(e) {
        e.preventDefault();
        var $pagelink = $(this);
        $.bbq.pushState($.deparam.querystring(this.href));
        showPaginated = $pagelink.hasClass('show_paginated_div');
        if (showPaginated) {
            $(this).html('Loading...')
        }
        $paginated.find('.pagination').addClass('loading');
    });
    
    $(window).bind('hashchange', function(e) {
        if (e.fragment && e.fragment != 'hl') {
            $paginated.find('.pagination').addClass('loading');
            $paginated.load('?' + e.fragment, '', function() {
                var scrollDown = Boolean($(document).scrollTop() > $paginated.offset().top);
                if ($paginated.is(':hidden')) {
                    $('.show_paginated_div').hide()
                    $('#paginated_wrapped').show();
                    scrollDown = true;
                }
                if ($('.statement_browser').length) {
                    addMoreLinks();
                }
                $('.related_link').tooltip({delay: 200, showURL: false});
                if (scrollDown) { 
                    $('html,body').animate({scrollTop: $paginated.offset().top - 15});
                }
                showPaginated = false;
            });
        }
    });
    
    if (location.hash) {
        $(window).trigger('hashchange');
    }
    
    /* STATEMENT SHARING BUTTONS */
    
    if (!$('body').hasClass('search')) {
        var $statementTools = $('<div id="statement-tools" style="display: none"><img id="share_link" src="/static/images/link.png" class="tip" title="Share a link to this statement"><img id="share_twitter" src="/static/images/twitter.png" class="tip" alt="Twitter" title="Share on Twitter"><img id="share_facebook" src="/static/images/facebook.png" class="tip" title="Share on Facebook"></div>');
        $statementTools.find('.tip').tooltip({delay: 100, showURL: false});
        $paginated.after($statementTools);
        var $currentStatement;
        function currentStatementURL() {
            return 'http://openparliament.ca' + $currentStatement.attr('data-url');
        }
        $('.statement').live('mouseenter', function() {
            $currentStatement = $(this);
            var offset = $currentStatement.offset();
            $statementTools.css({'top': offset.top, 'left': offset.left + ($currentStatement.width() - 66)}).show();
        });
        $('#share_link').click(function() {
            if (!$currentStatement.find('.share_link').length) {
                var linkbox = $('<input type="text">').val(currentStatementURL()).click(function() {
                    if (this.createTextRange) {
                        // This is for IE and Opera.
                        range = this.createTextRange();<commit_msg>Hide statement tools when not hovering over a statement.<commit_after>$(function() {
    function revealStatement() {
        $(this).hide()
            .parent().children('.fadeout').hide()
            .parent().children('.truncated').animate({
                maxHeight: '800px'
            }, 'slow', 'linear',
            function () {
                $(this).addClass('displayall').css('max-height', 'none').removeClass('truncated');
        });
    }
    
    function addMoreLinks() {
        $('.statement .focus:not(.truncated)').each(function() {
           if (this.clientHeight < this.scrollHeight) {
               $(this).addClass('truncated');
               var $morelink = $(document.createElement('div')).addClass('morelink').click(revealStatement);
               var $fadeout = $(document.createElement('div')).addClass('fadeout');
               $(this).parent().append($morelink).append($fadeout);
           }
        });
    }
    if ($('.statement_browser').length) {
        addMoreLinks();
    }
    var $paginated = $('#paginated');
    $('.pagelink').live('click', function(e) {
        e.preventDefault();
        var $pagelink = $(this);
        $.bbq.pushState($.deparam.querystring(this.href));
        showPaginated = $pagelink.hasClass('show_paginated_div');
        if (showPaginated) {
            $(this).html('Loading...')
        }
        $paginated.find('.pagination').addClass('loading');
    });
    
    $(window).bind('hashchange', function(e) {
        if (e.fragment && e.fragment != 'hl') {
            $paginated.find('.pagination').addClass('loading');
            $paginated.load('?' + e.fragment, '', function() {
                var scrollDown = Boolean($(document).scrollTop() > $paginated.offset().top);
                if ($paginated.is(':hidden')) {
                    $('.show_paginated_div').hide()
                    $('#paginated_wrapped').show();
                    scrollDown = true;
                }
                if ($('.statement_browser').length) {
                    addMoreLinks();
                }
                $('.related_link').tooltip({delay: 200, showURL: false});
                if (scrollDown) { 
                    $('html,body').animate({scrollTop: $paginated.offset().top - 15});
                }
                showPaginated = false;
            });
        }
    });
    
    if (location.hash) {
        $(window).trigger('hashchange');
    }
    
    /* STATEMENT SHARING BUTTONS */
    
    if (!$('body').hasClass('search')) {
        var $statementTools = $('<div id="statement-tools" style="display: none"><img id="share_link" src="/static/images/link.png" class="tip" title="Share a link to this statement"><img id="share_twitter" src="/static/images/twitter.png" class="tip" alt="Twitter" title="Share on Twitter"><img id="share_facebook" src="/static/images/facebook.png" class="tip" title="Share on Facebook"></div>');
        $statementTools.bind('mouseenter', function () {$statementTools.show();})
            .bind('mouseleave', function () {$statementTools.hide();})
            .find('.tip').tooltip({delay: 100, showURL: false});
        $paginated.after($statementTools);
        var $currentStatement;
        function currentStatementURL() {
            return 'http://openparliament.ca' + $currentStatement.attr('data-url');
        }
        $('.statement').live('mouseenter', function() {
            $currentStatement = $(this);
            var offset = $currentStatement.offset();
            $statementTools.css({'top': offset.top, 'left': offset.left + ($currentStatement.width() - 66)}).show();
        }).live('mouseleave', function() {$statementTools.hide();});
        $('#share_link').click(function() {
            if (!$currentStatement.find('.share_link').length) {
                var linkbox = $('<input type="text">').val(currentStatementURL()).click(function() {
                    if (this.createTextRange) {
                        // This is for IE and Opera.
                        range = this.createTextRange();
{'fraction_non_alphanumeric': 0.18200305033045247, 'fraction_numerical': 0.0033045246568378242, 'mean_word_length': 2.162781350482315, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '5267180', 'n_tokens_mistral': 2146, 'n_tokens_neox': 2068, 'n_words': 334}