<commit_before>(function(window, document, $) {
    "use strict";
    var site = window.SITE,
        viewName = "index.photography",
        ui = {
            el: "#photography",
            backstretchEl: ".backstretch-wrap",
        },
        $backstretchEl = $(ui.el).find(ui.backstretchEl),
        partialImagesPath = "images/photos/",
        initBackstretch = function(){
            if ($.fn.backstretch){
                var imagesArr = [
                        {
                            url: "stuck-in-traffic.jpg",
                        },
                        {
                            url: "hana.jpg",
                        },
                        {
                            url: "big-ben.jpg",
                            alignY: 0.7,
                        },
                        {
                            url: "cat.jpg",
                            alignY: 0,
                        },
                        {
                            url: "double-rainbow-in-paris.jpg",
                        },
                        {
                            url: "autumn-in-zrinjevac.jpg",
                        },
                        {
                            url: "paris-sunset.jpg",
                        },
                        {
                            url: "flowers.jpg",
                        },
                        {
                            url: "tower-bridge.jpg",
                        },
                        {
                            url: "adriatic-sea.jpg",
                        },
                        {
                            url: "dijana.jpg",
                            alignY: 1,
                        },
                    ],
                    options = {
                        duration: 5000,
                        fade: 750,
                        preload: 1,
                    };

                // "http://farm8.staticflickr.com/7035/6464821765_36a618a812_o.jpg", /* Paris opera */

                $backstretchEl.backstretch(addImagePath(imagesArr), options);

                $(ui.el).on("click", function(){
                    var $el = $(this),
                        pausedClass = "paused",
                        playingClass = "playing",
                        isPaused = $el.is("."+pausedClass);

                    $el.toggleClass(pausedClass, !isPaused);
                    $el.toggleClass(playingClass, isPaused);

                    $backstretchEl.backstretch(isPaused ? "resume" : "pause");
                });
            }
            else {
                console.warn("Backstretch init failed");
            }
        },
        addImagePath = function(imagesArr){
            var fullImagesPath = site.settings.assetsUrl.local + partialImagesPath;

            imagesArr.forEach(function(el, i, arr){
                el.url = fullImagesPath + el.url;
            });

            return imagesArr;
        },
        exports = {
            init: function(){
                $(window).on("load."+viewName, function(){
                    initBackstretch();
                });
            },
        };

    site.views.register(viewName, exports);

})(this, this.document, jQuery);<commit_msg>Added photography webp support<commit_after>(function(window, document, $) {
    "use strict";
    var site = window.SITE,
        viewName = "index.photography",
        ui = {
            el: "#photography",
            backstretchEl: ".backstretch-wrap",
        },
        $backstretchEl = $(ui.el).find(ui.backstretchEl),
        partialImagesPath = "images/photos/",
        initBackstretch = function(){
            if ($.fn.backstretch){
                var imagesArr = [
                        {
                            url: "stuck-in-traffic",
                        },
                        {
                            url: "hana",
                        },
                        {
                            url: "big-ben",
                            alignY: 0.7,
                        },
                        {
                            url: "cat",
                            alignY: 0,
                        },
                        {
                            url: "double-rainbow-in-paris",
                        },
                        {
                            url: "autumn-in-zrinjevac",
                        },
                        {
                            url: "paris-sunset",
                        },
                        {
                            url: "flowers",
                        },
                        {
                            url: "tower-bridge",
                        },
                        {
                            url: "adriatic-sea",
                        },
                        {
                            url: "dijana",
                            alignY: 1,
                        },
                    ],
                    options = {
                        duration: 5000,
                        fade: 750,
                        preload: 1,
                    };

                // "http://farm8.staticflickr.com/7035/6464821765_36a618a812_o.jpg", /* Paris opera */

                $backstretchEl.backstretch(prepareImages(imagesArr), options);

                $(ui.el).on("click", function(){
                    var $el = $(this),
                        pausedClass = "paused",
                        playingClass = "playing",
                        isPaused = $el.is("."+pausedClass);

                    $el.toggleClass(pausedClass, !isPaused);
                    $el.toggleClass(playingClass, isPaused);

                    $backstretchEl.backstretch(isPaused ? "resume" : "pause");
                });
            }
            else {
                console.warn("Backstretch init failed");
            }
        },
        prepareImages = function(imagesArr){
            var fullImagesPath = site.settings.assetsUrl.local + partialImagesPath,
                isWebPSupported = $("html").hasClass("webp");

            imagesArr.forEach(function(el, i, arr){
                el.url = fullImagesPath + el.url + "." + (isWebPSupported ? "webp" : "jpg");
            });

            return imagesArr;
        },
        exports = {
            init: function(){
                $(window).on("load."+viewName, function(){
                    initBackstretch();
                });
            },
        };

    site.views.register(viewName, exports);

})(this, this.document, jQuery);
{'fraction_non_alphanumeric': 0.10925644916540213, 'fraction_numerical': 0.010622154779969651, 'mean_word_length': 0.7613575628006414, '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': '4734147', 'n_tokens_mistral': 1686, 'n_tokens_neox': 1507, 'n_words': 229}