<commit_before><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Disk Usage Reporting</title>

<script type="text/javascript">
	// Path to the directory that contains the reports.
	// Example: document.reportsBaseURL = '/path/to/me/';
	document.reportsBaseURL = '/php/diskusage-data/';
</script>

<link href="css/jquery.ui.tree.css" type="text/css" rel="stylesheet" />
<link href="css/layout.css" type="text/css" rel="stylesheet" />

<!-- External Scripts -->
<script type="text/javascript" src="js/external/jquery.min.js"></script>
<script type="text/javascript" src="js/external/jquery.ui.core.js"></script>
<script type="text/javascript" src="js/external/jquery.ui.widget.js"></script>
<script type="text/javascript" src="js/external/jquery.ui.mouse.js"></script>
<script type="text/javascript" src="js/external/jquery.ui.position.js"></script>
<script type="text/javascript" src="js/external/jquery.sortelements.js"></script>
<script type="text/javascript" src="js/external/jquery.json.js"></script>
<script type="text/javascript" src="js/external/rsh.js"></script>

<!-- Disk Usage Reporting Scripts -->
<script type="text/javascript" src="js/general.js"></script>
<script type="text/javascript" src="js/jquery.ui.tree.js"></script>
<script type="text/javascript" src="js/viewer.js"></script>

<style type="text/css">
	tbody th {
		text-align: right;
	}
</style>

<!-- Disk Usage Reporting Scripts -->
<script type="text/javascript">
	
	/*$(fun0ction() {
		var div = $('<div>').css({ width: '100px', position: 'absolute', top: '100px', left: '100px', 'z-index': '100', 'background-color': '#FFF' }).appendTo($('body'));
		for (var i = 0; i < document.barColors.length; i++) {
			$('<div>').css({ height: '2px', 'background-color': '#' + document.barColors[i] }).appendTo(div);
		}
	});*/
	
	// Override the JSON methods in RSH.
	window.dhtmlHistory.create({
		toJSON: function(o) {
			return $.toJSON(o);
		},
		fromJSON: function(s) {
			return $.evalJSON(s);
		}
	});
	
	// Initialize RSH once the page loads.
	window.onload = function() {
		dhtmlHistory.initialize();
		dhtmlHistory.addListener(function(newLocation, historyData) {
			$(document).trigger('dhtmlhistory', [ newLocation, historyData ]);
		});
	};
	
	// Set up history handling.
	$(document).bind('dhtmlhistory', function(e, location, data) {
		if (document.viewer) document.viewer.display(location);
	});
	
	$(function() {
		$('#Loading').text('Loading Report Settings...');
		
		var ajaxErrorHandler = function(xhr, status, err){
			switch (status) {
				case 'parsererror':
					$('#Loading').append($('<div>').text('Error: Data is invalid or could not be parsed.'));
					break;
				case 'timeout':
					$('#Loading').append($('<div>').text('Error: Download took to long and timed out. Reload to try again.'));
					break;
				case 'error':
					switch (xhr.status) {
						case 404:
							$('#Loading').append($('<div>').text('Error: It is missing or the report does not exist.'));
							break;
						case 401:
							$('#Loading').append($('<div>').text('Error: A username and password is required. Reload to try again.'));
							break;
						default:
							$('#Loading').append($('<div>').text('Error: An unknown error occurred (' + xhr.status + '). Reload to try again.'));
							$.dumpWindow(xhr);
					}
					break;
				default:
					$('#Loading').append($('<div>').text('Error: An unknown error occurred. Reload to try again.'));
			}
		};
		
		setTimeout(function(){ // Debugging timeout
		
		// Load the settings file.
		$.ajax({
			cache: false,
			url: document.reportsBaseURL + window.location.search.substring(1) + '/settings',
			type: 'GET',
			dataType: 'json',
			error: ajaxErrorHandler,
			success: function(settings, status, xhr){
				
				$('#Title > span').append(' for: ').append($('<b>').text(settings.name));
				$('#Created').html('Created:<br/>' + $.implode(settings.created.split(' ').slice(0,3), ' ').htmlencode()).show();
				
				$('#Loading').text('Loading Directory List for Report...');
				
				setTimeout(function(){ // Debugging timeout
				
				// Load the directory lookup file.
				$.ajax({
					cache: false,
					url: document.reportsBaseURL + window.location.search.substring(1) + '/directories',
					type: 'GET',
					dataType: 'json',
					error: ajaxErrorHandler,
					success: function(dirLookup, status, xhr){
						
						$('#Loading').text('Displaying Report...');
						
						setTimeout(function(){ // Debugging timeout
						
						document.viewer = new Viewer({
							directories: dirLookup,
							settings: settings,
							report: window.location.search.substring(1)
						});
						
						document.viewer.display(dhtmlHistory.getCurrentLocation(), function(){
							$('#Loading').hide();
							$('#Container').show();
							
							// Force a resize since the viewer is now displayed.
							document.resizeWindow();
						});
						
						}, 250); // Debugging timeout
					}
				});
				
				}, 250); // Debugging timeout
			}
		});
		
		}, 250); // Debugging timeout
	
		// Load the location on first load.
		if (dhtmlHistory.isFirstLoad()) {
			
		}
		
		document.resizeWindow = function() {
			// Set the correct height for the container.
			var containerHeightDiff = $('#Container').outerHeight(true) - $('#Container').height();
			$('#Container').height($('body').height() - containerHeightDiff - $('#Container').offset().top - 10);
			
			var reportHeightDiff = $('#Report').outerHeight(true) - $('#Report').height();
			$('#Report').height($('#RightColumn').height() - reportHeightDiff - $('#Report').position().top);
		};
		
		$(window).bind("resize", function() {
			if (document.resizeTimerID) clearTimeout(document.resizeTimerID);
			document.resizeTimerID = setTimeout(function() {
				document.resizeWindow();
			}, 100);
		});
	});
</script>
</head>
<body>
	
<div id="Title">Disk Usage Report <span></span><div id="Created" style="display: none;"></div>
</div>

<div id="Loading"></div>

<div id="Container" style="display: none;">

	<div id="LeftColumn">
		<div id="DirectoryTree"></div>
	</div>
	
	<div id="RightColumn">
		
		<div id="ReportHead">
			<div id="Path"></div>
			<div id="DirSummary">Size: <span id="Bytes"></span> (<span id="TotalBytes"></span> incl. sub directories)<br/>
				Files: <span id="Num"></span> (<span id="TotalNum"></span> incl. sub directories)</div>
		</div>
		
		<div id="Tabs">
			<ul>
				<li id="Tab_SubDirs">Contents</li>
				<li id="Tab_Files">File List</li>
				<li id="Tab_Modified">Last Modified</li>
				<li id="Tab_Sizes">File Sizes</li>
				<li id="Tab_Types">File Types</li>
			</ul>
		</div>
		
		<div id="Report">
	
			<div id="Sections">
			
				<div id="Section_SubDirs">
					<table class="styledtable" id="SubDirs" border="1" cellspacing="0" cellpadding="4">
						<thead>
							<tr>
								<th class="totals-sortby-label"><span>Name</span></th>
								<th class="totals-sortby-byte" colspan="3"><span>Total Size</span></th>
								<th class="totals-sortby-num" colspan="3"><span>File Count</span></th>
							</tr>
						</thead><commit_msg>Changed the order in which directory summary displayed totals.<commit_after><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Disk Usage Reporting</title>

<script type="text/javascript">
	// Path to the directory that contains the reports.
	// Example: document.reportsBaseURL = '/path/to/me/';
	document.reportsBaseURL = '/php/diskusage-data/';
</script>

<link href="css/jquery.ui.tree.css" type="text/css" rel="stylesheet" />
<link href="css/layout.css" type="text/css" rel="stylesheet" />

<!-- External Scripts -->
<script type="text/javascript" src="js/external/jquery.min.js"></script>
<script type="text/javascript" src="js/external/jquery.ui.core.js"></script>
<script type="text/javascript" src="js/external/jquery.ui.widget.js"></script>
<script type="text/javascript" src="js/external/jquery.ui.mouse.js"></script>
<script type="text/javascript" src="js/external/jquery.ui.position.js"></script>
<script type="text/javascript" src="js/external/jquery.sortelements.js"></script>
<script type="text/javascript" src="js/external/jquery.json.js"></script>
<script type="text/javascript" src="js/external/rsh.js"></script>

<!-- Disk Usage Reporting Scripts -->
<script type="text/javascript" src="js/general.js"></script>
<script type="text/javascript" src="js/jquery.ui.tree.js"></script>
<script type="text/javascript" src="js/viewer.js"></script>

<style type="text/css">
	tbody th {
		text-align: right;
	}
</style>

<!-- Disk Usage Reporting Scripts -->
<script type="text/javascript">
	
	/*$(fun0ction() {
		var div = $('<div>').css({ width: '100px', position: 'absolute', top: '100px', left: '100px', 'z-index': '100', 'background-color': '#FFF' }).appendTo($('body'));
		for (var i = 0; i < document.barColors.length; i++) {
			$('<div>').css({ height: '2px', 'background-color': '#' + document.barColors[i] }).appendTo(div);
		}
	});*/
	
	// Override the JSON methods in RSH.
	window.dhtmlHistory.create({
		toJSON: function(o) {
			return $.toJSON(o);
		},
		fromJSON: function(s) {
			return $.evalJSON(s);
		}
	});
	
	// Initialize RSH once the page loads.
	window.onload = function() {
		dhtmlHistory.initialize();
		dhtmlHistory.addListener(function(newLocation, historyData) {
			$(document).trigger('dhtmlhistory', [ newLocation, historyData ]);
		});
	};
	
	// Set up history handling.
	$(document).bind('dhtmlhistory', function(e, location, data) {
		if (document.viewer) document.viewer.display(location);
	});
	
	$(function() {
		$('#Loading').text('Loading Report Settings...');
		
		var ajaxErrorHandler = function(xhr, status, err){
			switch (status) {
				case 'parsererror':
					$('#Loading').append($('<div>').text('Error: Data is invalid or could not be parsed.'));
					break;
				case 'timeout':
					$('#Loading').append($('<div>').text('Error: Download took to long and timed out. Reload to try again.'));
					break;
				case 'error':
					switch (xhr.status) {
						case 404:
							$('#Loading').append($('<div>').text('Error: It is missing or the report does not exist.'));
							break;
						case 401:
							$('#Loading').append($('<div>').text('Error: A username and password is required. Reload to try again.'));
							break;
						default:
							$('#Loading').append($('<div>').text('Error: An unknown error occurred (' + xhr.status + '). Reload to try again.'));
							$.dumpWindow(xhr);
					}
					break;
				default:
					$('#Loading').append($('<div>').text('Error: An unknown error occurred. Reload to try again.'));
			}
		};
		
		setTimeout(function(){ // Debugging timeout
		
		// Load the settings file.
		$.ajax({
			cache: false,
			url: document.reportsBaseURL + window.location.search.substring(1) + '/settings',
			type: 'GET',
			dataType: 'json',
			error: ajaxErrorHandler,
			success: function(settings, status, xhr){
				
				$('#Title > span').append(' for: ').append($('<b>').text(settings.name));
				$('#Created').html('Created:<br/>' + $.implode(settings.created.split(' ').slice(0,3), ' ').htmlencode()).show();
				
				$('#Loading').text('Loading Directory List for Report...');
				
				setTimeout(function(){ // Debugging timeout
				
				// Load the directory lookup file.
				$.ajax({
					cache: false,
					url: document.reportsBaseURL + window.location.search.substring(1) + '/directories',
					type: 'GET',
					dataType: 'json',
					error: ajaxErrorHandler,
					success: function(dirLookup, status, xhr){
						
						$('#Loading').text('Displaying Report...');
						
						setTimeout(function(){ // Debugging timeout
						
						document.viewer = new Viewer({
							directories: dirLookup,
							settings: settings,
							report: window.location.search.substring(1)
						});
						
						document.viewer.display(dhtmlHistory.getCurrentLocation(), function(){
							$('#Loading').hide();
							$('#Container').show();
							
							// Force a resize since the viewer is now displayed.
							document.resizeWindow();
						});
						
						}, 250); // Debugging timeout
					}
				});
				
				}, 250); // Debugging timeout
			}
		});
		
		}, 250); // Debugging timeout
	
		// Load the location on first load.
		if (dhtmlHistory.isFirstLoad()) {
			
		}
		
		document.resizeWindow = function() {
			// Set the correct height for the container.
			var containerHeightDiff = $('#Container').outerHeight(true) - $('#Container').height();
			$('#Container').height($('body').height() - containerHeightDiff - $('#Container').offset().top - 10);
			
			var reportHeightDiff = $('#Report').outerHeight(true) - $('#Report').height();
			$('#Report').height($('#RightColumn').height() - reportHeightDiff - $('#Report').position().top);
		};
		
		$(window).bind("resize", function() {
			if (document.resizeTimerID) clearTimeout(document.resizeTimerID);
			document.resizeTimerID = setTimeout(function() {
				document.resizeWindow();
			}, 100);
		});
	});
</script>
</head>
<body>
	
<div id="Title">Disk Usage Report <span></span><div id="Created" style="display: none;"></div>
</div>

<div id="Loading"></div>

<div id="Container" style="display: none;">

	<div id="LeftColumn">
		<div id="DirectoryTree"></div>
	</div>
	
	<div id="RightColumn">
		
		<div id="ReportHead">
			<div id="Path"></div>
			<div id="DirSummary">Total Size: <span id="TotalBytes"></span> (<span id="Bytes"></span> in this directory alone)<br/>
				Total Files: <span id="TotalNum"></span> (<span id="Num"></span> in this directory alone)</div>
		</div>
		
		<div id="Tabs">
			<ul>
				<li id="Tab_SubDirs">Contents</li>
				<li id="Tab_Files">File List</li>
				<li id="Tab_Modified">Last Modified</li>
				<li id="Tab_Sizes">File Sizes</li>
				<li id="Tab_Types">File Types</li>
			</ul>
		</div>
		
		<div id="Report">
	
			<div id="Sections">
			
				<div id="Section_SubDirs">
					<table class="styledtable" id="SubDirs" border="1" cellspacing="0" cellpadding="4">
						<thead>
							<tr>
								<th class="totals-sortby-label"><span>Name</span></th>
								<th class="totals-sortby-byte" colspan="3"><span>Total Size</span></th>
								<th class="totals-sortby-num" colspan="3"><span>File Count</span></th>
							</tr>
						</thead>
{'fraction_non_alphanumeric': 0.20323629071295207, 'fraction_numerical': 0.0071917571398935065, 'mean_word_length': 3.588197969543147, 'pattern_counts': {'":': 0, '<': 233, '<?xml version=': 0, '>': 233, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1712933', 'n_tokens_mistral': 5583, 'n_tokens_neox': 4504, 'n_words': 985}