<commit_before>var AIRTIME = (function(AIRTIME) {
    var mod,
        libraryInit,
	    oTable,
	    $libContent,
	    $libTable,
	    LIB_SELECTED_CLASS = "lib-selected",
	    chosenItems = {},
	    visibleChosenItems = {};
    
    if (AIRTIME.library === undefined) {
        AIRTIME.library = {};
    }
    mod = AIRTIME.library;
    
    mod.getChosenItemsLength = function(){
        var cItem,
            selected,
            $trs;
		    
        // Get visible items and check if any chosenItems are visible
        $trs = $libTable.find("tbody input:checkbox").parents("tr");
        $trs.each(function(i){
            for (cItem in chosenItems) {
                if (cItem === $(this).attr("id")) {
                    visibleChosenItems[cItem] = $(this).data('aData');
                }
            } 
        });
	    
    	selected = Object.keys(visibleChosenItems).length;
    	visibleChosenItems = {};
    	return selected;
    };
    
    mod.getChosenAudioFilesLength = function(){
    	var files = Object.keys(chosenItems),
    		i, length,
    		count = 0,
    		reAudio=/^au/ ;
    	
    	for (i = 0, length = files.length; i < length; i++) {
    		
    		if (files[i].search(reAudio) !== -1) {
    			count++;
    		}
    	}
    	
    	return count;
    };
    
    mod.createToolbarDropDown = function() {
    	
    	$.contextMenu({
            selector: '#library_content .ui-icon-document-b',
            trigger: "left",
            ignoreRightClick: true,
            items: {
                "sp": {name: "Select This Page", callback: mod.selectCurrentPage},
                "dp": {name: "Deselect This Page", callback: mod.deselectCurrentPage},
                "sn": {name: "Deselect All", callback: mod.selectNone}
            }
        }); 	
    };
    
    mod.checkDeleteButton = function() {
    	var selected = mod.getChosenItemsLength(),<commit_msg>CC-3900: Show Builder boxes remain checked even when the item is no longer visible<commit_after>var AIRTIME = (function(AIRTIME) {
    var mod,
        libraryInit,
	    oTable,
	    $libContent,
	    $libTable,
	    LIB_SELECTED_CLASS = "lib-selected",
	    chosenItems = {},
	    visibleChosenItems = {};
    
    if (AIRTIME.library === undefined) {
        AIRTIME.library = {};
    }
    mod = AIRTIME.library;
    
    mod.getChosenItemsLength = function(){
        var cItem,
            selected,
            $trs;
		    
        // Get visible items and check if any chosenItems are visible
        $trs = $libTable.find("tbody input:checkbox").parents("tr");
        $trs.each(function(i){
            for (cItem in chosenItems) {
                if (cItem === $(this).attr("id")) {
                    visibleChosenItems[cItem] = $(this).data('aData');
                }
            } 
        });
	    
    	selected = Object.keys(visibleChosenItems).length;
    	visibleChosenItems = {};
    	return selected;
    };
    
    mod.getChosenAudioFilesLength = function(){
    	//var files = Object.keys(chosenItems),
    	var files,
            $trs,
            cItem,
            i, length,
            count = 0,
            reAudio=/^au/ ;
    		
        // Get visible items and check if any chosenItems are visible
        $trs = $libTable.find("tbody input:checkbox").parents("tr");
        $trs.each(function(i){
            for (cItem in chosenItems) {
                if (cItem === $(this).attr("id")) {
                    visibleChosenItems[cItem] = $(this).data('aData');
                }
            } 
        });
        
        files = Object.keys(visibleChosenItems);
    	
    	for (i = 0, length = files.length; i < length; i++) {
    		
    		if (files[i].search(reAudio) !== -1) {
    			count++;
    		}
    	}
    	
    	return count;
    };
    
    mod.createToolbarDropDown = function() {
    	
    	$.contextMenu({
            selector: '#library_content .ui-icon-document-b',
            trigger: "left",
            ignoreRightClick: true,
            items: {
                "sp": {name: "Select This Page", callback: mod.selectCurrentPage},
                "dp": {name: "Deselect This Page", callback: mod.deselectCurrentPage},
                "sn": {name: "Deselect All", callback: mod.selectNone}
            }
        }); 	
    };
    
    mod.checkDeleteButton = function() {
    	var selected = mod.getChosenItemsLength(),
{'fraction_non_alphanumeric': 0.13119266055045872, 'fraction_numerical': 0.0022935779816513763, 'mean_word_length': 1.6953028430160693, 'pattern_counts': {'":': 6, '<': 5, '<?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': '2228522', 'n_tokens_mistral': 1352, 'n_tokens_neox': 1302, 'n_words': 267}