<commit_before><!DOCTYPE html>
<html>
<body>

<p>This example starts up a file system to store persistent storage on the hard drive (for saving sims)</p>

<p id="FileSystemTestButton">Click here to test file system</p>

<script>
document.getElementById("FileSystemTestButton").addEventListener("click", FileSystemTest);

function FileSystemTest() {

	// Handle vendor prefixes (allow all browsers to use window.requestFileSystem)
	window.requestFileSystem = window.requestFileSystem || 
                           window.webkitRequestFileSystem;

	// Check for support.
	if (window.requestFileSystem) {
	  // FileSystem Supported
	  console.log("File system support detected");
	} else {
	  // FileSystem Not Supported
	  alert("Saving files is not supported in this browser.");
	}
}
</script>

</body>
</html><commit_msg>Part of the way to getting local storage to work<commit_after><!DOCTYPE html>
<html>
<body>

<p>This example starts up a file system to store persistent storage on the hard drive (for saving sims)</p>

<p id="FileSystemTestButton">Click here to test file system (see console for output)</p>

<script>
//Testing document specifc scripts
//Add button behaviour
document.getElementById("FileSystemTestButton").addEventListener("click", FileSystemTest);






//File system specific code
// Create a global variable that will store a reference to the FileSystem.
var filesystem = null;


// Start the FileSystem (if the browser supports the API)
if (window.FileSystemTest) {
  initFileSystem();
} else {
  alert('Sorry! Your browser doesn\'t support the FileSystem API :(');
}


// Test that the file system works
function FileSystemTest() {

	// Handle vendor prefixes (allow all browsers to use window.requestFileSystem)
	window.requestFileSystem = window.requestFileSystem || 
                           window.webkitRequestFileSystem;

	// Check for support.
	if (window.requestFileSystem) {
	  // FileSystem Supported
	  console.log("File system support detected");
	} else {
	  // FileSystem Not Supported
	  alert("Saving files is not supported in this browser.");
	}
}



// A simple error handler 
function FileSystemErrorHandler(error) {
  var message = '';

  switch (error.code) {
    case FileError.SECURITY_ERR:
      message = 'FileSystem: Security Error';
      break;
    case FileError.NOT_FOUND_ERR:
      message = 'FileSystem: Not Found Error';
      break;
    case FileError.QUOTA_EXCEEDED_ERR:
      message = 'FileSystem: Quota Exceeded Error';
      break;
    case FileError.INVALID_MODIFICATION_ERR:
      message = 'FileSystem: Invalid Modification Error';
      break;
    case FileError.INVALID_STATE_ERR:
      message = 'FileSystem: Invalid State Error';
      break;
    default:
      message = 'FileSystem: Unknown Error';
      break;
  }

  console.log(message);
}

// Request a FileSystem and set the filesystem variable.
function initFileSystem() {
	navigator.webkitPersistentStorage.requestQuota(1024 * 1024 * 5,
		function(grantedSize) {
			// Request a file system with the new size.
			window.requestFileSystem(window.PERSISTENT, grantedSize, function(fs) {
			// Set the filesystem variable.
			filesystem = fs;
			// Setup event listeners on the form.
			setupFormEventListener();
			// Update the file browser.
			listFiles();
			}, FileSystemErrorHandler);
		}, FileSystemErrorHandler);
}

</script>

</body>
</html>
{'fraction_non_alphanumeric': 0.09964518036664695, 'fraction_numerical': 0.0026611472501478417, 'mean_word_length': 3.685595567867036, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '7111524', 'n_tokens_mistral': 995, 'n_tokens_neox': 927, 'n_words': 310}