<commit_before>{% include "header.html" %}

<script type="text/javascript" src="/static/js/csrf_token_ajax.js"></script>
<script>
function deleteAgenda() {
    //use original 'this'
    $.ajax({
        type: 'DELETE',
        url: '/agenda/',
        dataType:'json',
        data: { id: $(this).attr('id') },
        success: function(res) {
            console.log(res);
        }
    });
    $(this).parent().remove();
}

$(document).ready(function() {
    $('#id_url').focus();
    $('#agenda').submit(function() {  // AJAX by submit
        if ($('#id_url').val() === '') {
            return false;
        }

        var url = $('form#agenda').attr('action');
        var data = {url: $('#id_url').val()}
        $.post(url, data, 'json')
         .done(function(response) {
             $('#agenda_list').prepend('<li><a href="' + response.url + '" target="_blank" class="livepreview"> ' + response.title + '</a><i class="delete-agenda icon-trash-empty" id="' + response.id + '"><span>delete</span></i></li>');
             $('.delete-agenda').click(deleteAgenda);
             $('#id_url').val('');
         })
         .fail(function(response) {
             console.warn(response);
         });
        return false;
    });
    $('.delete-agenda').click(deleteAgenda);
});

</script>

<!--script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<script type="text/javascript" src="/static/js/postagenda.js"></script-->

<div id="contents">
<div class="episode">

  <h3>Input suggested agenda.</h3><commit_msg>display confirm dialog before delete agenda.<commit_after>{% include "header.html" %}

<script type="text/javascript" src="/static/js/csrf_token_ajax.js"></script>
<script>
function deleteAgenda() {
    if (!window.confirm("Agendaを削除しますか？")) {
        return;
    }
    //use original 'this'
    $.ajax({
        type: 'DELETE',
        url: '/agenda/',
        dataType:'json',
        data: { id: $(this).attr('id') },
        success: function(res) {
            console.log(res);
        }
    });
    $(this).parent().remove();
}

$(document).ready(function() {
    $('#id_url').focus();
    $('#agenda').submit(function() {  // AJAX by submit
        if ($('#id_url').val() === '') {
            return false;
        }

        var url = $('form#agenda').attr('action');
        var data = {url: $('#id_url').val()}
        $.post(url, data, 'json')
         .done(function(response) {
             $('#agenda_list').prepend('<li><a href="' + response.url + '" target="_blank" class="livepreview"> ' + response.title + '</a><i class="delete-agenda icon-trash-empty" id="' + response.id + '"><span>delete</span></i></li>');
             $('#' + response.id).click(deleteAgenda);
             $('#id_url').val('');
         })
         .fail(function(response) {
             console.warn(response);
         });
        return false;
    });
    $('.delete-agenda').click(deleteAgenda);
});

</script>

<!--script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<script type="text/javascript" src="/static/js/postagenda.js"></script-->

<div id="contents">
<div class="episode">

  <h3>Input suggested agenda.</h3>
{'fraction_non_alphanumeric': 0.2275375651640601, 'fraction_numerical': 0.0030665440049064702, 'mean_word_length': 2.640625, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 2, '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': '6506718', 'n_tokens_mistral': 1042, 'n_tokens_neox': 1031, 'n_words': 165}