<commit_before>function run() {
    // the first article in the page is the one we show
    var vdiv = document.getElementsByTagName('article')[0];
    var container = $$("demo-frontis");

    window.onpopstate = function (e) {
	if (e.state != null && e.state.webgl == 1) {
	    container.style.display = "none";
	    vdiv.style.display = "";
	} else {
	    container.style.display = "";
	    vdiv.style.display = "none";
	}
    };
    history.replaceState({webgl:0},"");
    history.pushState({webgl:1},"");

    container.style.display = "none";
    vdiv.style.display = "";

    main();
}<commit_msg>Don't double load panos on back/view by keeping a bit of state in run(). Fixes GH-1<commit_after>var run_main = false;
function run() {
    // the first article in the page is the one we show
    var vdiv = document.getElementsByTagName('article')[0];
    var container = $$("demo-frontis");
    function show_demo() {
	container.style.display = "none";
	vdiv.style.display = "";	
    }
    function show_frontis() {
	container.style.display = "";
	vdiv.style.display = "none";
    }
    if (!run_main) {
	window.onpopstate = function (e) {
	    if (e.state != null && e.state.webgl == 1) show_demo();
	    else show_frontis();
	};
	history.replaceState({webgl:0},"");
	history.pushState({webgl:1},"");

	show_demo();

	main();

	run_main = true;
    } else show_demo();
}
{'fraction_non_alphanumeric': 0.1709090909090909, 'fraction_numerical': 0.006545454545454545, 'mean_word_length': 3.2208588957055215, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7499687', 'n_tokens_mistral': 481, 'n_tokens_neox': 463, 'n_words': 108}