<commit_before>extends common-content
- load staticfiles
- load cache
- load i18n

block media
    if has_select2
        link(href="{{ SELECT2_CSS_URL }}", type="text/css", media="screen", rel="stylesheet")
    style.
        @media (max-width: 550px) {
            #problem-table tr :nth-child(6) {
                display: none;
            }
        }

        @media (max-width: 450px) {
            #problem-table tr :nth-child(4) {
                display: none;
            }
        }

        @media (max-width: 350px) {
            #problem-table tr :nth-child(3) {
                display: none;
            }
        }

        #problem-table th a {
            color: inherit;
            display: block;
            padding: 4px 10px;
        }

    if not IN_CONTEST
        style #problem-table th { padding: 0; }

block js_media
    if has_select2
        script(type='text/javascript', src='{{ SELECT2_JS_URL }}')
        script.
            $(function() {
                $('#category').select2();
                $('#types').select2({multiple: 1, placeholder: '{% trans "Filter by type..." %}'});
                // This is incredibly nasty to do but it's needed because otherwise the select2 steals the focus
                $('#search').keypress(function (e) {
                    if (e.keyCode == 13)
                        $('#go').click();
                });
                $('#random').click(function (e) {
                    var $form = $('form#filter-form');
                    var action = $form.attr('action');
                    $form.attr('action', '{% url "problem_random" %}').attr('target', '_blank').submit();
                    $form.attr('action', action).attr('target', '');
                    e.preventDefault();
                });
            });

    if IN_CONTEST
        script(src='{% static "libs/tablesorter.js" %}', type='text/javascript')
        script(type='text/javascript').
            if (window.history != undefined && window.history.replaceState != undefined) {
                window.history.replaceState({}, document.title, window.location.search.replace('&manual=1', ''));
            }
            $(function() {
                $.tablesorter.addParser({
                    id: 'solvedsort',
                    is: function (s) {
                        return false;
                    },
                    format: function (s, table, cell, cellIndex) {
                        return $(cell).attr('solved');
                    },
                    type: 'numeric'
                });

                $('#problem-table').tablesorter({
                    headers: {
                        0: {
                            sorter: 'solvedsort'
                        }
                    },
                    textExtraction: function (node) {
                        node = $(node);
                        var text = node.text().replace(/^\s+|\s+$/g, '');
                        return (node.hasClass('p') ? text.replace(/p$/, '') : text);
                    }
                });
            });

    script(type='text/javascript').
        $(function() {
            var info_float = $('.info-float');
            var container = $('#content-right');
            if (window.bad_browser) {
                container.css('float', 'right');
            } else if (!featureTest('position', 'sticky')) {
                fix_div(info_float, 55);
                $(window).resize(function () {
                    info_float.width(container.width());
                });
                info_float.width(container.width());
            }
        });

block title_ruler

block title_row
    - var tab = 'list'<commit_msg>Wait on document load<commit_after>extends common-content
- load staticfiles
- load cache
- load i18n

block media
    if has_select2
        link(href="{{ SELECT2_CSS_URL }}", type="text/css", media="screen", rel="stylesheet")
    style.
        @media (max-width: 550px) {
            #problem-table tr :nth-child(6) {
                display: none;
            }
        }

        @media (max-width: 450px) {
            #problem-table tr :nth-child(4) {
                display: none;
            }
        }

        @media (max-width: 350px) {
            #problem-table tr :nth-child(3) {
                display: none;
            }
        }

        #problem-table th a {
            color: inherit;
            display: block;
            padding: 4px 10px;
        }

    if not IN_CONTEST
        style #problem-table th { padding: 0; }

block js_media
    if has_select2
        script(type='text/javascript', src='{{ SELECT2_JS_URL }}')
        script.
            $(function() {
                $('#category').select2();
                $('#types').select2({multiple: 1, placeholder: '{% trans "Filter by type..." %}'});
                // This is incredibly nasty to do but it's needed because otherwise the select2 steals the focus
                $('#search').keypress(function (e) {
                    if (e.keyCode == 13)
                        $('#go').click();
                });
                $('#random').click(function (e) {
                    var $form = $('form#filter-form');
                    var action = $form.attr('action');
                    $form.attr('action', '{% url "problem_random" %}').attr('target', '_blank').submit();
                    $form.attr('action', action).attr('target', '');
                    e.preventDefault();
                });
            });

    if IN_CONTEST
        script(src='{% static "libs/tablesorter.js" %}', type='text/javascript')
        script(type='text/javascript').
            $(function() {
                $.tablesorter.addParser({
                    id: 'solvedsort',
                    is: function (s) {
                        return false;
                    },
                    format: function (s, table, cell, cellIndex) {
                        return $(cell).attr('solved');
                    },
                    type: 'numeric'
                });

                $('#problem-table').tablesorter({
                    headers: {
                        0: {
                            sorter: 'solvedsort'
                        }
                    },
                    textExtraction: function (node) {
                        node = $(node);
                        var text = node.text().replace(/^\s+|\s+$/g, '');
                        return (node.hasClass('p') ? text.replace(/p$/, '') : text);
                    }
                });
                if (window.history != undefined && window.history.replaceState != undefined) {
                    window.history.replaceState({}, document.title, window.location.search.replace('&manual=1', ''));
                }
            });

    script(type='text/javascript').
        $(function() {
            var info_float = $('.info-float');
            var container = $('#content-right');
            if (window.bad_browser) {
                container.css('float', 'right');
            } else if (!featureTest('position', 'sticky')) {
                fix_div(info_float, 55);
                $(window).resize(function () {
                    info_float.width(container.width());
                });
                info_float.width(container.width());
            }
        });

block title_ruler

block title_row
    - var tab = 'list'
{'fraction_non_alphanumeric': 0.14516563425801238, 'fraction_numerical': 0.008618367896579585, 'mean_word_length': 1.2601947656725503, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6172603', 'n_tokens_mistral': 2008, 'n_tokens_neox': 1841, 'n_words': 390}