<commit_before><!doctype html>
<html lang="en">
    <head>
        <meta charset=utf-8 />
        <meta type="robots" content="noindex,nofollow" />
        <meta property="og:type" content="{{ mimetype }}" />
        <meta property="og:image" content="https://mediacru.sh/{{ original }}" />
        <meta property="og:site_name" content="MediaCrush" />
        <title>MediaCrush</title>
        <link href='//fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
        <link rel="icon" type="image/vnd.microsoft.icon" href="/static/favicon.ico" />
        <style type="text/css">input[type="text"]{width:95%;margin:0 auto;}body{margin:0;font-family:'Open Sans',sans-serif;padding:0;}.small{font-size:8pt;}a{color:#08c;text-decoration:none;}a:hover{color:#005580;text-decoration:underline;}.row{text-align:center;}.zout{cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in;}.zin{cursor:-webkit-zoom-out;cursor:-moz-zoom-out;cursor:zoom-out;}.red{color:red;}a.red:hover{color:red;}.hidden{display:none;}</style>
    </head>
    <body>
        <div style="display: inline-block">
            {% if mimetype == "image/gif" and mobile %}
                <img src="/{{ original }}">
            {% elif mimetype.startswith("video") or (mimetype == "image/gif" and not mobile) %}
                {% if controls %}
                <video controls>
                {% else %}
                    {% if not mobile %}
                        <video autoplay loop>
                    {% else %}
                        <video controls loop>
                    {% endif %}
                {% endif %}
                    <source src="/{{ filename }}.mp4" type='video/mp4;'>
                    <source src="/{{ filename }}.ogv" type='video/ogg; codecs="theora, vorbis"'>
                </video>
            {% elif mimetype.startswith("image") %}
            <img src="/{{ original }}" alt="MediaQuick" id="image" />
            {% elif mimetype.startswith("audio") %}
            <audio controls>
                <source src="/{{ filename }}.mp3" type='audio/mpeg'>
                <source src="/{{ filename }}.oga" type='audio/ogg'>
            </audio>
            {% endif %}
            <div class="row">
                <div>
                    <a href="/download/{{ original }}" style="text-align: center; display: block;">Download original file</a>
                </div>
                <div>
                    <span class="small"><a href="#" id="embed">Embed</a> &mdash;</span>
                    <span class="small"><a href="#" id="report">Report</a></span>
                    <span class="small"> &mdash; <a href="/">Upload</a></span>
                    <span class="small{% if can_delete == 'check' or can_delete == False %} hidden{% endif %}" id="deleteContainer"> &mdash; <a class="red" id="deleteLink" href="/api/{{ filename }}/delete">Delete</a></span>
                </div>
                <input type="text" id="embed-script" class="hidden" readonly value='&lt;script type="text/javascript" src="https://mediacru.sh/{{ filename }}/embed"&gt;&lt;/script&gt;' />
                {% if compression %}
                <div>
                    <span class="small">{{ compression }}% faster!</span>
                </div>
                {% endif %}
                <br />
            </div>
        </div>
        <script type="text/javascript">
            {% if can_delete == 'check' %}
            Array.prototype.remove = function(from, to) {
              var rest = this.slice((to || from) + 1 || this.length);
              this.length = from < 0 ? this.length + from : from;
              return this.push.apply(this, rest);
            };
            var history = window.localStorage.getItem('history');
            var hashIndex = null;
            history = JSON.parse(history);
            if (history) {
                var canDelete = false;
                for (var i = 0; i < history.length; i++) {
                    if (history[i] == '{{ filename }}') {
                        canDelete = true;
                        hashIndex = i;
                        break;
                    }
                }
                if (canDelete) {
                    document.getElementById('deleteContainer').classList.remove('hidden');
                }
            }
            {% endif %}
            document.getElementById('deleteLink').onclick = function(e) {
                e.preventDefault();
                var xhr = new XMLHttpRequest();
                xhr.open('GET', '/api/{{ filename }}/delete');
                xhr.send();
                document.getElementById('deleteContainer').innerHTML = ' &mdash; Deleted';
                if (history) {
                    history.remove(hashIndex);
                    window.localStorage.setItem('history', JSON.stringify(history));
                }
            };
            {% if mimetype.startswith("video") or mimetype.startswith("audio") %}
                window.addEventListener('load', function() {
                    var tagname = {% if mimetype.startswith("video") %}"video"{% else %}"audio"{%endif %};
                    var player = document.getElementsByTagName(tagname)[0];
                    if (window.localStorage && localStorage.volume) 
                        player.volume = parseFloat(localStorage.volume);

                    if (window.localStorage) {
                        player.addEventListener('volumechange', function() {
                            localStorage.volume = player.volume;
                        });
                    }
                });
            {% endif %}
            {% if mimetype.startswith('image') and mimetype != 'image/gif' %}
            var zoomedOut = true, titleSet = false;
            {% endif %}
            window.addEventListener('load', function() {
                var report = document.getElementById('report');
                report.addEventListener('click', function(e) {
                    e.preventDefault();
                    var report = document.getElementById('report');
                    var xhr = new XMLHttpRequest();
                    xhr.open('GET', '/report/' + location.href.split('/')[3]);
                    xhr.send();
                    report.parentNode.innerHTML = "Reported";
                }, false);
                var embed = document.getElementById('embed');
                embed.addEventListener('click', function(e) {
                    e.preventDefault();
                    var embedScript = document.getElementById('embed-script');
                    if (embedScript.className == "hidden") {
                        embedScript.className = "";
                        embedScript.select();
                    } else {
                        embedScript.className = "hidden";
                    }
                }, false);
                {% if mimetype.startswith("image") and mimetype != 'image/gif' %}
                applyZoom();
                window.onresize = applyZoom;
                var image = document.getElementById('image');
                image.addEventListener('click', function(e) {
                    zoomedOut = !zoomedOut;
                    applyZoom();
                }, false);
                {% endif %}
            }, false);
            {% if mimetype.startswith('image') and mimetype != 'image/gif' %}<commit_msg>Set viewport properly on mobile view page<commit_after><!doctype html>
<html lang="en">
    <head>
        <meta charset=utf-8 />
        <meta type="robots" content="noindex,nofollow" />
        <meta property="og:type" content="{{ mimetype }}" />
        <meta property="og:image" content="https://mediacru.sh/{{ original }}" />
        <meta property="og:site_name" content="MediaCrush" />
        {% if mobile %}
        <meta name="viewport" content="width=device-width" />
        {% endif %}
        <title>MediaCrush</title>
        <link href='//fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
        <link rel="icon" type="image/vnd.microsoft.icon" href="/static/favicon.ico" />
        <style type="text/css">input[type="text"]{width:95%;margin:0 auto;}body{margin:0;font-family:'Open Sans',sans-serif;padding:0;}.small{font-size:8pt;}a{color:#08c;text-decoration:none;}a:hover{color:#005580;text-decoration:underline;}.row{text-align:center;}.zout{cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in;}.zin{cursor:-webkit-zoom-out;cursor:-moz-zoom-out;cursor:zoom-out;}.red{color:red;}a.red:hover{color:red;}.hidden{display:none;}</style>
    </head>
    <body>
        <div style="display: inline-block">
            {% if mimetype == "image/gif" and mobile %}
                <img src="/{{ original }}">
            {% elif mimetype.startswith("video") or (mimetype == "image/gif" and not mobile) %}
                {% if controls %}
                <video controls>
                {% else %}
                    {% if not mobile %}
                        <video autoplay loop>
                    {% else %}
                        <video controls loop>
                    {% endif %}
                {% endif %}
                    <source src="/{{ filename }}.mp4" type='video/mp4;'>
                    <source src="/{{ filename }}.ogv" type='video/ogg; codecs="theora, vorbis"'>
                </video>
            {% elif mimetype.startswith("image") %}
            <img src="/{{ original }}" alt="MediaQuick" id="image" />
            {% elif mimetype.startswith("audio") %}
            <audio controls>
                <source src="/{{ filename }}.mp3" type='audio/mpeg'>
                <source src="/{{ filename }}.oga" type='audio/ogg'>
            </audio>
            {% endif %}
            <div class="row">
                <div>
                    <a href="/download/{{ original }}" style="text-align: center; display: block;">Download original file</a>
                </div>
                <div>
                    <span class="small"><a href="#" id="embed">Embed</a> &mdash;</span>
                    <span class="small"><a href="#" id="report">Report</a></span>
                    <span class="small"> &mdash; <a href="/">Upload</a></span>
                    <span class="small{% if can_delete == 'check' or can_delete == False %} hidden{% endif %}" id="deleteContainer"> &mdash; <a class="red" id="deleteLink" href="/api/{{ filename }}/delete">Delete</a></span>
                </div>
                <input type="text" id="embed-script" class="hidden" readonly value='&lt;script type="text/javascript" src="https://mediacru.sh/{{ filename }}/embed"&gt;&lt;/script&gt;' />
                {% if compression %}
                <div>
                    <span class="small">{{ compression }}% faster!</span>
                </div>
                {% endif %}
                <br />
            </div>
        </div>
        <script type="text/javascript">
            {% if can_delete == 'check' %}
            Array.prototype.remove = function(from, to) {
              var rest = this.slice((to || from) + 1 || this.length);
              this.length = from < 0 ? this.length + from : from;
              return this.push.apply(this, rest);
            };
            var history = window.localStorage.getItem('history');
            var hashIndex = null;
            history = JSON.parse(history);
            if (history) {
                var canDelete = false;
                for (var i = 0; i < history.length; i++) {
                    if (history[i] == '{{ filename }}') {
                        canDelete = true;
                        hashIndex = i;
                        break;
                    }
                }
                if (canDelete) {
                    document.getElementById('deleteContainer').classList.remove('hidden');
                }
            }
            {% endif %}
            document.getElementById('deleteLink').onclick = function(e) {
                e.preventDefault();
                var xhr = new XMLHttpRequest();
                xhr.open('GET', '/api/{{ filename }}/delete');
                xhr.send();
                document.getElementById('deleteContainer').innerHTML = ' &mdash; Deleted';
                if (history) {
                    history.remove(hashIndex);
                    window.localStorage.setItem('history', JSON.stringify(history));
                }
            };
            {% if mimetype.startswith("video") or mimetype.startswith("audio") %}
                window.addEventListener('load', function() {
                    var tagname = {% if mimetype.startswith("video") %}"video"{% else %}"audio"{%endif %};
                    var player = document.getElementsByTagName(tagname)[0];
                    if (window.localStorage && localStorage.volume) 
                        player.volume = parseFloat(localStorage.volume);

                    if (window.localStorage) {
                        player.addEventListener('volumechange', function() {
                            localStorage.volume = player.volume;
                        });
                    }
                });
            {% endif %}
            {% if mimetype.startswith('image') and mimetype != 'image/gif' %}
            var zoomedOut = true, titleSet = false;
            {% endif %}
            window.addEventListener('load', function() {
                var report = document.getElementById('report');
                report.addEventListener('click', function(e) {
                    e.preventDefault();
                    var report = document.getElementById('report');
                    var xhr = new XMLHttpRequest();
                    xhr.open('GET', '/report/' + location.href.split('/')[3]);
                    xhr.send();
                    report.parentNode.innerHTML = "Reported";
                }, false);
                var embed = document.getElementById('embed');
                embed.addEventListener('click', function(e) {
                    e.preventDefault();
                    var embedScript = document.getElementById('embed-script');
                    if (embedScript.className == "hidden") {
                        embedScript.className = "";
                        embedScript.select();
                    } else {
                        embedScript.className = "hidden";
                    }
                }, false);
                {% if mimetype.startswith("image") and mimetype != 'image/gif' %}
                applyZoom();
                window.onresize = applyZoom;
                var image = document.getElementById('image');
                image.addEventListener('click', function(e) {
                    zoomedOut = !zoomedOut;
                    applyZoom();
                }, false);
                {% endif %}
            }, false);
            {% if mimetype.startswith('image') and mimetype != 'image/gif' and not mobile %}
{'fraction_non_alphanumeric': 0.15387189612475738, 'fraction_numerical': 0.0030787765209825315, 'mean_word_length': 1.573987941429802, 'pattern_counts': {'":': 0, '<': 130, '<?xml version=': 0, '>': 126, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4077720', 'n_tokens_mistral': 4069, 'n_tokens_neox': 3699, 'n_words': 725}