<commit_before>$(function(){
	function supports_html5_storage() {
	  try {
	    return 'localStorage' in window && window['localStorage'] !== null;
	  } catch (e) {
	    return false;
	  }
	}
	
	if(supports_html5_storage()){

		if(localStorage.getItem("deleted-sections") != undefined){
			var stored = localStorage.getItem("deleted-sections");
		}
		else{
			var stored = "";
		}
	
		var sections = $(".site-sections li");
		//add something to our localStorage we want to delete from the main page
		function addRemovedSection(toStore){
			if(stored == ""){
				var store = toStore;
			}
			else{
				var store = stored+","+toStore;
			}
			localStorage.setItem("deleted-sections", store);
			stored = localStorage.getItem("deleted-sections");
			getLocallyStored();
 		}
		
		
		//retrieve and hide hidden sections
    function getLocallyStored(){
        if(stored != ""){
            var toHide = stored.split(',');
            var i = toHide.length;
            while(i--){
                if (toHide[i] && toHide[i] != '') {
                    var classToFind = "."+toHide[i];
                    $(classToFind).addClass("hidden")                        
                }

            }
        }
        else return false;
    }

    //reset hidden sections
    function resetSections(){
        localStorage.removeItem("deleted-sections");
        stored = "";
        $(sections).removeClass("hidden");
    }
		
		function addClosers(){
			var i = sections.length;
			while(i--){
				$(sections[i]).children("h3").after("<div class='edit-control'><a href='#' class='hide'>Hide this</a></div>");
			}
			
			$("a.hide").click(function(){
				var toRemove = $(this).parent().parent().attr("class");
				addRemovedSection(toRemove);
				return false;
			});

			
		}
		
		$(".site-sections header").append("<div class='edit-control reset-control'><a href='#' class='resetAll'>Show hidden sections</a></div>");
		$("a.resetAll").click(function(){
			resetSections();
			return false;
		});

		function customisationMode(){
			$(".completed-customise a").click(function(){
				addClosers()
			
				$(this).text("Hide customisation options");
				$(this).parent().removeClass("completed-customise");
				$(this).parent().addClass("currently-customising");
			
				$(".currently-customising a").click(function(){
				
					$(this).text("Customise which sections you see");<commit_msg>Only offering reset link on home if we've customised<commit_after>$(function(){
	function supports_html5_storage() {
	  try {
	    return 'localStorage' in window && window['localStorage'] !== null;
	  } catch (e) {
	    return false;
	  }
	}
	
	if(supports_html5_storage()){

		if(localStorage.getItem("deleted-sections") != undefined){
			var stored = localStorage.getItem("deleted-sections");
			returnHidden();
		}
		else{
			var stored = "";
		}
	
		var sections = $(".site-sections li");
		//add something to our localStorage we want to delete from the main page
		function addRemovedSection(toStore){
			if(stored == ""){
				var store = toStore;
			}
			else{
				var store = stored+","+toStore;
			}
			localStorage.setItem("deleted-sections", store);
			stored = localStorage.getItem("deleted-sections");
			getLocallyStored();
 		}
		
		function returnHidden(){
			$(".site-sections header").append("<div class='edit-control reset-control'><a href='#' class='resetAll'>Show hidden sections</a></div>");
			$("a.resetAll").click(function(){
				resetSections();
				$(".reset-control").remove();
				return false;
			});
		}
		//retrieve and hide hidden sections
    function getLocallyStored(){
        if(stored != ""){
            var toHide = stored.split(',');
            var i = toHide.length;
            while(i--){
                if (toHide[i] && toHide[i] != '') {
                    var classToFind = "."+toHide[i];
                    $(classToFind).addClass("hidden")                        
                }

            }
        }
        else return false;
    }

    //reset hidden sections
    function resetSections(){
        localStorage.removeItem("deleted-sections");
        stored = "";
        $(sections).removeClass("hidden");
    }
		
		function addClosers(){
			var i = sections.length;
			while(i--){
				$(sections[i]).children("h3").after("<div class='edit-control'><a href='#' class='hide'>Hide this</a></div>");
			}
			
			$("a.hide").click(function(){
				var toRemove = $(this).parent().parent().attr("class");
				addRemovedSection(toRemove);
				return false;
			});

			
		}
		
		

		function customisationMode(){
			$(".completed-customise a").click(function(){
				addClosers()
				returnHidden();
				$(this).text("Hide customisation options");
				$(this).parent().removeClass("completed-customise");
				$(this).parent().addClass("currently-customising");
			
				$(".currently-customising a").click(function(){
				
					$(this).text("Customise which sections you see");
{'fraction_non_alphanumeric': 0.17235772357723578, 'fraction_numerical': 0.0012195121951219512, 'mean_word_length': 2.7055722891566263, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '1547073', 'n_tokens_mistral': 1700, 'n_tokens_neox': 1433, 'n_words': 282}