<commit_before>var EchoesWorks = function (options) {
	var defaults, self = this;
	defaults = {
		element: 'slide',
		source: 'data/data.json',
		auto: false
	};

	if(options === undefined) {
		console.log("Default Options is Empty, use default options...");
		options = {};
	}

	EchoesWorks.defaults(options, defaults);

	this.options = options;
	this.source = this.options.source;
	this.element = this.options.element;
	this.playing = this.options.auto;
	this.totalTime = 0;
	this.data = [];
	this.dataStatus = false;
	this.fps = 10;
	setInterval(function () {
		self.update();
	}, 1000 / this.fps);
	this.time = 0;
	this.init();
};

EchoesWorks.prototype.init = function () {
	function getMaxOfArray(numArray) {
		return Math.max.apply(null, numArray);
	}

	var that = this;
	that.parser();
	if (typeof that.parser.data.times === 'object') {
		that.data = that.parser.data;
		that.dataStatus = true;
		var times = that.parser.parseTime(that.parser.data.times);
		that.totalTime = getMaxOfArray(times);
		EchoesWorks.triggerEvent("ew:slide:init");
	}
};

EchoesWorks.prototype.stop = function () {
	this.playing = false;
	this.time = 0;
};

EchoesWorks.prototype.pause = function () {
	this.playing = false;
};

EchoesWorks.prototype.play = function () {
	this.playing = true;
};

EchoesWorks.prototype.update = function () {
	if (this.playing) {
		this.time += 1 / this.fps;
	}
	this.applyEchoes();
};

EchoesWorks.prototype.applyEchoes = function () {
	var that = this;
	if (that.dataStatus && that.data) {
		var times = that.parser.parseTime(that.data.times);
		var currentSlide = window.slide.slide();

		if (parseFloat(that.time) > times[currentSlide]) {
			window.slide.next();
			if(that.data.codes[currentSlide]){
				var url = EchoesWorks.fn.rawGitConvert(that.data.codes[currentSlide]);
				EchoesWorks.get(url, function(data){
					document.querySelector('code').innerHTML = EchoesWorks.md.parse(data);
				});
			}
		}<commit_msg>simple format for code<commit_after>var EchoesWorks = function (options) {
	var defaults, self = this;
	defaults = {
		element: 'slide',
		source: 'data/data.json',
		auto: false
	};

	if(options === undefined) {
		console.log("Default Options is Empty, use default options...");
		options = {};
	}

	EchoesWorks.defaults(options, defaults);

	this.options = options;
	this.source = this.options.source;
	this.element = this.options.element;
	this.playing = this.options.auto;
	this.totalTime = 0;
	this.data = [];
	this.dataStatus = false;
	this.fps = 10;
	setInterval(function () {
		self.update();
	}, 1000 / this.fps);
	this.time = 0;
	this.init();
};

EchoesWorks.prototype.init = function () {
	function getMaxOfArray(numArray) {
		return Math.max.apply(null, numArray);
	}

	var that = this;
	that.parser();
	if (typeof that.parser.data.times === 'object') {
		that.data = that.parser.data;
		that.dataStatus = true;
		var times = that.parser.parseTime(that.parser.data.times);
		that.totalTime = getMaxOfArray(times);
		EchoesWorks.triggerEvent("ew:slide:init");
	}
};

EchoesWorks.prototype.stop = function () {
	this.playing = false;
	this.time = 0;
};

EchoesWorks.prototype.pause = function () {
	this.playing = false;
};

EchoesWorks.prototype.play = function () {
	this.playing = true;
};

EchoesWorks.prototype.update = function () {
	if (this.playing) {
		this.time += 1 / this.fps;
	}
	this.applyEchoes();
};

EchoesWorks.prototype.applyEchoes = function () {
	var that = this;
	if (that.dataStatus && that.data) {
		var times = that.parser.parseTime(that.data.times);
		var currentSlide = window.slide.slide();

		if (parseFloat(that.time) > times[currentSlide]) {
			window.slide.next();
			if(that.data.codes[currentSlide]){
				var url = EchoesWorks.fn.rawGitConvert(that.data.codes[currentSlide]);
				EchoesWorks.get(url, function(response){
					response = response.replace(/\n/g, "<br/>").replace(/ /g, "&nbsp;");
					document.querySelector('code').innerHTML = EchoesWorks.md.parse(response);
				});
			}
		}
{'fraction_non_alphanumeric': 0.1638602663985926, 'fraction_numerical': 0.005026388539834129, 'mean_word_length': 3.9564134495641343, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, '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': '1242162', 'n_tokens_mistral': 1543, 'n_tokens_neox': 1393, 'n_words': 252}