<commit_before>$(function () {
	var themelist = require("ace/ext/themelist");
	console.log(themelist)
	var editor = ace.edit("editor");
	editor.setTheme("ace/theme/solarized_dark");
	editor.getSession().setMode("ace/mode/html");
	editor.session.setUseWrapMode(true);
	editor.session.setWrapLimitRange(null, null);
	editor.session.setUseSoftTabs(true);
	editor.session.setFoldStyle("markbegin");
	editor.session.setTabSize(2);
	editor.setOption("enableEmmet", true);
	editor.setHighlightActiveLine(false);
	editor.setDisplayIndentGuides(true);
	editor.setFontSize("14px");

	var delayPreview;

	var currentTemplate = 'demo';

	editor.on("change", function () {
		clearTimeout(delayPreview);
		delayPreview = setTimeout(updatePreview, 200);
	});

	function loadDefault() {
		$.get("source/"+currentTemplate+".html", function (data) {
			editor.setValue(data);
			editor.clearSelection();
			editor.scrollToLine(0);
		});
	}

	if (window.localStorage && window.localStorage["source"]) {
		editor.setValue(window.localStorage["source"]);
		editor.clearSelection();
		editor.scrollToLine(0);
	}
	else {
		loadDefault();
	}

	function saveStorage() {
		if (window.localStorage) {
			window.localStorage["source"] = editor.getValue();
		}
	}

	var delaySave;

	function updatePreview() {
		var previewFrame = document.getElementById('preview');
		var preview = previewFrame.contentDocument || previewFrame.contentWindow.document;
		preview.open();
		preview.write(editor.getValue());
		preview.close();

		if (window.localStorage) {
			clearTimeout(delaySave);
			delaySave = setTimeout(saveStorage, 1000);
		}
	}

	function windowResizer() {
		$('#wrap').height($(window).height() - $('#menu').outerHeight());
		editor.resize(true);
	}

	var resizeTimer = null;
	$(window).resize(function () {
		if (resizeTimer) clearTimeout(resizeTimer);
		resizeTimer = setTimeout(windowResizer, 200);
	});

	windowResizer();

  function setTemplate(template) {
    $.get("source/"+template+'.html', function (data) {
      editor.setValue(data);
      editor.clearSelection();
      editor.scrollToLine(0);
      currentTemplate = template
    });
  }

	$(".reset").click(function () {
		loadDefault();
	});

	$(".reload").click(function () {
		updatePreview();
	});

	$(".open").click(function () {
		$("#editor").toggleClass('hide');
		$("#preview").toggleClass('full');
    if ($('#preview').hasClass('full')){
      $(this).html('<i class="fa fa-arrow-circle-right" title="Close"></i>')
    }
    else{
      $(this).html('<i class="fa fa-arrow-circle-left" title="Open"></i>')
    }
	});
	themelist.themes.forEach(function(theme){
		var $option = $('<option>').val(theme.theme).text(theme.name).data('dark', theme.isDark)
		$('#theme').append($option)
	});
	$('#theme').change(function(){
		editor.setTheme($(this).val());
    var selected = $(this).find('option:selected');
    var isDark = selected.data('dark');
    if (isDark){
      $('header').addClass('dark')
    }
    else{
      $('header').removeClass('dark')
      $('h1 img').attr('src','images/logo_black.png')
    }<commit_msg>Fix the logo of  dark theme<commit_after>$(function () {
	var themelist = require("ace/ext/themelist");
	console.log(themelist)
	var editor = ace.edit("editor");
	editor.setTheme("ace/theme/solarized_dark");
	editor.getSession().setMode("ace/mode/html");
	editor.session.setUseWrapMode(true);
	editor.session.setWrapLimitRange(null, null);
	editor.session.setUseSoftTabs(true);
	editor.session.setFoldStyle("markbegin");
	editor.session.setTabSize(2);
	editor.setOption("enableEmmet", true);
	editor.setHighlightActiveLine(false);
	editor.setDisplayIndentGuides(true);
	editor.setFontSize("14px");

	var delayPreview;

	var currentTemplate = 'demo';

	editor.on("change", function () {
		clearTimeout(delayPreview);
		delayPreview = setTimeout(updatePreview, 200);
	});

	function loadDefault() {
		$.get("source/"+currentTemplate+".html", function (data) {
			editor.setValue(data);
			editor.clearSelection();
			editor.scrollToLine(0);
		});
	}

	if (window.localStorage && window.localStorage["source"]) {
		editor.setValue(window.localStorage["source"]);
		editor.clearSelection();
		editor.scrollToLine(0);
	}
	else {
		loadDefault();
	}

	function saveStorage() {
		if (window.localStorage) {
			window.localStorage["source"] = editor.getValue();
		}
	}

	var delaySave;

	function updatePreview() {
		var previewFrame = document.getElementById('preview');
		var preview = previewFrame.contentDocument || previewFrame.contentWindow.document;
		preview.open();
		preview.write(editor.getValue());
		preview.close();

		if (window.localStorage) {
			clearTimeout(delaySave);
			delaySave = setTimeout(saveStorage, 1000);
		}
	}

	function windowResizer() {
		$('#wrap').height($(window).height() - $('#menu').outerHeight());
		editor.resize(true);
	}

	var resizeTimer = null;
	$(window).resize(function () {
		if (resizeTimer) clearTimeout(resizeTimer);
		resizeTimer = setTimeout(windowResizer, 200);
	});

	windowResizer();

  function setTemplate(template) {
    $.get("source/"+template+'.html', function (data) {
      editor.setValue(data);
      editor.clearSelection();
      editor.scrollToLine(0);
      currentTemplate = template
    });
  }

	$(".reset").click(function () {
		loadDefault();
	});

	$(".reload").click(function () {
		updatePreview();
	});

	$(".open").click(function () {
		$("#editor").toggleClass('hide');
		$("#preview").toggleClass('full');
    if ($('#preview').hasClass('full')){
      $(this).html('<i class="fa fa-arrow-circle-right" title="Close"></i>')
    }
    else{
      $(this).html('<i class="fa fa-arrow-circle-left" title="Open"></i>')
    }
	});
	themelist.themes.forEach(function(theme){
		var $option = $('<option>').val(theme.theme).text(theme.name).data('dark', theme.isDark)
		$('#theme').append($option)
	});
	$('#theme').change(function(){
		editor.setTheme($(this).val());
    var selected = $(this).find('option:selected');
    var isDark = selected.data('dark');
    if (isDark){
      $('header').addClass('dark')
      $('h1 img').attr('src','images/logo.png')
    }
    else{
      $('header').removeClass('dark')
      $('h1 img').attr('src','images/logo_black.png')
    }
{'fraction_non_alphanumeric': 0.19636539080090062, 'fraction_numerical': 0.005628819556127372, 'mean_word_length': 4.674270072992701, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '5843396', 'n_tokens_mistral': 2107, 'n_tokens_neox': 1983, 'n_words': 285}