<commit_before><!DOCTYPE html>
<html lang="en">

    <!--================================================================================
        Item Name: CoRR - Cloud of Reproducible Records
        Version: 0.1
        Authors: <NAME> & <NAME>
        Authors URL: https://github.com/usnistgov/corr
    ================================================================================ -->

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="msapplication-tap-highlight" content="no">
        <meta name="description" content="CoRR is a generic cloud platform for reproducible records that allows software management tools and experiment control tools federation and scientific collaboration.">
        <meta name="keywords" content="simulation, experiment, cloud, service, record, atom, metadata, reproducible, repeatable, replicable, managements, generic, platform">

        <title>CoRR - Cloud of Reproducible Records</title>

        <link rel="icon" href="images/logo.ico" sizes="32x32">
        <link rel="apple-touch-icon-precomposed" href="images/logo.svg" sizes="152x152">
        <meta name="msapplication-TileColor" content="#00bcd4">
        <meta name="msapplication-TileImage" content="images/logo.svg" sizes="144x144">

        <link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection">
        <link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection">
        <link href="js/plugins/perfect-scrollbar/perfect-scrollbar.css" type="text/css" rel="stylesheet" media="screen,projection">
        <link href="js/plugins/jvectormap/jquery-jvectormap.css" type="text/css" rel="stylesheet" media="screen,projection">
        <link href="js/plugins/chartist-js/chartist.min.css" type="text/css" rel="stylesheet" media="screen,projection">

    </head>

    <body>

        <div id="loader-wrapper">
            <div id="loader"></div>
            <div class="loader-section section-left"></div>
            <div class="loader-section section-right"></div>
        </div>

        <header id="header" class="page-topbar">
            <div class="navbar-fixed">
                <nav class="cyan">
                    <div class="nav-wrapper">
                        <h1 class="logo-wrapper"><a href="./" id="nav-home" class="brand-logo darken-1"><img src="images/corr-logo.png" alt="corr logo"/><!-- title="corr logo"--></a> <span class="logo-text">CoRR</span></h1>
                        <ul id="nav-base" class="nav-bar right hide-on-med-and-down">
                            <li class="search-out">
                                <input type="text" class="search-out-text">
                            </li>
                            <li class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="search">
                                <a href="javascript:void(0);" class="waves-effect waves-block waves-light show-search">
                                    <i class=" nav-action mdi-action-search"></i>
                                </a>
                            </li>
                            <li class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="home">
                                <a href="./" id= "nav-home-2" class="waves-effect waves-block waves-light">
                                    <i class="nav-action nav-action mdi-action-home"></i>
                                </a>
                            </li>
                            <li class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="help">
                                <a href="./help" id= "nav-help" class="waves-effect waves-block waves-light">
                                    <i class="nav-action mdi-communication-live-help"></i>
                                </a>
                            </li>
                            <li id="nav-login" class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="login">
                                <a href="" data-activates="chat-out" class="waves-effect waves-block waves-light chat-collapse">
                                    <i class="nav-action nav-action mdi-navigation-menu"></i>
                                </a>
                            </li>
                        </ul>
                    </div>
                </nav>
            </div>
        </header>

        <aside id="right-sidebar-nav"></aside>

        <div class="parallax-container">
            <div class="parallax">
                <img src="images/b1.jpeg">
            </div>
        </div>

        <div class="section" id="home-features"></div>

        <div id="float-profile" class="fixed-action-btn" style="bottom: 45px; right: 24px;"></div>

        <div class="container" id="home-stats"></div>

        <div id="account-modal" class="modal login-form"></div>

        <div id="account-update-modal" class="modal login-form"></div>

        <div id="app-add-modal" class="modal login-form"></div>

        <div id="profile-modal" class="modal login-form"></div>

        <footer class="page-footer">
            <div class="footer-copyright">
              <div class="container">
                <span>Funded by <a class="grey-text text-lighten-4" href="https://mgi.nist.gov/" target="_blank">NIST MGI</a>. Accessible under <a class="grey-text text-lighten-4" href="https://raw.githubusercontent.com/usnistgov/corr/master/LICENSE" target="_blank">MIT License.</a></span>
                <span class="right"> CoRR version <a id= "footer-version" class="grey-text text-lighten-4" href="https://github.com/usnistgov/corr" target="_blank">N/A</a></span>
                </div>
            </div>
        </footer>

        <script src="js/config.js"></script>

        <script type="text/javascript" src="js/materialize.js"></script>
        <script type="text/javascript" src="js/prism.js"></script>
        <script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
        <script type="text/javascript" src="js/materialize.min.js"></script>
        <script type="text/javascript" src="js/plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>
        <script type="text/javascript" src="js/plugins/chartist-js/chartist.min.js"></script>
        <script type="text/javascript" src="js/plugins/chartjs/chart.min.js"></script>
        <script type="text/javascript" src="js/plugins/sparkline/jquery.sparkline.min.js"></script>
        <script type="text/javascript" src="js/plugins/sparkline/sparkline-script.js"></script>
        <script type="text/javascript" src="js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
        <script type="text/javascript" src="js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
        <script type="text/javascript" src="js/plugins/jvectormap/vectormap-script.js"></script>
        <script type="text/javascript" src="js/plugins.js"></script>
        <script type="text/javascript" src="js/clipboard.min.js"></script>
        <script type="text/javascript" src="js/plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>

        <script type="text/javascript" src="js/init.js"></script>
        <script type="text/javascript" src="js/cloud.js"></script>

        <script type="text/javascript">
            $(document).ready(function(){
                $('.tooltipped').tooltip({delay: 50});
                $('.collapsible').collapsible({accordion : false});
            });
            function load_succeed(xhttp, params){
                var content = document.getElementById(params[1]);
                content.innerHTML = xhttp.responseText;
            };
            function load_failed(params){
                console.log(window.location.host);
                Materialize.toast('<span>'+params[0]+' injection failed.</span>', 3000);
            };

            config.load_xml('home/right-nav.xml', ['right-nav.xml', 'right-sidebar-nav'], load_succeed, load_failed);
            config.load_xml('home/home-featuresv.xml', ['home-features.xml', 'home-features'], load_succeed, load_failed);
            config.load_xml('home/home-stats.xml', ['home-stats.xml', 'home-stats'], load_succeed, load_failed);
            config.load_xml('home/account-modal.xml', ['account-modal.xml', 'account-modal'], load_succeed, load_failed);
            config.load_xml('home/account-update-modal.xml', ['account-update-modal.xml', 'account-update-modal'], load_succeed, load_failed);
            config.load_xml('home/app-add-modal.xml', ['app-add-modal.xml', 'app-add-modal'], load_succeed, load_failed);
            config.load_xml('home/profile-modal', ['profile-modal.xml', 'profile-modal'], load_succeed, load_failed);

            // Querying the cloud service component for the home page dynamic data injection.
            var xmlhttp = new XMLHttpRequest();
            console.log(this.session);
            xmlhttp.open("GET", "http://"+config.host+":"+config.port+"/cloud/v0.1/public/user/home");
            xmlhttp.send();
            xmlhttp.onreadystatechange=function()
            {
                console.log(xmlhttp.responseText);
                if ((xmlhttp.status >= 200 && xmlhttp.status <= 300) || xmlhttp.status == 304) {
                    console.log(xmlhttp.responseText);
                    if(xmlhttp.responseText == ""){
                        console.log("Cloud returned empty response!");
                    }else{
                        var response = JSON.parse(xmlhttp.responseText);
                        console.log(response);
                        // Data provisioned by the cloud service.
                        var version = response["version"];
                        var users = response["users"];
                        var projects = response["projects"];
                        var records = response["records"];
                        var storage = response["storage"];
                        var apps = response["apps"];
                        var traffic = response["traffic"];
                        // Home page dynamic component data injection from reponse.
                        document.getElementById("total-users").innerHTML = users["number"];
                        document.getElementById("total-projects").innerHTML = projects["number"];
                        document.getElementById("total-records").innerHTML = records["number"];
                        document.getElementById("total-storage").innerHTML = storage["size"];
                        console.log("Version: "+version);
                        document.getElementById("footer-version").innerHTML = version;
                        document.getElementById("total-apps").innerHTML = apps["size"];
                        document.getElementById("total-traffic").innerHTML = traffic["size"];
                        // Logging provisioned and injected values.
                        console.log("Total Users:"+users["number"]);
                        console.log("Total Projects:"+projects["number"]);
                        console.log("Total Records:"+records["number"]);
                        console.log("Total Storage:"+storage["size"]);
                        console.log("CoRR Version:"+version);
                        console.log("Total Apps:"+apps["size"]);
                        console.log("Total Traffic:"+traffic["size"]);
                    }
                } else {
                    console.log("Cannot reach the cloud!");
                }
            }
            var param = window.location.search.substring(1);
            var parts = param.split("=");
            // In case home has session key (logged in)
            if(parts[0] == "session"){
                user.session = parts[1];
                console.log(user.session);
                // Check that the user is trusted with this session key.
                user.trusted();
                user.account();
                console.log("Api Index: "+this.api);
                // If the session is trusted, inject user nav menu session tabs and account floating menu.
                document.getElementById("nav-home-2").href = "./?session="+user.session;
                document.getElementById("nav-home").href = "./?session="+user.session;
                document.getElementById("nav-help").href = "./help/?session="+user.session;
                document.getElementById("nav-login").remove();
                document.getElementById("nav-base").innerHTML += "<li class='tooltipped' data-position='bottom' data-delay='50' data-tooltip='dashboard'><a href='./dashboard/?session="+user.session+"' class='waves-effect waves-block waves-light'><i class='nav-action mdi-action-dashboard'></i></a></li>\n<li class='tooltipped' data-position='bottom' data-delay='50' data-tooltip='logout'><a onclick=\"user.logout()\" class='waves-effect waves-block waves-light'><i class='nav-action mdi-action-exit-to-app'></i></a></li>";
                document.getElementById("float-profile").innerHTML = "<a class='btn-floating btn-large cyan tooltipped' data-position='left' data-delay='50' data-tooltip='settings'><i class='mdi-action-settings'></i></a><ul><li class='tooltipped' data-position='left' data-delay='50' data-tooltip='account'><a href='#account-modal' class='modal-trigger btn-floating btn-large green'><i class='large mdi-communication-vpn-key'></i></a></li><li class='tooltipped' data-position='left' data-delay='50' data-tooltip='profile'><a href='#profile-modal' class='modal-trigger btn-floating btn-large grey darken-1'><i class='large mdi-action-account-circle'></i></a></li><li class='tooltipped' data-position='left' data-delay='50' data-tooltip='chat'><a href='https://gitter.im/usnistgov/corr' class='modal-trigger btn-floating btn-large orange darken-1' target='_blank'><i class='large mdi-communication-chat'></i></a></li><li class='tooltipped' data-position='left' data-delay='50' data-tooltip='email'><a href='mailto:<EMAIL>' class='modal-trigger btn-floating btn-large red darken-1'><i class='large mdi-communication-email'></i></a></li></ul>";

                document.getElementById('account-user-picture').src = "http://"+config.host+":"+config.port+"/cloud/v0.1/private/"+user.session+"/user/picture";
                document.getElementById('update-user-picture').src = "http://"+config.host+":"+config.port+"/cloud/v0.1/private/"+user.session+"/user/picture";
                document.getElementById('profile-user-picture').src = "http://"+config.host+":"+config.port+"/cloud/v0.1/private/"+user.session+"/user/picture";
            }else if(parts[0] == "action"){
                var scope = parts[1];
                if (scope == "message_sent"){
                    Materialize.toast('<span>Your message has been sent!</span>', 3000);
                }
            }
        </script>
        <script>
            (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
            })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
            ga('create', 'UA-64854835-1', 'auto');
            ga('send', 'pageview');
        </script>

    </body>
</html>
<commit_msg>Serious roll back.<commit_after><!DOCTYPE html>
<html lang="en">

    <!--================================================================================
        Item Name: CoRR - Cloud of Reproducible Records
        Version: 0.1
        Authors: <NAME> & <NAME>
        Authors URL: https://github.com/usnistgov/corr
    ================================================================================ -->

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="msapplication-tap-highlight" content="no">
        <meta name="description" content="CoRR is a generic cloud platform for reproducible records that allows software management tools and experiment control tools federation and scientific collaboration.">
        <meta name="keywords" content="simulation, experiment, cloud, service, record, atom, metadata, reproducible, repeatable, replicable, managements, generic, platform">

        <title>CoRR - Cloud of Reproducible Records</title>

        <link rel="icon" href="images/logo.ico" sizes="32x32">
        <link rel="apple-touch-icon-precomposed" href="images/logo.svg" sizes="152x152">
        <meta name="msapplication-TileColor" content="#00bcd4">
        <meta name="msapplication-TileImage" content="images/logo.svg" sizes="144x144">

        <link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection">
        <link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection">
        <link href="js/plugins/perfect-scrollbar/perfect-scrollbar.css" type="text/css" rel="stylesheet" media="screen,projection">
        <link href="js/plugins/jvectormap/jquery-jvectormap.css" type="text/css" rel="stylesheet" media="screen,projection">
        <link href="js/plugins/chartist-js/chartist.min.css" type="text/css" rel="stylesheet" media="screen,projection">

    </head>

    <body>

        <div id="loader-wrapper">
            <div id="loader"></div>
            <div class="loader-section section-left"></div>
            <div class="loader-section section-right"></div>
        </div>

        <header id="header" class="page-topbar">
            <div class="navbar-fixed">
                <nav class="cyan">
                    <div class="nav-wrapper">
                        <h1 class="logo-wrapper"><a href="./" id="nav-home" class="brand-logo darken-1"><img src="images/corr-logo.png" alt="corr logo"/><!-- title="corr logo"--></a> <span class="logo-text">CoRR</span></h1>
                        <ul id="nav-base" class="nav-bar right hide-on-med-and-down">
                            <li class="search-out">
                                <input type="text" class="search-out-text">
                            </li>
                            <li class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="search">
                                <a href="javascript:void(0);" class="waves-effect waves-block waves-light show-search">
                                    <i class=" nav-action mdi-action-search"></i>
                                </a>
                            </li>
                            <li class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="home">
                                <a href="./" id= "nav-home-2" class="waves-effect waves-block waves-light">
                                    <i class="nav-action nav-action mdi-action-home"></i>
                                </a>
                            </li>
                            <li class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="help">
                                <a href="./help" id= "nav-help" class="waves-effect waves-block waves-light">
                                    <i class="nav-action mdi-communication-live-help"></i>
                                </a>
                            </li>
                            <li id="nav-login" class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="login">
                                <a href="" data-activates="chat-out" class="waves-effect waves-block waves-light chat-collapse">
                                    <i class="nav-action nav-action mdi-navigation-menu"></i>
                                </a>
                            </li>
                        </ul>
                    </div>
                </nav>
            </div>
        </header>

        <aside id="right-sidebar-nav">
            <ul id="chat-out" class="side-nav rightside-navigation">
                <li class="li-hover">
                    <ul class="chat-collapsible" data-collapsible="expandable">
                        <li>
                            <div class="collapsible-header teal white-text active"><i class="mdi-action-home"></i>Login</div>
                            <div class="collapsible-body recent-activity">
                                <div class="row margin">
                                  <div class="input-field col s12">
                                    <i class="mdi-social-person-outline prefix"></i>
                                    <input id="login-email" type="email" onkeypress="loginKeyPress(event);">
                                    <label for="login-email" class="center-align">Email</label>
                                  </div>
                                </div>
                                <div class="row margin">
                                  <div class="input-field col s12">
                                    <i class="mdi-action-lock-outline prefix"></i>
                                    <input id="login-password" type="password" onkeypress="loginKeyPress(event);">
                                    <label for="login-password">Password</label>
                                  </div>
                                </div>
                                <div class="row">
                                  <div class="input-field col s12">
                                    <a id="buttonLogin" onclick="return user.login();" class="btn login-button waves-effect waves-light green col s12">Login</a>
                                  </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="collapsible-header light-blue white-text"><i class="mdi-action-input"></i>Register</div>
                            <div class="collapsible-body sales-repoart">
                                <div class="row margin">
                                  <div class="input-field col s12">
                                    <i class="mdi-communication-email prefix"></i>
                                    <input id="register-email" type="email" onkeypress="registerKeyPress(event);">
                                    <label for="register-email" class="center-align">Email</label>
                                  </div>
                                </div>
                                <div class="row margin">
                                  <div class="input-field col s12">
                                    <i class="mdi-action-lock-outline prefix"></i>
                                    <input id="register-password" type="password" onkeypress="registerKeyPress(event);">
                                    <label for="register-password">Password</label>
                                  </div>
                                </div>
                                <div class="row margin">
                                  <div class="input-field col s12">
                                    <i class="mdi-action-lock-outline prefix"></i>
                                    <input id="register-password-again" type="password" onkeypress="registerKeyPress(event);">
                                    <label for="register-password-again">Password again</label>
                                  </div>
                                </div>
                                <div class="row">
                                  <div class="input-field col s12">
                                    <a id="buttonRegister" onclick="return user.register();" class="btn waves-effect waves-light blue col s12">Register Now</a>
                                  </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="collapsible-header teal white-text"><i class="mdi-communication-vpn-key"></i>Forgot Password</div>
                            <div class="collapsible-body recent-activity">
                                <div class="row margin">
                                  <div class="input-field col s12">
                                    <i class="mdi-social-person-outline prefix"></i>
                                    <input id="recover-email" type="email" onkeypress="recoverKeyPress(event);">
                                    <label for="recover-email" class="center-align">Email</label>
                                  </div>
                                </div>
                                <div class="row">
                                  <div class="input-field col s12">
                                    <a id="buttonRecover" onclick="return user.recover();" class="btn login-button waves-effect waves-light green col s12">Request</a>
                                  </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="collapsible-header orange white-text"><i class="mdi-communication-chat"></i><a href="https://gitter.im/usnistgov/corr" target="_blank">Chat</a></div>

                        </li>
                        <li>
                            <div class="collapsible-header red white-text"><i class="mdi-communication-email"></i><a href="mailto:<EMAIL>">Email</a></div>
                        </li>
                    </ul>
                </li>
            </ul>
        </aside>

        <div class="parallax-container">
            <div class="parallax">
                <img src="images/b1.jpeg">
            </div>
        </div>

        <div class="section" id="home-features"></div>

        <div id="float-profile" class="fixed-action-btn" style="bottom: 45px; right: 24px;">
        </div>

        <div class="container" id="home-stats">
            <section id="content">
                <div class="container">
                    <div id="card-stats">
                        <div class="row">
                            <div class="col s12 m6 l2">
                                <div class="card">
                                    <div class="card-content  green white-text">
                                        <p class="card-stats-title"><i class="mdi-social-group-add"></i> Users</p>
                                        <h4 class="card-stats-number" id="total-users">N/A</h4>
                                        </p>
                                    </div>
                                </div>
                            </div>
                            <div class="col s12 m6 l2">
                                <div class="card">
                                    <div class="card-content purple white-text">
                                        <p class="card-stats-title"><i class="mdi-navigation-apps"></i> Applications</p>
                                        <h4 class="card-stats-number" id="total-apps">N/A</h4>
                                    </div>
                                </div>
                            </div>
                            <div class="col s12 m6 l2">
                                <div class="card">
                                    <div class="card-content brown white-text">
                                        <p class="card-stats-title"><i class="mdi-file-folder"></i> Projects</p>
                                        <h4 class="card-stats-number" id="total-projects">N/A</h4>
                                    </div>
                                </div>
                            </div>
                            <div class="col s12 m6 l2">
                                <div class="card">
                                    <div class="card-content blue-grey white-text">
                                        <p class="card-stats-title"><i class="mdi-file-cloud-upload"></i> Records</p>
                                        <h4 class="card-stats-number" id="total-records">N/A</h4>
                                    </div>
                                </div>
                            </div>
                            <div class="col s12 m6 l2">
                                <div class="card">
                                    <div class="card-content red white-text">
                                        <p class="card-stats-title"><i class="mdi-device-storage"></i> Storage</p>
                                        <h4 class="card-stats-number" id="total-storage">N/A</h4>
                                    </div>
                                </div>
                            </div>
                            <div class="col s12 m6 l2">
                                <div class="card">
                                    <div class="card-content orange white-text">
                                        <p class="card-stats-title"><i class="mdi-av-equalizer"></i> Traffic</p>
                                        <h4 class="card-stats-number" id="total-traffic">N/A</h4>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>

        <div id="account-modal" class="modal login-form">
            <div class="modal-content">
                <div class="row">
                  <div class="input-field col s12 center">
                    <img src="images/picture.png" id="account-user-picture" alt="" class="circle responsive-img valign profile-image-login">
                  </div>
                </div>
                <div class="divider"></div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <i class="mdi-communication-email prefix"></i>
                    <input readonly id="view-email" type="email">
                    <label id="view-email-value" for="view-email">Email</label>
                  </div>
                </div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <i class="mdi-communication-vpn-key prefix"></i>
                    <input readonly id="view-api" type="text">
                    <label class"truncate" id="view-api-value" for="view-api">Api Key</label>
                  </div>
                </div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <!-- <button data-clipboard-action="copy" data-clipboard-target="#view-api" class="btn waves-effect waves-light col s12">Copy Token</button> -->
                    <a onclick="return user.config();" class="modal-trigger btn waves-effect waves-light col s12">Download Config</a>
                  </div>
                </div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <a href="#account-update-modal" class="modal-trigger btn waves-effect waves-light col s12">Update Account</a>
                  </div>
                </div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <a href="#app-add-modal" class="modal-trigger btn purple waves-effect waves-light col s12">Add Application</a>
                  </div>
                </div>
            </div>
        </div>

        <div id="account-update-modal" class="modal login-form">
            <div class="modal-content">
                <div class="row center tooltipped" data-position="top" data-delay="50" data-tooltip="click to change">
                    <label for="picture-input">
                        <img src="images/picture.png" alt="" id="update-user-picture" class="circle responsive-img valign profile-image-login">
                    </label>
                    <input id="picture-input" type="file" style="display: none;"/>
                </div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <i class="mdi-action-lock-outline prefix"></i>
                    <input id="edit-new-password" type="password">
                    <label for="edit-new-password">New Password</label>
                  </div>
                </div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <i class="mdi-action-lock-outline prefix"></i>
                    <input id="edit-new-password-again" type="password">
                    <label for="edit-new-password-again">New Password Again</label>
                  </div>
                </div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <a onclick="return user.update();" class="btn waves-effect waves-light col s12">Confirm</a>
                  </div>
                </div>
            </div>
        </div>

        <div id="app-add-modal" class="modal login-form">
            <div class="modal-content">
                <div class="row center tooltipped" data-position="top" data-delay="50" data-tooltip="application logo">
                    <label for="picture-input">
                        <img src="images/gearsIcon.png" alt="" id="update-user-picture" class="circle responsive-img valign profile-image-login">
                    </label>
                </div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <i class="mdi-action-lock-outline prefix"></i>
                    <input id="app-name" type="text">
                    <label for="app-name">App Name</label>
                  </div>
                </div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <i class="mdi-action-assignment prefix"></i>
                    <textarea id="app-about" class="materialize-textarea"></textarea>
                    <label id="app-about-value" for="app-about">About</label>
                  </div>
                </div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <a onclick="return user.add_app();" class="btn waves-effect purple waves-light col s12">Confirm</a>
                  </div>
                </div>
            </div>
        </div>

        <div id="profile-modal" class="modal login-form">
            <div class="modal-content">
                <div class="row">
                  <div class="input-field col s12 center">
                    <img src="images/picture.png" alt="" id="profile-user-picture" class="circle responsive-img valign profile-image-login">
                  </div>
                </div>
                <div class="divider"></div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <i class="mdi-action-perm-identity prefix"></i>
                    <input id="view-fname" type="text">
                    <label id="view-fname-value" for="view-fname">First Name</label>
                  </div>
                </div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <i class="mdi-action-assignment-ind prefix"></i>
                    <input id="view-lname" type="text">
                    <label id="view-lname-value" for="view-lname">Last Name</label>
                  </div>
                </div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <i class="mdi-action-home prefix"></i>
                    <input id="view-org" type="text">
                    <label id="view-org-value" for="view-org">Organisation</label>
                  </div>
                </div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <i class="mdi-action-assignment prefix"></i>
                    <textarea id="view-about" class="materialize-textarea"></textarea>
                    <label id="view-about-value" for="view-about">About</label>
                  </div>
                </div>
                <div class="row margin">
                  <div class="input-field col s12">
                    <a onclick="return user.update();" class="modal-trigger btn waves-effect waves-light col s12">Update Profile</a>
                  </div>
                </div>
            </div>
        </div>

        <footer class="page-footer">
            <div class="footer-copyright">
              <div class="container">
                <span>Funded by <a class="grey-text text-lighten-4" href="https://mgi.nist.gov/" target="_blank">NIST MGI</a>. Accessible under <a class="grey-text text-lighten-4" href="https://raw.githubusercontent.com/usnistgov/corr/master/LICENSE" target="_blank">MIT License.</a></span>
                <span class="right"> CoRR version <a id= "footer-version" class="grey-text text-lighten-4" href="https://github.com/usnistgov/corr" target="_blank">N/A</a></span>
                </div>
            </div>
        </footer>

        <script src="js/config.js"></script>

        <script type="text/javascript" src="js/materialize.js"></script>
        <script type="text/javascript" src="js/prism.js"></script>
        <script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
        <script type="text/javascript" src="js/materialize.min.js"></script>
        <script type="text/javascript" src="js/plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>
        <script type="text/javascript" src="js/plugins/chartist-js/chartist.min.js"></script>
        <script type="text/javascript" src="js/plugins/chartjs/chart.min.js"></script>
        <script type="text/javascript" src="js/plugins/sparkline/jquery.sparkline.min.js"></script>
        <script type="text/javascript" src="js/plugins/sparkline/sparkline-script.js"></script>
        <script type="text/javascript" src="js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
        <script type="text/javascript" src="js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
        <script type="text/javascript" src="js/plugins/jvectormap/vectormap-script.js"></script>
        <script type="text/javascript" src="js/plugins.js"></script>
        <script type="text/javascript" src="js/clipboard.min.js"></script>
        <script type="text/javascript" src="js/plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>

        <script type="text/javascript" src="js/init.js"></script>
        <script type="text/javascript" src="js/cloud.js"></script>

        <script type="text/javascript">
            $(document).ready(function(){
                $('.tooltipped').tooltip({delay: 50});
                $('.collapsible').collapsible({accordion : false});
            });
            function load_succeed(xhttp, params){
                var content = document.getElementById(params[1]);
                content.innerHTML = xhttp.responseText;
            };
            function load_failed(params){
                console.log(window.location.host);
                Materialize.toast('<span>'+params[0]+' injection failed.</span>', 3000);
            };

            // config.load_xml('home/right-nav.xml', ['right-nav.xml', 'right-sidebar-nav'], load_succeed, load_failed);
            config.load_xml('home/home-features.xml', ['home-features.xml', 'home-features'], load_succeed, load_failed);
            // config.load_xml('home/home-stats.xml', ['home-stats.xml', 'home-stats'], load_succeed, load_failed);
            // config.load_xml('home/account-modal.xml', ['account-modal.xml', 'account-modal'], load_succeed, load_failed);
            // config.load_xml('home/account-update-modal.xml', ['account-update-modal.xml', 'account-update-modal'], load_succeed, load_failed);
            // config.load_xml('home/app-add-modal.xml', ['app-add-modal.xml', 'app-add-modal'], load_succeed, load_failed);
            // config.load_xml('home/profile-modal', ['profile-modal.xml', 'profile-modal'], load_succeed, load_failed);
            // Querying the cloud service component for the home page dynamic data injection.
            var xmlhttp = new XMLHttpRequest();
            console.log(this.session);
            xmlhttp.open("GET", "http://"+config.host+":"+config.port+"/cloud/v0.1/public/user/home");
            xmlhttp.send();
            xmlhttp.onreadystatechange=function()
            {
                console.log(xmlhttp.responseText);
                if ((xmlhttp.status >= 200 && xmlhttp.status <= 300) || xmlhttp.status == 304) {
                    console.log(xmlhttp.responseText);
                    if(xmlhttp.responseText == ""){
                        console.log("Cloud returned empty response!");
                    }else{
                        var response = JSON.parse(xmlhttp.responseText);
                        console.log(response);
                        // Data provisioned by the cloud service.
                        var version = response["version"];
                        var users = response["users"];
                        var projects = response["projects"];
                        var records = response["records"];
                        var storage = response["storage"];
                        var apps = response["apps"];
                        var traffic = response["traffic"];
                        // Home page dynamic component data injection from reponse.
                        document.getElementById("total-users").innerHTML = users["number"];
                        document.getElementById("total-projects").innerHTML = projects["number"];
                        document.getElementById("total-records").innerHTML = records["number"];
                        document.getElementById("total-storage").innerHTML = storage["size"];
                        console.log("Version: "+version);
                        document.getElementById("footer-version").innerHTML = version;
                        document.getElementById("total-apps").innerHTML = apps["size"];
                        document.getElementById("total-traffic").innerHTML = traffic["size"];
                        // Logging provisioned and injected values.
                        console.log("Total Users:"+users["number"]);
                        console.log("Total Projects:"+projects["number"]);
                        console.log("Total Records:"+records["number"]);
                        console.log("Total Storage:"+storage["size"]);
                        console.log("CoRR Version:"+version);
                        console.log("Total Apps:"+apps["size"]);
                        console.log("Total Traffic:"+traffic["size"]);
                        console.log("++Total Users:"+document.getElementById("total-users").value);
                        console.log("++Total Projects:"+document.getElementById("total-projects").value);
                        console.log("++Total Records:"+document.getElementById("total-records").value);
                        console.log("++Total Stage:"+document.getElementById("total-storage").value);
                        console.log("++CoRR Version:"+document.getElementById("footer-version").value);
                        console.log("++Total Apps:"+document.getElementById("total-apps").value);
                        console.log("++Total Traffic:"+document.getElementById("total-traffic").value);
                    }
                } else {
                    console.log("Cannot reach the cloud!");
                }
            }
            var param = window.location.search.substring(1);
            var parts = param.split("=");
            // In case home has session key (logged in)
            if(parts[0] == "session"){
                user.session = parts[1];
                console.log(user.session);
                // Check that the user is trusted with this session key.
                user.trusted();
                user.account();
                console.log("Api Index: "+this.api);
                // If the session is trusted, inject user nav menu session tabs and account floating menu.
                document.getElementById("nav-home-2").href = "./?session="+user.session;
                document.getElementById("nav-home").href = "./?session="+user.session;
                document.getElementById("nav-help").href = "./help/?session="+user.session;
                document.getElementById("nav-login").remove();
                document.getElementById("nav-base").innerHTML += "<li class='tooltipped' data-position='bottom' data-delay='50' data-tooltip='dashboard'><a href='./dashboard/?session="+user.session+"' class='waves-effect waves-block waves-light'><i class='nav-action mdi-action-dashboard'></i></a></li>\n<li class='tooltipped' data-position='bottom' data-delay='50' data-tooltip='logout'><a onclick=\"user.logout()\" class='waves-effect waves-block waves-light'><i class='nav-action mdi-action-exit-to-app'></i></a></li>";
                document.getElementById("float-profile").innerHTML = "<a class='btn-floating btn-large cyan tooltipped' data-position='left' data-delay='50' data-tooltip='settings'><i class='mdi-action-settings'></i></a><ul><li class='tooltipped' data-position='left' data-delay='50' data-tooltip='account'><a href='#account-modal' class='modal-trigger btn-floating btn-large green'><i class='large mdi-communication-vpn-key'></i></a></li><li class='tooltipped' data-position='left' data-delay='50' data-tooltip='profile'><a href='#profile-modal' class='modal-trigger btn-floating btn-large grey darken-1'><i class='large mdi-action-account-circle'></i></a></li><li class='tooltipped' data-position='left' data-delay='50' data-tooltip='chat'><a href='https://gitter.im/usnistgov/corr' class='modal-trigger btn-floating btn-large orange darken-1' target='_blank'><i class='large mdi-communication-chat'></i></a></li><li class='tooltipped' data-position='left' data-delay='50' data-tooltip='email'><a href='mailto:<EMAIL>' class='modal-trigger btn-floating btn-large red darken-1'><i class='large mdi-communication-email'></i></a></li></ul>";

                document.getElementById('account-user-picture').src = "http://"+config.host+":"+config.port+"/cloud/v0.1/private/"+user.session+"/user/picture";
                document.getElementById('update-user-picture').src = "http://"+config.host+":"+config.port+"/cloud/v0.1/private/"+user.session+"/user/picture";
                document.getElementById('profile-user-picture').src = "http://"+config.host+":"+config.port+"/cloud/v0.1/private/"+user.session+"/user/picture";
            }else if(parts[0] == "action"){
                var scope = parts[1];
                if (scope == "message_sent"){
                    Materialize.toast('<span>Your message has been sent!</span>', 3000);
                }
            }
        </script>
        <script>
            (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
            })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
            ga('create', 'UA-64854835-1', 'auto');
            ga('send', 'pageview');
        </script>

    </body>
</html>

{'fraction_non_alphanumeric': 0.15931173667894222, 'fraction_numerical': 0.007240496847887148, 'mean_word_length': 1.71027404984775, 'pattern_counts': {'":': 8, '<': 777, '<?xml version=': 0, '>': 777, 'https://': 11, 'lorem ipsum': 0, 'www.': 2, 'xml': 62}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 99, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3370309', 'n_tokens_mistral': 13015, 'n_tokens_neox': 12199, 'n_words': 2225}