<commit_before><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<script>
(function(window, document, detector, mobifyjsUrl, mainUrl) {

// If Mobify has been defined already, or if the detector fails,
// or capturing is off, exit
var optOut = /mobify-enabled=false/.test(location.hash + '; ' + document.cookie)
if (this.Mobify || !detector() || optOut) {
    return;
}

// Start Mobify object with initial timestamp when loaded.
// Uncomment when needed for performance testing.
window.Mobify = {points: [+new Date]};

function attachScriptBeforeMobifyTag(script, src, id, classNames) {
    var mobifyTagScript = document.getElementsByTagName('script')[0];

    script.src = src;
    script.id = id;
    script.setAttribute("class", classNames);
    mobifyTagScript.parentNode.insertBefore(script, mobifyTagScript);
}

document.write('<plaintext style="display:none">');

// On next tick, load library and main executable
setTimeout(function() {
    var Mobify = window.Mobify = window.Mobify || {};
    Mobify.capturing = true;
    var mobifyjsScript = document.createElement('script');
    var errorHandler = function() {
        var now = new Date();
        // 30 minutes
        var time = now.getTime() + 1800000;
        now.setTime(time);
        document.cookie = 'mobify-enabled=false' +
                '; expires=' + now.toGMTString() +
                '; path=/';
        // Reload the page (location.reload fails in certain cases)
        window.location = window.location.href;
    };
    mobifyjsScript.onload = function(){
        if (mainUrl) {
            var mainScript = document.createElement('script');
            mainScript.onerror = errorHandler;
            attachScriptBeforeMobifyTag(mainScript, mainUrl, "mobify-js-main", "mobify");
        }
    };
    mobifyjsScript.onerror = errorHandler;
    attachScriptBeforeMobifyTag(mobifyjsScript, mobifyjsUrl, "mobify-js", "mobify");

});

})( window, document,
    // detector function
    function (){
        // We're enabled for:
        // - WebKit based browsers
        // - IE 10
        // - FireFox 4+
        // - Opera 11+
        // - 3DS
        match = /webkit|msie\s10|(firefox)[\/\s](\d+)|(opera)[\s\S]*version[\/\s](\d+)|3ds/i.exec(navigator.userAgent);
     
        if (!match) {
            return false;
        }
     
        // match[1] == Firefox
        if (match[1] && +match[2] < 4) {
            return false;
        }
        // match[3] == Opera
        if (match[3] && +match[4] < 11) {
            return false;
        }

        return true;
    },
    // path to mobify.js
    '/mobifyjs/build/mobify.min.js',

    // path to main executable 
    '/mobifyjs/examples/capturing-grumpycat/main.js'
);
</script>
<!-- END MOBIFY TAG -->
<link rel="stylesheet" href="/mobifyjs/examples/assets/css/stylesheet.css" type="text/css">
<title>Mobify.js image gallary example</title>
</head>
<body class="foo">
<div class="header"></div>
<div class="example">
    <p>The original img srcs were swapped out for a couple of grumpy cats.
    Open your web inspector and note the original imgs did not load.
    Also note, they were plain old img elements (no data&ndash;src tricks).
    <a href="#" id="swap">Click here to download and view the original images from the source html.</a></p>
    <div class="img">
        <img src="/mobifyjs/examples/assets/images/leaves-big.jpg" width="100%">
    </div>
    <div class="img">
        <img src="/mobifyjs/examples/assets/images/office-big.jpg" width="100%">
    </div>

</div>
<script>
// Grab the total time since starting capturing and send it
// to the parent for testing in performance.html
var end = +new Date;
var begin;
if (window.Mobify && window.Mobify.points) {
    begin = window.Mobify.points[0];
} else {
    var pointEl = document.getElementById("mobify-point");
    if (pointEl) {
        begin = pointEl.innerText || pointEl.textContent;
    }
}
var diff = end - begin;
parent.postMessage(diff, "*");
</script>
<script>
var swapEl = document.getElementById("swap");
var images = document.getElementsByTagName("img");
swapEl.onclick = function(event) {
    for (var i=0; i<images.length; i++) {
        images[i].setAttribute("src", images[i].getAttribute("old-src"));
    }
    event.preventDefault();
}
</script>
</body>
</html>
<commit_msg>Change mobify-enabled to mobify, which can either force mobify on or off.<commit_after><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<script>
(function(window, document, detector, mobifyjsUrl, mainUrl) {

// if mobify=(1|0) is set in hash or cookie, force mobify on/off.
var match = /mobify=(\d)/.exec(location.hash + '; ' + document.cookie);
if (match) {
    if (!parseInt(match[1])) return;
}
// else do not run mobify if Mobify object exists, or detector fails.
else if (this.Mobify || !detector()) {
    return;
}

// Start Mobify object with initial timestamp when loaded.
// Uncomment when needed for performance testing.
window.Mobify = {points: [+new Date]};

function attachScriptBeforeMobifyTag(script, src, id, classNames) {
    var mobifyTagScript = document.getElementsByTagName('script')[0];

    script.src = src;
    script.id = id;
    script.setAttribute("class", classNames);
    mobifyTagScript.parentNode.insertBefore(script, mobifyTagScript);
}

document.write('<plaintext style="display:none">');

// On next tick, load library and main executable
setTimeout(function() {
    var Mobify = window.Mobify = window.Mobify || {};
    Mobify.capturing = true;
    var mobifyjsScript = document.createElement('script');
    var errorHandler = function() {
        var now = new Date();
        // 30 minutes
        var time = now.getTime() + 1800000;
        now.setTime(time);
        document.cookie = 'mobify=0' +
                '; expires=' + now.toGMTString() +
                '; path=/';
        // Reload the page (location.reload has problems in FF)
        window.location = window.location.href;
    };
    mobifyjsScript.onload = function(){
        if (mainUrl) {
            var mainScript = document.createElement('script');
            mainScript.onerror = errorHandler;
            attachScriptBeforeMobifyTag(mainScript, mainUrl, "mobify-js-main", "mobify");
        }
    };
    mobifyjsScript.onerror = errorHandler;
    attachScriptBeforeMobifyTag(mobifyjsScript, mobifyjsUrl, "mobify-js", "mobify");

});

})( window, document,
    // detector function
    function (){
        // We're enabled for:
        // - WebKit based browsers
        // - IE 10
        // - FireFox 4+
        // - Opera 11+
        // - 3DS
        match = /webkit|msie\s10|(firefox)[\/\s](\d+)|(opera)[\s\S]*version[\/\s](\d+)|3ds/i.exec(navigator.userAgent);
     
        if (!match) {
            return false;
        }
     
        // match[1] == Firefox
        if (match[1] && +match[2] < 4) {
            return false;
        }
        // match[3] == Opera
        if (match[3] && +match[4] < 11) {
            return false;
        }

        return true;
    },

    // path to mobify.js
    '/mobifyjs/build/mobify.min.js',

    // path to main executable 
    '/mobifyjs/examples/capturing-grumpycat/main.js'
);
</script>
<!-- END MOBIFY TAG -->
<link rel="stylesheet" href="/mobifyjs/examples/assets/css/stylesheet.css" type="text/css">
<title>Mobify.js image gallary example</title>
</head>
<body class="foo">
<div class="header"></div>
<div class="example">
    <p>The original img srcs were swapped out for a couple of grumpy cats.
    Open your web inspector and note the original imgs did not load.
    Also note, they were plain old img elements (no data&ndash;src tricks).
    <a href="#" id="swap">Click here to download and view the original images from the source html.</a></p>
    <div class="img">
        <img src="/mobifyjs/examples/assets/images/leaves-big.jpg" width="100%">
    </div>
    <div class="img">
        <img src="/mobifyjs/examples/assets/images/office-big.jpg" width="100%">
    </div>

</div>
<script>
// Grab the total time since starting capturing and send it
// to the parent for testing in performance.html
var end = +new Date;
var begin;
if (window.Mobify && window.Mobify.points) {
    begin = window.Mobify.points[0];
} else {
    var pointEl = document.getElementById("mobify-point");
    if (pointEl) {
        begin = pointEl.innerText || pointEl.textContent;
    }
}
var diff = end - begin;
parent.postMessage(diff, "*");
</script>
<script>
var swapEl = document.getElementById("swap");
var images = document.getElementsByTagName("img");
swapEl.onclick = function(event) {
    for (var i=0; i<images.length; i++) {
        images[i].setAttribute("src", images[i].getAttribute("old-src"));
    }
    event.preventDefault();
}
</script>
</body>
</html>

{'fraction_non_alphanumeric': 0.15399134006883536, 'fraction_numerical': 0.010880426335072722, 'mean_word_length': 2.8299319727891157, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '917664', 'n_tokens_mistral': 2977, 'n_tokens_neox': 2843, 'n_words': 711}