<commit_before>;(function(window, $, Modernizr, _gaq, site) {
    'use strict';

    if (site.platform === 'android') {
        return;
    }

    // Load images on load so as not to block the loading of other images.
    $(window).on('load', function() {
        // Screen 1 is unique for IE < 9
        if (site.platform === 'windows' && $.browser.msie && $.browser.version < 9) {
            $('html').addClass('winIE8');
        }

        $('body').addClass('ready-for-scene2');
    });

    function ga_track() {
        if (_gaq) {
            // track download click
            _gaq.push(['_trackPageview',
                       '/en-US/products/download.html?referrer=new-b']);
        }
    }

    function dl_redirect(url) {
        // delay redirect to ensure GA tracking occurs
        window.setTimeout(function() {
            window.location.href = url;
        }, 300);
    }

    // Bind events on domReady.
    $(function() {
        // Pull Firefox download link from the download button and add to the
        // 'click here' link.
        // TODO: Remove and generate link in bedrock.
        var $li = $('.download-list li:visible').filter(':first');
        var ff_dl_url = $li.find('a:first').attr('href');
        $('#direct-download-link').attr('href', ff_dl_url).on('click', function(e) {
            e.preventDefault();
            ga_track();
            dl_redirect($(this).attr('href'));
        });

        // Trigger animation after download.
        var $scene2 = $('#scene2');
        var $stage = $('#stage-firefox');
        var $thankYou = $('.thankyou');
        $('.download-firefox').on('click', function(e) {
            e.preventDefault();
            var $link = $(this);
            ga_track();

            if (!Modernizr.csstransitions) {
                $scene2.css('visibility', 'visible');
                $stage.animate({
                    bottom: '-400px'
                }, 400, function() {
                    $thankYou.focus();
                });
            } else {
                $stage.addClass('scene2');
                // transitionend fires multiple times in FF 17, including
                // before the transition actually finished.
                // Work-around with setTimeout.
                window.setTimeout(function() {
                    $thankYou.focus();
                }, 500);
            }

            dl_redirect($link.attr('href'));
        });
    });
})(window, window.jQuery, window.Modernizr, window._gaq, window.site);<commit_msg>Fix back button for scene 2 > scene 1. bug 824356<commit_after>;(function(window, $, Modernizr, _gaq, site) {
    'use strict';

    if (site.platform === 'android') {
        return;
    }

    // Load images on load so as not to block the loading of other images.
    $(window).on('load', function() {
        // Screen 1 is unique for IE < 9
        if (site.platform === 'windows' && $.browser.msie && $.browser.version < 9) {
            $('html').addClass('winIE8');
        }

        $('body').addClass('ready-for-scene2');
    });

    function ga_track() {
        if (_gaq) {
            // track download click
            _gaq.push(['_trackPageview',
                       '/en-US/products/download.html?referrer=new-b']);
        }
    }

    function dl_redirect(url) {
        // delay redirect to ensure GA tracking occurs
        window.setTimeout(function() {
            window.location.href = url;
        }, 300);
    }

    var $scene2 = $('#scene2');
    var $stage = $('#stage-firefox');
    var $thankYou = $('.thankyou');
    // drop support for IE7/8. good?
    var can_hashchange = ('onhashchange' in window && 'addEventListener' in window);

    function show_scene(scene) {
        if (scene === 2) {
            if (!Modernizr.csstransitions) {
                $scene2.css('visibility', 'visible'); // ensure visibility prior to animation
                $stage.animate({
                    bottom: '-400px'
                }, 400, function() {
                    $thankYou.focus();
                });
            } else {
                $stage.addClass('scene2');
                // transitionend fires multiple times in FF 17, including
                // before the transition actually finished.
                // Work-around with setTimeout.
                window.setTimeout(function() {
                    $thankYou.focus();
                }, 500);
            }
        } else {
            if (!Modernizr.csstransitions) {
                $stage.animate({
                    bottom: '0px'
                }, 400, function() {
                    $scene2.css('visibility', 'hidden'); // revert scene2 to hidden
                    $thankYou.blur();
                });
            } else {
                $scene2.css('visibility', 'visible'); // ensure visibility through animation
                $stage.removeClass('scene2'); // remove class - transition to scene 1
                window.setTimeout(function() {
                    $scene2.css('visibility', ''); // revert to default (hidden)
                    $thankYou.blur();
                }, 500);
            }
        }
    }

    // Bind events on domReady.
    $(function() {
        if (can_hashchange) {
            window.addEventListener('hashchange', function(e) {
                if (window.location.hash === '#download') {
                    show_scene(2);
                } else {
                    show_scene(1);
                }
            });
        }

        // Pull Firefox download link from the download button and add to the
        // 'click here' link.
        // TODO: Remove and generate link in bedrock.
        var $li = $('.download-list li:visible').filter(':first');
        var ff_dl_url = $li.find('a:first').attr('href');
        $('#direct-download-link').attr('href', ff_dl_url).on('click', function(e) {
            e.preventDefault();
            ga_track();
            dl_redirect($(this).attr('href'));
        });

        // Trigger animation after download.
        $('.download-firefox').on('click', function(e) {
            e.preventDefault();

            var $link = $(this);
            ga_track();

            if (can_hashchange) {
                window.location.href += '#download';
            } else {
                show_scene(2);
            }

            dl_redirect($link.attr('href'));
        });
    });
})(window, window.jQuery, window.Modernizr, window._gaq, window.site);
{'fraction_non_alphanumeric': 0.14761684405367886, 'fraction_numerical': 0.011260219034397655, 'mean_word_length': 1.5517512790240062, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2937195', 'n_tokens_mistral': 1829, 'n_tokens_neox': 1683, 'n_words': 404}