<commit_before>function pageViewModel(gvm) {
    // Page specific i18n bindings
    gvm.title = ko.computed(function(){i18n.setLocale(gvm.lang()); return gvm.app() + ' - ' + i18n.__("adminAddUser");}, gvm);
    gvm.pageHeaderAddUser = ko.computed(function(){i18n.setLocale(gvm.lang()); return gvm.app() + ' - ' + i18n.__("UserAddTitle");}, gvm);

    gvm.savePage = ko.computed(function(){i18n.setLocale(gvm.lang()); return gvm.app() + ' - ' + i18n.__("SaveBtn");}, gvm);
}

function createNewUser()
{
    console.log("Fired");

    $.ajax({
     type: "POST",
     url: "/register",
     data: $('#userForm').serialize(),
     success: function() {
        console.log('Success');
     },
     error: function() {
         console.log('error');
     }
     });
}

function initPage() {
    // Form submit
    $('#userForm').on('submit', function(e)
    {
        e.preventDefault();

        createNewUser();

        //window.location.href = "http://dptknokke.ns01.info:9000/templates/admin/users.php";
    });
}

<commit_msg>edit user panel: Save changes<commit_after>function pageViewModel(gvm) {
    // Page specific i18n bindings
    gvm.title = ko.computed(function(){i18n.setLocale(gvm.lang()); return gvm.app() + ' - ' + i18n.__("adminAddUser");}, gvm);
    gvm.pageHeaderAddUser = ko.computed(function(){i18n.setLocale(gvm.lang()); return gvm.app() + ' - ' + i18n.__("UserAddTitle");}, gvm);

    gvm.savePage = ko.computed(function(){i18n.setLocale(gvm.lang()); return gvm.app() + ' - ' + i18n.__("SaveBtn");}, gvm);
}

function createNewUser()
{
    console.log("Fired");

    $.ajax({
     type: "POST",
     url: "/register",
     data: $('#userForm').serialize(),
     success: function() {
        console.log('Success');
     },
     error: function() {
         console.log('error');
     }
     });
}

function initPage() {
    // Form submit
    $('#userForm').on('submit', function(e)
    {
        e.preventDefault();

        createNewUser();

        window.location.href = "/admin/users";
    });
}


{'fraction_non_alphanumeric': 0.20592592592592593, 'fraction_numerical': 0.016790123456790124, 'mean_word_length': 2.964774951076321, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3799870', 'n_tokens_mistral': 714, 'n_tokens_neox': 687, 'n_words': 104}