<commit_before>{% extends "base.html" %}
{% load url from future %}
{% block title %}Urllists{% endblock %}
{% block pagetitle %}Urllists{% endblock %}
{% block content %}

<div id="urltabs">
    <div class="tabbable">
        <div class="tab-content">
            {% for device in devices %}
                {% include "snippets/device-tab.html" %}
            {% endfor %}
            {% include "snippets/tokens-tab.html" %}
        </div>
    </div>
</div>

<script>
    $("span.token").click(function(){
        $(this).text($(this).data("token"));
    });
    var currentUrlTab=0;
    var hashParameters = location.hash.substr(1).split("&");
    for(i=0;i<hashParameters.length;i++){
        var parts=hashParameters[i].split("_");
        if(parts.length==2 && parts[0] == "urltab"){
            currentUrlTab=parts[1];
            $("a[data-devicename="+currentUrlTab+"]").tab("show");
        }
    }
    $(".urltab").click(function(){window.location.hash = "urltab_" + $(this).attr("data-devicename")})
    $("form[action='{% url "sharedurllist.views.delete_url" %}'] input[type=submit]").each(function(i, e){
        $(e).hide();
        var button = $("<input type='button' class='btn' value='del'>").bind("click", function(){
            var form = $(e).parent();
            var action = form.attr("action");
            var data = {}
            form.find("input").each(function(idx, obj){
                form_field = $(obj);
                data[form_field.attr("name")] = form_field.val();
            })
            ajaxRequest = $.ajax(action, {
                "type": "post",
                "data": data,
                "success": function(){form.parent().hide()}
            });
        });
        $(e).after(button)
    });
</script>
{% endblock %}<commit_msg>hide element on click on delete, show it again if deleting fails<commit_after>{% extends "base.html" %}
{% load url from future %}
{% block title %}Urllists{% endblock %}
{% block pagetitle %}Urllists{% endblock %}
{% block content %}

<div id="urltabs">
    <div class="tabbable">
        <div class="tab-content">
            {% for device in devices %}
                {% include "snippets/device-tab.html" %}
            {% endfor %}
            {% include "snippets/tokens-tab.html" %}
        </div>
    </div>
</div>

<script>
    $("span.token").click(function(){
        $(this).text($(this).data("token"));
    });
    var currentUrlTab=0;
    var hashParameters = location.hash.substr(1).split("&");
    for(i=0;i<hashParameters.length;i++){
        var parts=hashParameters[i].split("_");
        if(parts.length==2 && parts[0] == "urltab"){
            currentUrlTab=parts[1];
            $("a[data-devicename="+currentUrlTab+"]").tab("show");
        }
    }
    $(".urltab").click(function(){window.location.hash = "urltab_" + $(this).attr("data-devicename")})
    $("form[action='{% url "sharedurllist.views.delete_url" %}'] input[type=submit]").each(function(i, e){
        $(e).hide();
        var button = $("<input type='button' class='btn' value='del'>").bind("click", function(){
            var form = $(e).parent();
            var action = form.attr("action");
            var data = {}
            form.find("input").each(function(idx, obj){
                form_field = $(obj);
                data[form_field.attr("name")] = form_field.val();
            })
            form.parent().hide()
            ajaxRequest = $.ajax(action, {
                "type": "post",
                "data": data,
                "error": function(){form.parent().show()}
            });
        });
        $(e).after(button)
    });
</script>
{% endblock %}
{'fraction_non_alphanumeric': 0.20650984682713347, 'fraction_numerical': 0.0032822757111597373, 'mean_word_length': 2.2857142857142856, 'pattern_counts': {'":': 6, '<': 23, '<?xml version=': 0, '>': 21, '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': '5916605', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1106, 'n_words': 196}