<commit_before>function __modal__(header, htmlBody) {
    var html = `
        <div class="modal-content">
        <div class="modal-header">
            <span class="close">Χ</span>
            <h2>` + header + `</h2>
        </div>
        <div class="modal-body">
            ` + htmlBody + `
        </div>
        <div class="modal-footer">
            <button type="button" class="services" onclick="">
                Add Task
            </button>
        </div>
        </div>
    `;
    var modal = document.getElementById('taskModal');
    modal.innerHTML = html;
    modal.style.display = "block";

    var span = document.getElementsByClassName("close")[0];
    span.onclick = function() {
        modal.style.display = "none";
    }
    window.onclick = function(event) {
        if (event.target == modal) {
            modal.style.display = "none";
        }
    }
}

function nxt_motor() {
    motorHTML = `
    <p> Motor HTML </p>
    `;
    __modal__("Motor", motorHTML);
}

function nxt_sound() {
    
}

function nxt_display() {

}

function nxt_send_msg() {

}

function nxt_lamp() {

}

function nxt_touch() {

}

function nxt_sound_sensor() {

}
<commit_msg>Added add_task function and task variables and changed code style<commit_after>/*******************************************************************************
* Main Functions
*
*******************************************************************************/

var tasks_history = ["test1", "test2"];
var current_task = {};

function __modal__(header, htmlBody) {
    var html = `
        <div class="modal-content">
        <div class="modal-header">
            <span class="close">Χ</span>
            <h2>` + header + `</h2>
        </div>
        <div class="modal-body">
            ` + htmlBody + `
        </div>
        <div class="modal-footer">
            <button type="button" onclick="add_task()" style="width:50%; margin-top:20px; margin-left: 25%;">
                Add Task
            </button>
        </div>
        </div>
    `;
    var modal = document.getElementById('taskModal');
    modal.innerHTML = html;
    modal.style.display = "block";

    var span = document.getElementsByClassName("close")[0];
    span.onclick = function() {
        modal.style.display = "none";
    }
    window.onclick = function(event) {
        if (event.target == modal) {
            modal.style.display = "none";
        }
    }
}

function add_task() {
    var all_tasks = document.getElementById("tasks-list");
    all_tasks.innerHTML += "<li>test</li>";
    document.getElementById('taskModal').style.display = "none";
    tasks_history.push(current_task);
}




/*******************************************************************************
* Task Functions
*
*******************************************************************************/

function nxt_motor() {
    motorHTML = `
    <p> Motor HTML </p>
    `;
    __modal__("Motor", motorHTML);
}

function nxt_sound() {

}

function nxt_display() {

}

function nxt_send_msg() {

}

function nxt_lamp() {

}

function nxt_touch() {

}

function nxt_sound_sensor() {

}

{'fraction_non_alphanumeric': 0.2406280038449215, 'fraction_numerical': 0.004485741749439282, 'mean_word_length': 2.630232558139535, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, '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': '3661202', 'n_tokens_mistral': 947, 'n_tokens_neox': 913, 'n_words': 177}