<commit_before>// Main function
requirejs(['./app', './bridge', './console_api', 'jquery'], function (app, Bridge, API, $) {
    // 1. Load the app and UI (done)
    
    // 2. Publish 'Bridge' interface that the Ruby side will need to return from callbacks.
    // window.Bridge = Bridge; // This is now done with requirejs('bridge')

    // 3. Publish 'Console' API interface on which the consoles on the Ruby side will call functions.
    window.Console = API;

    // 4. Fallback for svg-resources to png images.
    if (navigator.userAgent.match(/MSIE/i)) {
        // Internet Explorer (even if it can render svg, it does not scale them properly).
        $('img').each(function (index, img) {
            img.src = img.src.replace(/\.svg$/, '.png');
        });
    } else {
        // Fallback on load failure.
        $('img').on('error', function () {
            var img = $(this),
                src = img.attr('src');
            img.attr('src', src.replace(/\.svg$/, '.png'));
        });
    }<commit_msg>Fix Internet Explorer detection for fallback to image resources (e.g. SU2014)<commit_after>// Main function
requirejs(['./app', './bridge', './console_api', 'jquery'], function (app, Bridge, API, $) {
    // 1. Load the app and UI (done)
    
    // 2. Publish 'Bridge' interface that the Ruby side will need to return from callbacks.
    // window.Bridge = Bridge; // This is now done with requirejs('bridge')

    // 3. Publish 'Console' API interface on which the consoles on the Ruby side will call functions.
    window.Console = API;

    // 4. Fallback for svg-resources to png images.
    if (navigator.userAgent.match(/MSIE|Trident/i)) {
        // Internet Explorer (even if it can render svg, it does not scale them properly).
        $('img').each(function (index, img) {
            img.src = img.src.replace(/\.svg$/, '.png');
        });
    } else {
        // Fallback on load failure.
        $('img').on('error', function () {
            var img = $(this),
                src = img.attr('src');
            img.attr('src', src.replace(/\.svg$/, '.png'));
        });
    }
{'fraction_non_alphanumeric': 0.16035950804162724, 'fraction_numerical': 0.005676442762535478, 'mean_word_length': 2.180451127819549, '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': '5363893', 'n_tokens_mistral': 635, 'n_tokens_neox': 606, 'n_words': 214}