<commit_before>if (typeof admiral == "undefined")
{
    admiral = {};
}

jQuery(document).ready( function ()
{
    // Get Dir value from the url to know what type of user operation is being requested Add/Modify/Del
    url = document.URL;
    var keyvaluepairs = url.split("=");
    var str = keyvaluepairs[1].split("&");
    var operation = str[0];
    if(operation.length>0 && (operation=="Add"|| operation=="Modify"||operation=="Delete"))
    {  
       var user = keyvaluepairs[2];
       jQuery("#userOperation").val(operation);
       jQuery("#userID").val(user);
       if ( operation!="Add")
        { 
          jQuery("#userID").attr("disabled",true);
        }
    }
    
   var m = new admiral.AsyncComputation();
            
   m.eval(function(value,callback)
   { 
     var userID= jQuery("#userID").val();
     admiral.userDetails(userID,callback); 
   }); 
         
   m.eval(function(details,callback)
   {
     displayValues(details);
   });
   
   m.exec(null,admiral.noop); 
    
   jQuery("#back").click( function()
   {   
        //alert("back button clicked");
        backURL = "AdminFrontPage.html";
        jQuery("#adminForm").attr('action', backURL); 
        return true;
   });
    
   // Set click handler on user selected
   jQuery("#userList > .userListItem").click( function()
   { 
      jQuery("#selectedUser").val(jQuery(this).text());              
   });     

});

   /**
* Read from the details received and display the user details for the selected user.
* 
* @param userDetails ADMIRAL User Details.
* @param callback    Callback function.
*/
function displayValues(userDetails,callback)
{   
    jQuery.each(userDetails, function(key, value)
    {
        if(key=="FullName")
        {   jQuery("#fullName").val(value);
        }
        
       if(key=="RoomNumber")
        {   jQuery("#roomNumber").val(value);
        }
        if(key=="WorkPhone")
        {   jQuery("#workPhone").val(value);
        }
        if(key=="UserRole")
        {   jQuery("#role").val(value);
        }
    }); 

}<commit_msg>Admin UI (restful web services - work in progress)<commit_after>if (typeof admiral == "undefined")
{
    admiral = {};
}

jQuery(document).ready( function ()
{
    // Get Dir value from the url to know what type of user operation is being requested Add/Modify/Del
    url = document.URL;
    var keyvaluepairs = url.split("=");
    var str = keyvaluepairs[1].split("&");
    var operation = str[0];
    if(operation.length>0 && (operation=="Add"|| operation=="Modify"||operation=="Delete"))
    {  
       var user = keyvaluepairs[2];
       jQuery("#userOperation").val(operation);
       jQuery("#userID").val(user);
       if (operation!="Add")
        { 
          jQuery("#userID").attr("disabled",true);
        }
    }
    
   var m = new admiral.AsyncComputation();
            
   m.eval(function(value,callback)
   { 
     var userID= jQuery("#userID").val();
     admiral.userDetails(userID,callback); 
   }); 
         
   m.eval(function(details,callback)
   {
     displayValues(details);
   });
   
   m.exec(null,admiral.noop); 
    
   jQuery("#back").click( function()
   {   
        //alert("back button clicked");
        backURL = "AdminFrontPage.html";
        jQuery("#adminForm").attr('action', backURL); 
        return true;
   });
    
   // Set click handler on user selected
   jQuery("#userList > .userListItem").click( function()
   { 
      jQuery("#selectedUser").val(jQuery(this).text());              
   });     

});

   /**
* Read from the details received and display the user details for the selected user.
* 
* @param userDetails ADMIRAL User Details.
* @param callback    Callback function.
*/
function displayValues(userDetails,callback)
{   
    jQuery.each(userDetails, function(key, value)
    {
        if(key=="FullName")
        {   jQuery("#fullName").val(value);
        }
        
       if(key=="RoomNumber")
        {   jQuery("#roomNumber").val(value);
        }
        if(key=="WorkPhone")
        {   jQuery("#workPhone").val(value);
        }
        if(key=="UserRole")
        {   jQuery("#role").val(value);
        }
    }); 

}
{'fraction_non_alphanumeric': 0.16224686595949855, 'fraction_numerical': 0.0019286403085824494, 'mean_word_length': 2.409202958093673, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6254551', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1235, 'n_words': 237}