<commit_before>/* $This file is distributed under the terms of the license in /doc/license.txt$ */

$(document).ready(function(){
    
    //Accounts per page
    //Hide is javascrip is disable
    $('.accounts-per-page-form input[type="submit"]').hide();
    
    $('.accounts-per-page').change(function() {
        $('#account-display').submit();
    });
    
    
    //Delete accounts
    //Show is javascript is enable
    $('input:checkbox[name=delete-all]').show();
    
    $('input:checkbox[name=delete-all]').click(function(){
         if ( this.checked ) {
         // if checked, select all the checkboxes
         $('input:checkbox[name=deleteAccount]').attr('checked','checked');
            
         } else {
         // if not checked, deselect all the checkboxes
           $('input:checkbox[name=deleteAccount]').removeAttr('checked');
         }
       
    });
    
      $('input:checkbox[name=deleteAccount]').click(function(){
           $('input:checkbox[name=delete-all]').removeAttr('checked');
      });
      
      // Confirmation alert for account deletion in userAccounts-list.ftl template
       $('input[name="delete-account"]').click(function(){
           var countAccount = $('input:checkbox[name=deleteAccount]:checked').length;
           var answer = confirm( 'Are you sure you want to delete ' + ((countAccount > 1) ? 'these accounts' : 'this account') +'?');
           return answer;
       });
});<commit_msg>NIHVIVO-2280:  On main account page, If there is no account selected for deletion and the user click on the DELETE button, the page was throwing a js alert displaying, "Are you sure you want to delete this account?". I have fixed this error.<commit_after>/* $This file is distributed under the terms of the license in /doc/license.txt$ */

$(document).ready(function(){
    
    //Accounts per page
    //Hide is javascrip is disable
    $('.accounts-per-page-form input[type="submit"]').hide();
    
    $('.accounts-per-page').change(function() {
        $('#account-display').submit();
    });
    
    //Delete accounts
    //Show is javascript is enable
    $('input:checkbox[name=delete-all]').show();
    
    $('input:checkbox[name=delete-all]').click(function(){
         if ( this.checked ) {
         // if checked, select all the checkboxes
         $('input:checkbox[name=deleteAccount]').attr('checked','checked');
            
         } else {
         // if not checked, deselect all the checkboxes
           $('input:checkbox[name=deleteAccount]').removeAttr('checked');
         }
    });
    
    $('input:checkbox[name=deleteAccount]').click(function(){
        $('input:checkbox[name=delete-all]').removeAttr('checked');
    });
      
    // Confirmation alert for account deletion in userAccounts-list.ftl template
    $('input[name="delete-account"]').click(function(){
        var countAccount = $('input:checkbox[name=deleteAccount]:checked').length;
        if (countAccount == 0){
            return false;
        }else{
            var answer = confirm( 'Are you sure you want to delete ' + ((countAccount > 1) ? 'these accounts' : 'this account') +'?');
            return answer;
        }
    });
});
{'fraction_non_alphanumeric': 0.16028858218318695, 'fraction_numerical': 0.00219573400250941, 'mean_word_length': 2.6824480369515014, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7375840', 'n_tokens_mistral': 896, 'n_tokens_neox': 873, 'n_words': 218}