<commit_before>fixmystreet.offlineBanner = (function() {
    var toCache = 0;
    var cachedSoFar = 0;

    function formText() {
        var num = fixmystreet.offlineData.getForms().length;
        return num + ' form' + (num===1 ? '' : 's');
    }

    function onlineText() {
        return 'You have <a id="oFN" href=""><span>' + formText() + '</span> saved to submit</a>.';
    }

    function offlineText() {
        return 'You are offline \u2013 <span>' + formText() + '</span> saved.';
    }

    return {
        make: function(offline) {
            var num = fixmystreet.offlineData.getForms().length;
            var banner = ['<div class="top_banner top_banner--offline"><p><span id="offline_saving"></span> <span id="offline_forms">'];
            if (offline || num > 0) {
                banner.push(offline ? offlineText() : onlineText());
            }
            banner.push('</span></p></div>');
            banner = $(banner.join(''));
            banner.prependTo('.content');
            if (!offline && num === 0) {
                banner.hide();
            }

            window.addEventListener("offline", function(e) {
                $('.top_banner--offline').slideDown();
                $('#offline_forms').html(offlineText());
            });

            window.addEventListener("online", function(e) {
                $('#offline_forms').html(onlineText());
            });

            function nextForm(DataOrJqXHR, textStatus, jqXHROrErrorThrown) {
                fixmystreet.offlineData.shiftForm();
                $(document).dequeue('postForm');
            }

            function postForm(url, data) {
                return $.ajax({ url: url, data: data, type: 'POST' }).done(nextForm);
            }

            $(document).on('click', '#oFN', function(e) {
                e.preventDefault();
                fixmystreet.offlineData.getForms().forEach(function(form) {<commit_msg>Try and not show offline banner unnecessarily.<commit_after>fixmystreet.offlineBanner = (function() {
    var toCache = 0;
    var cachedSoFar = 0;

    function formText() {
        var num = fixmystreet.offlineData.getForms().length;
        return num + ' form' + (num===1 ? '' : 's');
    }

    function onlineText() {
        return 'You have <a id="oFN" href=""><span>' + formText() + '</span> saved to submit</a>.';
    }

    function offlineText() {
        return 'You are offline \u2013 <span>' + formText() + '</span> saved.';
    }

    return {
        make: function(offline) {
            var num = fixmystreet.offlineData.getForms().length;
            var banner = ['<div class="top_banner top_banner--offline"><p><span id="offline_saving"></span> <span id="offline_forms">'];
            if (offline || num > 0) {
                banner.push(offline ? offlineText() : onlineText());
            }
            banner.push('</span></p></div>');
            banner = $(banner.join(''));
            banner.prependTo('.content');
            if (num === 0) {
                banner.hide();
            }

            window.addEventListener("offline", function(e) {
                $('#offline_forms').html(offlineText());
            });

            window.addEventListener("online", function(e) {
                $('#offline_forms').html(onlineText());
            });

            function nextForm(DataOrJqXHR, textStatus, jqXHROrErrorThrown) {
                fixmystreet.offlineData.shiftForm();
                $(document).dequeue('postForm');
            }

            function postForm(url, data) {
                return $.ajax({ url: url, data: data, type: 'POST' }).done(nextForm);
            }

            $(document).on('click', '#oFN', function(e) {
                e.preventDefault();
                fixmystreet.offlineData.getForms().forEach(function(form) {
{'fraction_non_alphanumeric': 0.16414009409304756, 'fraction_numerical': 0.004704652378463147, 'mean_word_length': 1.9735819735819735, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 33, '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': '3293841', 'n_tokens_mistral': 1162, 'n_tokens_neox': 1080, 'n_words': 208}