<commit_before>/**
 * Core for Shower HTML presentation engine, https://github.com/shower/core
 * @copyright 2010–2014 <NAME>, http://pepelsbey.net
 * @license MIT license: github.com/shower/shower/wiki/MIT-License
 */

if ( ! (window.shower && window.shower.init)) {

window.shower = (function(window, document, undefined) {
	var shower = {},
		url = window.location,
		console = window.console,
		presentationTitle = document.title,
		slides = [],
		progress = [],
		timer,
		Modes = {
			FULL : 'full',
			LIST : 'list'
		};

	// Shower debug mode env, could be overridden before shower.init
	shower.debugMode = false;

	/**
	 * Configuration store.
	 *
	 * @param {Object} [initialState]
	 */
	function State(initialState) {
		initialState = initialState || {};
		this._localStorageKey = 'shower';
		this._store = this._loadFromLocalStorage() || initialState;
	}

	State.prototype = {
		set : function(key, value) {
			this._store[key] = value;
			this._saveToLocalStorage();
			return this;
		},

		unset : function(key) {
			delete this._store[key];
			this._saveToLocalStorage();
			return this;
		},

		get : function(key, defaultValue) {
			var value = this._store[key];
			return typeof value !== 'undefined' ?
				value : defaultValue;
		},

		_saveToLocalStorage : function() {
			window.localStorage.setItem(
				this._localStorageKey,
				JSON.stringify(this._store)
			);
		},

		_loadFromLocalStorage : function() {
			var store = window.localStorage.getItem(this._localStorageKey);
			return store && JSON.parse(store);
		}
	};

	// Shower state.
	shower.state = new State({
		mode : Modes.LIST
	});

	/**
	 * Slide constructor
	 *
	 * @param {Object} opts
	 * @param {String} opts.id html id attribute or automaticaly assigned order number
	 * @param {Number} opts.number slide number
	 * @param {Boolean} opts.hasInnerNavigation
	 * @param {Number} [opts.timing]
	 * @param {Number} [opts.innerLength]
	 * @param {Number} [opts.innerComplete = 0]
	 * @constructor
	 */
	function Slide(opts) {
		for (var prop in opts) {
			if (opts.hasOwnProperty(prop)) {
				this[prop] = opts[prop];
			}
		}
	}

	Slide.prototype = {
		/**<commit_msg>Use sessionStore to clean state after tab closing<commit_after>/**
 * Core for Shower HTML presentation engine, https://github.com/shower/core
 * @copyright 2010–2014 <NAME>, http://pepelsbey.net
 * @license MIT license: github.com/shower/shower/wiki/MIT-License
 */

if ( ! (window.shower && window.shower.init)) {

window.shower = (function(window, document, undefined) {
	var shower = {},
		url = window.location,
		console = window.console,
		presentationTitle = document.title,
		slides = [],
		progress = [],
		timer,
		Modes = {
			FULL : 'full',
			LIST : 'list'
		};

	// Shower debug mode env, could be overridden before shower.init
	shower.debugMode = false;

	/**
	 * Configuration store.
	 *
	 * @param {Object} [initialState]
	 */
	function State(initialState) {
		initialState = initialState || {};
		this._storageKey = 'shower';
		this._store = this._loadFromStorage() || initialState;
	}

	State.prototype = {
		set : function(key, value) {
			this._store[key] = value;
			this._saveToStorage();
			return this;
		},

		unset : function(key) {
			delete this._store[key];
			this._saveToStorage();
			return this;
		},

		get : function(key, defaultValue) {
			var value = this._store[key];
			return typeof value !== 'undefined' ?
				value : defaultValue;
		},

		_saveToStorage : function() {
			window.sessionStorage.setItem(
				this._storageKey,
				JSON.stringify(this._store)
			);
		},

		_loadFromStorage : function() {
			var store = window.sessionStorage.getItem(this._storageKey);
			return store && JSON.parse(store);
		}
	};

	// Shower state.
	shower.state = new State({
		mode : Modes.LIST
	});

	/**
	 * Slide constructor
	 *
	 * @param {Object} opts
	 * @param {String} opts.id html id attribute or automaticaly assigned order number
	 * @param {Number} opts.number slide number
	 * @param {Boolean} opts.hasInnerNavigation
	 * @param {Number} [opts.timing]
	 * @param {Number} [opts.innerLength]
	 * @param {Number} [opts.innerComplete = 0]
	 * @constructor
	 */
	function Slide(opts) {
		for (var prop in opts) {
			if (opts.hasOwnProperty(prop)) {
				this[prop] = opts[prop];
			}
		}
	}

	Slide.prototype = {
		/**
{'fraction_non_alphanumeric': 0.14477958236658933, 'fraction_numerical': 0.004176334106728539, 'mean_word_length': 3.372210953346856, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '2785260', 'n_tokens_mistral': 1595, 'n_tokens_neox': 1388, 'n_words': 325}