<commit_before><!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>Tureberg FK - funktionärer</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://idrott.bevemyr.com/www/jquery/jquery.mobile-1.4.3/jquery.mobile-1.4.3.min.css"/>
    <link rel="stylesheet" href="http://idrott.bevemyr.com/www/jquery/jquery-mobile-theme-053329-0/themes/BevemyrMobileV1.min.css" />
    <script src="http://idrott.bevemyr.com/www/jquery/jquery-2.1.1.js"></script>
    <script src="http://idrott.bevemyr.com/www/jquery/jquery.mobile-1.4.3/jquery.mobile-1.4.3.min.js"></script>
    <script src="http://idrott.bevemyr.com/www/js/db.js"></script>

    <script>
        // Här behöver man lägga till en hantering av användare som inte loggat in och försöker nå en specifik sida.
        sessionid = "1234567890";
        eventid = 0;
        userid = 0;

        function set_current_event(eid) {
            eventid = eid;
            return true;
        }

        function set_selected_user(uid) {
            userid = uid;
            return true;
        }

        $(document).on("pagecreate", "#login", function() {
            $("#login_submit").on('click', function(e) {
                $.ajax({
                    url: "http://idrott.bevemyr.com/idrott/login?user="+$("#login_name").val()+"&password="
                            +$("#login_passwd").val(),
                    dataType: "json",
                    success: function(status) {
                        if(status.status == "ok") { // string otherwise an object session/group
                            sessionid = status.sid;
                            aaagroup = status.group;
                            $.mobile.changePage($("#admin-startpage"));
                        } else {
                            sessionid = status.session;
                            aaagroup = status.group;
                            $.mobile.changePage($("#func-eventlist"));
                        }
                    },
                    error: function(status) {
                        alert(status.status);
                        $.mobile.changePage($("#login"));  // should be errorpage
                    }
                });
            });
        });

        $( document ).on("pagecontainerbeforeshow", function(e, ui) {
            var toPage = $.mobile.pageContainer.pagecontainer("getActivePage")[0].id;
            if(toPage == "admin-funclist") {
                get_all_users(sessionid, layout_all_users, "#admin-funclist-table" );
                $("#admin-funclist-table").table("rebuild");
            };
            if(toPage == "admin-adminlist") {
                get_admin_users(sessionid, "#admin-adminlist-table");
                $("#admin-adminlist-table").table("rebuild");
            };
            if(toPage == "admin-event-funclist") {
                get_all_func_for_event(sessionid, eventid, '#admin-event-funclist-table');
                $("#admin-event-funclist-table").table("rebuild");
            };
            if(toPage == "admin-eventlist") {
                get_all_events(sessionid, layout_all_events);
                $("#admin-eventlist-table").collapsibleset( "refresh" );
            };
        });

    </script>

    <script>
        $( document ).on( "pagecreate", function() {
            $("#es-add").click(function() {<commit_msg>on mobileinit<commit_after><!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>Tureberg FK - funktionärer</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://idrott.bevemyr.com/www/jquery/jquery.mobile-1.4.3/jquery.mobile-1.4.3.min.css"/>
    <link rel="stylesheet" href="http://idrott.bevemyr.com/www/jquery/jquery-mobile-theme-053329-0/themes/BevemyrMobileV1.min.css" />
    <script src="http://idrott.bevemyr.com/www/jquery/jquery-2.1.1.js"></script>
    <script src="http://idrott.bevemyr.com/www/jquery/jquery.mobile-1.4.3/jquery.mobile-1.4.3.min.js"></script>
    <script src="http://idrott.bevemyr.com/www/js/db.js"></script>

    <script>
        // Här behöver man lägga till en hantering av användare som inte loggat in och försöker nå en specifik sida.
        sessionid = "1234567890";
        eventid = 0;
        userid = 0;

        function set_current_event(eid) {
            eventid = eid;
            return true;
        }

        function set_selected_user(uid) {
            userid = uid;
            return true;
        }

        $(document).on("pagecreate", "#login", function() {
            $("#login_submit").on('click', function(e) {
                $.ajax({
                    url: "http://idrott.bevemyr.com/idrott/login?user="+$("#login_name").val()+"&password="
                            +$("#login_passwd").val(),
                    dataType: "json",
                    success: function(status) {
                        if(status.status == "ok") { // string otherwise an object session/group
                            sessionid = status.sid;
                            aaagroup = status.group;
                            $.mobile.changePage($("#admin-startpage"));
                        } else {
                            sessionid = status.session;
                            aaagroup = status.group;
                            $.mobile.changePage($("#func-eventlist"));
                        }
                    },
                    error: function(status) {
                        alert(status.status);
                        $.mobile.changePage($("#login"));  // should be errorpage
                    }
                });
            });
        });

        $( document ).on("pagecontainerbeforeshow", function(e, ui) {
            var toPage = $.mobile.pageContainer.pagecontainer("getActivePage")[0].id;
            if(toPage == "admin-funclist") {
                get_all_users(sessionid, layout_all_users, "#admin-funclist-table" );
                $("#admin-funclist-table").table("rebuild");
            };
            if(toPage == "admin-adminlist") {
                get_admin_users(sessionid, "#admin-adminlist-table");
                $("#admin-adminlist-table").table("rebuild");
            };
            if(toPage == "admin-event-funclist") {
                get_all_func_for_event(sessionid, eventid, '#admin-event-funclist-table');
                $("#admin-event-funclist-table").table("rebuild");
            };
            if(toPage == "admin-eventlist") {
                get_all_events(sessionid, layout_all_events);
                $("#admin-eventlist-table").collapsibleset( "refresh" );
            };
        });

    </script>

    <script>
        $( document ).on( "mobileinit", function() {
            $("#es-add").click(function() {
{'fraction_non_alphanumeric': 0.1559792027729636, 'fraction_numerical': 0.01097631426920855, 'mean_word_length': 1.6924572317262832, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, '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': '1036394', 'n_tokens_mistral': 2077, 'n_tokens_neox': 2002, 'n_words': 279}