<commit_before>{% extends "layout.html" %}
{% block scripts %}
{% endblock %}
{% block content %}

<style>
    .header div {
        display: block;
    }

    .item-view {
       display: block;
       padding: 5px 0px;
    }

    #ul-hist li{
        padding: 12px 0px;
    }

    .hist-url {
        padding-bottom: 5px;
    }

    .hist-del {
        display: inline;
        padding-left: 20px;
        color: #dd1111;
    }

</style>

<div class="wrapper">
    <div class="content">
        <div class="header">
            <h2>Your Content</h2>
            <p>
            Note: List of content is stored on your browser using LocalStorage. It is <strong>not</strong> stored on our
            servers.
            <div>
            <a href="javascript:optOutHistToggle();" id="hist-opt-toggle">Opt-out of storage feature</a>
            <a href="javascript:clearHist();">[ Clear All ]</a>
            </div>
        </div>
        <ul id="ul-hist">
        </ul>
    </div>

    <script type="text/javascript">
        function deleteItem(id) {
            if (!window.localStorage)
                return;

            window.localStorage.removeItem('hist:'+id);
            var elem = document.getElementById('hist'+id);
            elem.parentElement.remove(elem);
        }

        function clearHist() {
            if (window.localStorage) {
                var index = window.localStorage.getItem('hist:index');
                if (index === null)
                    return;
                else
                    index = parseInt(index);

                for (var i = 0; i < index; i++) {
                    window.localStorage.removeItem('hist:'+i);
                }
                window.localStorage.removeItem('hist:index');
            }
        }

        function readCookie(name) {
            var nameEQ = name + "=";
            var ca = document.cookie.split(';');
            for(var i=0;i < ca.length;i++) {
                var c = ca[i];
                while (c.charAt(0)==' ') c = c.substring(1,c.length);
                if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
            }
            return null;
        }

        function createCookie(name,value,days) {
            if (days) {
                var date = new Date();
                date.setTime(date.getTime()+(days*24*60*60*1000));
                var expires = "; expires="+date.toGMTString();
            }
            else var expires = "; expires=Thu, 01-Jan-1970 00:00:01 GMT";
            document.cookie = name+"="+value+expires+"; path=/";
        }

        var histOptEnabled = (readCookie('hist-opt-out') === null);
        var histOptToggleElem = document.getElementById('hist-opt-toggle');<commit_msg>clear shown items, on clearAll<commit_after>{% extends "layout.html" %}
{% block scripts %}
{% endblock %}
{% block content %}

<style>
    .header div {
        display: block;
    }

    .item-view {
       display: block;
       padding: 5px 0px;
    }

    #ul-hist li{
        padding: 12px 0px;
    }

    .hist-url {
        padding-bottom: 5px;
    }

    .hist-del {
        display: inline;
        padding-left: 20px;
        color: #dd1111;
    }

</style>

<div class="wrapper">
    <div class="content">
        <div class="header">
            <h2>Your Content</h2>
            <p>
            Note: List of content is stored on your browser using LocalStorage. It is <strong>not</strong> stored on our
            servers.
            <div>
            <a href="javascript:optOutHistToggle();" id="hist-opt-toggle">Opt-out of storage feature</a>
            <a href="javascript:clearHist();">[ Clear All ]</a>
            </div>
        </div>
        <ul id="ul-hist">
        </ul>
    </div>

    <script type="text/javascript">
        function deleteItem(id) {
            if (!window.localStorage)
                return;

            window.localStorage.removeItem('hist:'+id);
            var elem = document.getElementById('hist'+id);
            elem.parentElement.remove(elem);
        }

        function clearHist() {
            if (window.localStorage) {
                var index = window.localStorage.getItem('hist:index');
                if (index === null)
                    return;
                else
                    index = parseInt(index);

                for (var i = 0; i < index; i++) {
                    window.localStorage.removeItem('hist:'+i);
                }
                window.localStorage.removeItem('hist:index');

                var histList = document.getElementById('ul-hist');
                histList.parentElement.removeChild(histList);
            }
        }

        function readCookie(name) {
            var nameEQ = name + "=";
            var ca = document.cookie.split(';');
            for(var i=0;i < ca.length;i++) {
                var c = ca[i];
                while (c.charAt(0)==' ') c = c.substring(1,c.length);
                if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
            }
            return null;
        }

        function createCookie(name,value,days) {
            if (days) {
                var date = new Date();
                date.setTime(date.getTime()+(days*24*60*60*1000));
                var expires = "; expires="+date.toGMTString();
            }
            else var expires = "; expires=Thu, 01-Jan-1970 00:00:01 GMT";
            document.cookie = name+"="+value+expires+"; path=/";
        }

        var histOptEnabled = (readCookie('hist-opt-out') === null);
        var histOptToggleElem = document.getElementById('hist-opt-toggle');
{'fraction_non_alphanumeric': 0.140905057675244, 'fraction_numerical': 0.014551907719609583, 'mean_word_length': 1.5770461819844537, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 45, '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': '4291160', 'n_tokens_mistral': 1718, 'n_tokens_neox': 1584, 'n_words': 345}