<commit_before>/*jshint browser: true, devel: true, camelcase: true, curly: true, eqeqeq: true, undef: true, unused: true, strict: true */
/*global $:false */

$(document).ready(function() {

		'use strict';

	;( function ( win, doc, lS )
	{



		var MIN_TO_WORK = 30,
			APP_TITLE = 'Time Tracker',

			myAudio = new Audio("alert.mp3"),
			worked = 0,
			minToWork,
			nextCycle,
			startTime,
			startHour,
			startMin,
			cycle,
			count = 0;


		var init = function()
		{
			if (lS.htt_cycle)
			{
				cycle = lS.htt_cycle;
				minToWork = cycle;
			}
			else
			{
				minToWork = MIN_TO_WORK;
				cycle = minToWork;
				nextCycle = cycle;
			}

			$("#timer span").countdown({
				until: 0,
				format: "MS",
				compact: true,
				onExpiry: openAlert,
				onTick: updateTitle,
			});

			// Get stuff from lS
			if (typeof (Storage) !== undefined)
			{
				var i = 0;
				while (i < lS.length)
				{
					if (lS.key(i) === "htt_count" || lS.key(i).indexOf("htt_task") === -1) { continue; }
					$("#done").prepend( lS.getItem( lS.key(i) ) );
				}
				// check if the user is new
				if (lS.htt_count)
				{
					$(".count").text(lS.htt_count);
					count = lS.htt_count;
					$("body").addClass("list");
				}
				else
				{
					$("body").addClass("new");
				}
			}

			// Tinycon.setOptions({
			// 	width: 7,
			// 	height: 9,
			// 	font: '10px arial',
			// 	colour: '#ffffff',
			// 	background: '#549A2F',
			// 	fallback: true
			// });

			updateTitle(APP_TITLE);
		};


		var openAlert = function()
		{
			myAudio.play();
			$("body").removeClass("working").addClass("log");
			$("#new").prop("checked", true);
			$("#what").focus();
		};


		var logTime = function()
		{
			$("body").removeClass("working").addClass("log");
			$("#new").prop("checked", true);
			$("#what").focus();
		};


		var cancelTimer = function(where)
		{
			$("body").removeClass("working").addClass(where);
		};


		var updateTitle = function(title)
		{
			if (!!title[5])
			{
				doc.title = title[5]+":"+title[6]+" - "+APP_TITLE;
				Tinycon.setBubble(title[5]);
			}
			else if (!!title)
			{
				doc.title = title;
				Tinycon.setBubble();
			}
			else<commit_msg>fixed minute 0 bug on title<commit_after>/*jshint browser: true, devel: true, camelcase: true, curly: true, eqeqeq: true, undef: true, unused: true, strict: true */
/*global $:false */

$(document).ready(function() {

		'use strict';

	;( function ( win, doc, lS )
	{



		var MIN_TO_WORK = 30,
			APP_TITLE = 'Time Tracker',

			myAudio = new Audio("alert.mp3"),
			worked = 0,
			minToWork,
			nextCycle,
			startTime,
			startHour,
			startMin,
			cycle,
			count = 0;


		var init = function()
		{
			if (lS.htt_cycle)
			{
				cycle = lS.htt_cycle;
				minToWork = cycle;
			}
			else
			{
				minToWork = MIN_TO_WORK;
				cycle = minToWork;
				nextCycle = cycle;
			}

			$("#timer span").countdown({
				until: 0,
				format: "MS",
				compact: true,
				onExpiry: openAlert,
				onTick: updateTitle,
			});

			// Get stuff from lS
			if (typeof (Storage) !== undefined)
			{
				var i = 0;
				while (i < lS.length)
				{
					if (lS.key(i) === "htt_count" || lS.key(i).indexOf("htt_task") === -1) { continue; }
					$("#done").prepend( lS.getItem( lS.key(i) ) );
				}
				// check if the user is new
				if (lS.htt_count)
				{
					$(".count").text(lS.htt_count);
					count = lS.htt_count;
					$("body").addClass("list");
				}
				else
				{
					$("body").addClass("new");
				}
			}

			// Tinycon.setOptions({
			// 	width: 7,
			// 	height: 9,
			// 	font: '10px arial',
			// 	colour: '#ffffff',
			// 	background: '#549A2F',
			// 	fallback: true
			// });

			updateTitle(APP_TITLE);
		};


		var openAlert = function()
		{
			myAudio.play();
			$("body").removeClass("working").addClass("log");
			$("#new").prop("checked", true);
			$("#what").focus();
		};


		var logTime = function()
		{
			$("body").removeClass("working").addClass("log");
			$("#new").prop("checked", true);
			$("#what").focus();
		};


		var cancelTimer = function(where)
		{
			$("body").removeClass("working").addClass(where);
		};


		var updateTitle = function(title)
		{
			if (!!title[6])
			{
				doc.title = title[5]+":"+title[6]+" - "+APP_TITLE;
				Tinycon.setBubble(title[5]);
			}
			else if (!!title)
			{
				doc.title = title;
				Tinycon.setBubble();
			}
			else
{'fraction_non_alphanumeric': 0.19806540764624597, 'fraction_numerical': 0.009442653155228006, 'mean_word_length': 2.4744, 'pattern_counts': {'":': 2, '<': 5, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '542440', 'n_tokens_mistral': 2123, 'n_tokens_neox': 1655, 'n_words': 324}