<commit_before>var shrinking = true; // State variable to show whether the logo is currently shrinking in size
var logoInFocus = false; //used as a conditional for when to stop spinning the logo
var hideLogo = false;
var iconUrl = chrome.extension.getURL("images/icon128.png"); 
var iconUrlFlipped = chrome.extension.getURL("images/icon128flipped.png"); 
var previousPanelHTML = ""; //a means of saving the UI to revert to once in the archiveNow panel

function setMementoButtonInteractivityBasedOnMementoDropdown(){
	$("#mdts").change(function(){
		// If we're on the select box title or the original value, disable view button
		if($(this)[0].selectedIndex == 0 || $(this)[0].selectedIndex == $($(this)[0]).attr("alt")){
			$("#viewMementoButton").attr("disabled","disabled");
		}else {
			$("#viewMementoButton").removeAttr("disabled");
		}
	});
	
	$("#nextMementoButton").click(function(){viewDifferentMemento(1);});
	$("#prevMementoButton").click(function(){viewDifferentMemento(-1);});
}

function showArchiveOptions(){ //TODO: rename this function to say "toggle" instead of "show"
	if($("#archiveOptions").css("marginLeft") == "-700px"){ //draw is already open, close it
		if(debug){console.log("Hiding archive options");}
		$("#archiveOptions").animate({
			marginLeft: "0px",
			opacity: "0.0"
		},500,function(){
			if(previousPanelHTML != ""){ //revert to original UI
				$("#archiveOptions").html(previousPanelHTML);
				previousPanelHTML = "";
			}
		});
			
	}else { //open the drawer
		if(debug){console.log("Showing archive options");}
		$("#archiveOptions").animate({
			marginLeft: "-700px",
			opacity: "1.0"
		},500,null);
		if(debug){console.log($("#archiveOptions").css("marginLeft"));}
		
		//RESTORE view button behavior
		setMementoButtonInteractivityBasedOnMementoDropdown(); //re-attach dropdown change to affect button state
		$("#viewMementoButton").attr("disabled","disabled"); //reset button state to disabled (default dropdown view)
		$("#viewMementoButton").click(function(){window.location = $("#mdts").val();}); //re-attach button functionality
	}
}

/**
 * After the query for the memento list via the URI's timemap, show a numerical count atop the logo
 */
function displayMementoCountAtopLogo(){<commit_msg>Pushing tag v1.0.0.3<commit_after>var shrinking = true; // State variable to show whether the logo is currently shrinking in size
var logoInFocus = false; //used as a conditional for when to stop spinning the logo
var hideLogo = false;
var iconUrl = chrome.extension.getURL("images/icon128.png"); 
var iconUrlFlipped = chrome.extension.getURL("images/icon128flipped.png"); 
var previousPanelHTML = ""; //a means of saving the UI to revert to once in the archiveNow panel

function setMementoButtonInteractivityBasedOnMementoDropdown(){
	$("#mdts").change(function(){
		// If we're on the select box title or the original value, disable view button
		if($(this)[0].selectedIndex == 0 || $(this)[0].selectedIndex == $($(this)[0]).attr("alt")){
			$("#viewMementoButton").attr("disabled","disabled");
		}else {
			$("#viewMementoButton").removeAttr("disabled");
		}
	});
	
	$("#nextMementoButton").click(function(){viewDifferentMemento(1);});
	$("#prevMementoButton").click(function(){viewDifferentMemento(-1);});
}

function showArchiveOptions(){ //TODO: rename this function to say "toggle" instead of "show"
	if($("#archiveOptions").css("marginLeft") == "-700px"){ //draw is already open, close it
		if(debug){console.log("Hiding archive options");}
		$("#archiveOptions").animate({
			marginLeft: "0px",
			opacity: "0.0"
		},500,function(){
			if(previousPanelHTML != ""){ //revert to original UI
				$("#archiveOptions").html(previousPanelHTML);
				previousPanelHTML = "";
			}
		});
			
	}else { //open the drawer
		if(debug){console.log("Showing archive options");}
		$("#archiveOptions").animate({
			marginLeft: "-700px",
			opacity: "1.0"
		},500,null);
		if(debug){console.log($("#archiveOptions").css("marginLeft"));}
		 
		//RESTORE view button behavior
		setMementoButtonInteractivityBasedOnMementoDropdown(); //re-attach dropdown change to affect button state
		$("#viewMementoButton").attr("disabled","disabled"); //reset button state to disabled (default dropdown view)
		$("#viewMementoButton").click(function(){window.location = $("#mdts").val();}); //re-attach button functionality
	}
}

/**
 * After the query for the memento list via the URI's timemap, show a numerical count atop the logo
 */
function displayMementoCountAtopLogo(){
{'fraction_non_alphanumeric': 0.16822222222222222, 'fraction_numerical': 0.013777777777777778, 'mean_word_length': 5.312762973352034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '6297727', 'n_tokens_mistral': 1460, 'n_tokens_neox': 1325, 'n_words': 353}