<commit_before>var app = app || {};

app.screenSaver = (function() {

	'use strict';

	app.onReady(function() {
		app.screenSaver.initialize();
	});

	return {

		idleTimeout: null,

		initialize: function() {

			_.bindAll(this,
				'pause',
				'reset',
				'resume',
				'show',
				'toggle'
			);
			$(document).click(this.reset);
			app.on('busy', this.pause);
			app.on('notBusy', this.resume);
			app.settings.on('change:screenSaver', this.toggle);
			if (this.isActive()) {
				this.startTimer();
			}
		},

		toggle: function() {

			if (this.isActive()) {
				this.resume();
			} else {
				this.pause();
			}
		},

		pause: function() {

			this.hide();
			this.stopTimer();
		},

		resume: function() {

			this.startTimer();
		},

		reset: function() {

			this.pause();
			this.resume();
		},

		stopTimer: function() {

			clearTimeout(this.idleTimeout);
		},<commit_msg>When screen saver disabled, don't resume after appNotBusy<commit_after>var app = app || {};

app.screenSaver = (function() {

	'use strict';

	app.onReady(function() {
		app.screenSaver.initialize();
	});

	return {

		idleTimeout: null,

		initialize: function() {

			_.bindAll(this,
				'pause',
				'reset',
				'resume',
				'show',
				'toggle'
			);
			$(document).click(this.reset);
			app.on('busy', this.pause);
			app.on('notBusy', this.resume);
			app.settings.on('change:screenSaver', this.toggle);
			this.toggle();
		},

		toggle: function() {

			if (this.isActive()) {
				this.resume();
			} else {
				this.pause();
			}
		},

		pause: function() {

			this.hide();
			this.stopTimer();
		},

		resume: function() {

			if (this.isActive()) {
				this.startTimer();
			}
		},

		reset: function() {

			this.pause();
			this.resume();
		},

		stopTimer: function() {

			clearTimeout(this.idleTimeout);
		},
{'fraction_non_alphanumeric': 0.19426048565121412, 'fraction_numerical': 0.0, 'mean_word_length': 2.8088235294117645, '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': '2051447', 'n_tokens_mistral': 812, 'n_tokens_neox': 648, 'n_words': 109}