<commit_before><script>

/*
 * Yeah, and shift.
 */
function openMessageToEventModal(object, object_id) {
    content = $("#eventmessage_modal").html();
    $( "#eventModalTitle" ).html('Send Message');
    $( "#eventModalBody" ).html(content);
    $( "#eventModal" ).modal();
    if (object == "event") {
        url = "{{ path('event_send_message', {'access': 'ajax', 'id': "XXX" }) }}".replace("XXX", object_id);
        fselect = $( "#function_select_" + object_id ).html();
        $( "#eventMessageFormSelect" ).append(fselect);
    }
    if (object == "shift") {
        url = "{{ path('shift_send_message', {'access': 'ajax', 'id': "XXX" }) }}".replace("XXX", object_id);
    }

    $("#eventMessageForm").submit(function( event ) {
        postdata = $("#eventMessageForm").serialize();
        $.ajax({
            type: "POST",
            data: postdata,
            url: url,
            success: function(data)
            {
                alert(data);
                $( "#eventModal" ).modal("hide");
                $( "#eventModalTitle" ).html("");
                $( "#eventModalBody" ).html("");
            }
        });
        event.preventDefault();
    });
    return false;
}

function openAddContactInfo(event_id) {

    /* Yet another way to do this. Gotta standardize some day. */
    $( "#addContactInfoForm" ).submit(function( event ) {
        event.preventDefault();
        parent.location.reload();
        url = "{{ path('event_add_contact', {'access': 'ajax', 'id': "XXX" }) }}".replace("XXX", event_id);
        addContactFormData = $( "#addContactForm" ).serialize();
        $.ajax({
            type: "POST",
            url: url,
            data: addContactFormData,
            dataType: "text",
            async: true,
          }).done( function( cont, textStatus, xhr ) {
                parent.location.reload();
          }).fail(function(xhr, status, error) {
                errmsg = "Adding contact failed\n";
                errmsg = errmsg + xhr.responseText + "\n";
                alert(errmsg);
        });
        return false;
    });
    return false;
}

function grabEvents(what) {
    url = "{{ path('event_index', {'access': 'ajax' }) }}" 
        + "?" + what +"=true";
    if (what == "past") {
        search = true;
    } else {
        search = false;
    }
    $.get(url, function( data ) {
        $( "#" + what + "content" ).html(data);
    }).done(function() {
        $( "#" + what + "table").dataTable({
            "paging": false,
            "searching": search
            });
    });
    return false;
}

function submitDeleteForm(event_id) {
    if (!confirm("Are you sure you want to delete")) {
        return false;
    }
    deleteEventFormData = $( "#deleteEventForm" ).serialize();
    url = "{{ path('event_delete', { 'access': 'ajax', 'id': 'XXX' }) }}";
    url = url.replace('XXX', event_id);
    $.ajax({
        type: "DELETE",
        url: url,
        data: deleteEventFormData,
        dataType: "text",
        async: true,
      }).done( function( cont, textStatus, xhr ) {
            parent.location.reload();
      }).fail(function(xhr, status, error) {
            errmsg = "Delete failed\n";
            errmsg = errmsg + xhr.responseText + "\n";
            alert(errmsg);
    });
    return false;
}

function submitStateForm(event_id, state) {
    stateEventFormData = $( "#stateEventForm" ).serialize();
    url = "{{ path('event_state', { 'access': 'ajax', 'state': 'STATE', 'id': 'XXX' }) }}";
    url = url.replace('XXX', event_id);
    url = url.replace('STATE', state);
    $.ajax({
        type: "POST",
        url: url,
        data: stateEventFormData,
        dataType: "text",
        async: true,
      }).done( function( cont, textStatus, xhr ) {
            parent.location.reload();
      }).fail(function(xhr, status, error) {
            errmsg = "It failed\n";
            errmsg = errmsg + xhr.responseText + "\n";
            alert(errmsg);
    });
    return false;
}

function openPrintEventWindow(event_id, state = null)
{
    url = "{{ path('event_show', { 'id': "XXX", 'printable': true }) }}";
    url = url.replace('XXX', event_id);
    
    if (state != null) {
        url = url + "&state=" + state;
    }
    w = popmeup(url);
    return false;
}

function checkChecked(classname)
{
    if ( $( "#epcheck_" + classname ).is(":checked") ) {
        $( ".ep" + classname ).show();
    } else {
        $( ".ep" + classname ).hide();
    }
}

function printTableContent()
{
    // This may be a bit specific for my designs,
    document.body.style.paddingTop = "0px";
    $("#unprintableContent").hide();
    window.print();
    document.body.style.paddingTop = "";
    $("#unprintableContent").show();
}

function openAddContactInfo(event_id) {

    url = "{{ path('event_pick_contact_info', {'access': 'ajax', 'id': "XXX" }) }}".replace("XXX", event_id);

    $.get(url, function( content ) {
        $( "#eventModalTitle" ).html('Send Message');
        $( "#eventModalBody" ).html(content);
        $( "#eventModal" ).modal();
    });

    return false;
}
</script><commit_msg>Not Send message, new title<commit_after><script>

/*
 * Yeah, and shift.
 */
function openMessageToEventModal(object, object_id) {
    content = $("#eventmessage_modal").html();
    $( "#eventModalTitle" ).html('Send Message');
    $( "#eventModalBody" ).html(content);
    $( "#eventModal" ).modal();
    if (object == "event") {
        url = "{{ path('event_send_message', {'access': 'ajax', 'id': "XXX" }) }}".replace("XXX", object_id);
        fselect = $( "#function_select_" + object_id ).html();
        $( "#eventMessageFormSelect" ).append(fselect);
    }
    if (object == "shift") {
        url = "{{ path('shift_send_message', {'access': 'ajax', 'id': "XXX" }) }}".replace("XXX", object_id);
    }

    $("#eventMessageForm").submit(function( event ) {
        postdata = $("#eventMessageForm").serialize();
        $.ajax({
            type: "POST",
            data: postdata,
            url: url,
            success: function(data)
            {
                alert(data);
                $( "#eventModal" ).modal("hide");
                $( "#eventModalTitle" ).html("");
                $( "#eventModalBody" ).html("");
            }
        });
        event.preventDefault();
    });
    return false;
}

function openAddContactInfo(event_id) {

    /* Yet another way to do this. Gotta standardize some day. */
    $( "#addContactInfoForm" ).submit(function( event ) {
        event.preventDefault();
        parent.location.reload();
        url = "{{ path('event_add_contact', {'access': 'ajax', 'id': "XXX" }) }}".replace("XXX", event_id);
        addContactFormData = $( "#addContactForm" ).serialize();
        $.ajax({
            type: "POST",
            url: url,
            data: addContactFormData,
            dataType: "text",
            async: true,
          }).done( function( cont, textStatus, xhr ) {
                parent.location.reload();
          }).fail(function(xhr, status, error) {
                errmsg = "Adding contact failed\n";
                errmsg = errmsg + xhr.responseText + "\n";
                alert(errmsg);
        });
        return false;
    });
    return false;
}

function grabEvents(what) {
    url = "{{ path('event_index', {'access': 'ajax' }) }}" 
        + "?" + what +"=true";
    if (what == "past") {
        search = true;
    } else {
        search = false;
    }
    $.get(url, function( data ) {
        $( "#" + what + "content" ).html(data);
    }).done(function() {
        $( "#" + what + "table").dataTable({
            "paging": false,
            "searching": search
            });
    });
    return false;
}

function submitDeleteForm(event_id) {
    if (!confirm("Are you sure you want to delete")) {
        return false;
    }
    deleteEventFormData = $( "#deleteEventForm" ).serialize();
    url = "{{ path('event_delete', { 'access': 'ajax', 'id': 'XXX' }) }}";
    url = url.replace('XXX', event_id);
    $.ajax({
        type: "DELETE",
        url: url,
        data: deleteEventFormData,
        dataType: "text",
        async: true,
      }).done( function( cont, textStatus, xhr ) {
            parent.location.reload();
      }).fail(function(xhr, status, error) {
            errmsg = "Delete failed\n";
            errmsg = errmsg + xhr.responseText + "\n";
            alert(errmsg);
    });
    return false;
}

function submitStateForm(event_id, state) {
    stateEventFormData = $( "#stateEventForm" ).serialize();
    url = "{{ path('event_state', { 'access': 'ajax', 'state': 'STATE', 'id': 'XXX' }) }}";
    url = url.replace('XXX', event_id);
    url = url.replace('STATE', state);
    $.ajax({
        type: "POST",
        url: url,
        data: stateEventFormData,
        dataType: "text",
        async: true,
      }).done( function( cont, textStatus, xhr ) {
            parent.location.reload();
      }).fail(function(xhr, status, error) {
            errmsg = "It failed\n";
            errmsg = errmsg + xhr.responseText + "\n";
            alert(errmsg);
    });
    return false;
}

function openPrintEventWindow(event_id, state = null)
{
    url = "{{ path('event_show', { 'id': "XXX", 'printable': true }) }}";
    url = url.replace('XXX', event_id);
    
    if (state != null) {
        url = url + "&state=" + state;
    }
    w = popmeup(url);
    return false;
}

function checkChecked(classname)
{
    if ( $( "#epcheck_" + classname ).is(":checked") ) {
        $( ".ep" + classname ).show();
    } else {
        $( ".ep" + classname ).hide();
    }
}

function printTableContent()
{
    // This may be a bit specific for my designs,
    document.body.style.paddingTop = "0px";
    $("#unprintableContent").hide();
    window.print();
    document.body.style.paddingTop = "";
    $("#unprintableContent").show();
}

function openAddContactInfo(event_id) {

    url = "{{ path('event_pick_contact_info', {'access': 'ajax', 'id': "XXX" }) }}".replace("XXX", event_id);

    $.get(url, function( content ) {
        $( "#eventModalTitle" ).html('Add Contact Info');
        $( "#eventModalBody" ).html(content);
        $( "#eventModal" ).modal();
    });

    return false;
}
</script>
{'fraction_non_alphanumeric': 0.18839024390243903, 'fraction_numerical': 0.0001951219512195122, 'mean_word_length': 2.246041798606713, 'pattern_counts': {'":': 6, '<': 7, '<?xml version=': 0, '>': 7, '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': '2875605', 'n_tokens_mistral': 3140, 'n_tokens_neox': 3089, 'n_words': 686}