<commit_before>(function () {
	function seekBar($document) {
		var calculatePercent = function (seekBar, event) {
			var offsetX = event.pageX - seekBar.offset().left;
			var seekBarWidth = seekBar.width();
			var offsetXPercent = offsetX / seekBarWidth;
			offsetXPercent = Math.max(0, offsetXPercent);
			offsetXPercent = Math.min(1, offsetXPercent);
			return offsetXPercent;
		};

		return {
			templateUrl: '/templates/directives/seek_bar.html',
			replace: true,
			restrict: 'E',
			scope: {
				onChange: '&'
			},
			link: function (scope, element, attributes) {
				scope.value = 0;
				scope.max = 100;

				var seekBar = $(element);

				attributes.$observe('value', function (newValue) {
					scope.value = newValue;
				});

				attributes.$observe('max', function (newValue) {
					scope.max = newValue;
				});

				var percentString = function () {
					var value = scope.value;
					var max = scope.max;
					var percent = value / max * 100;
					return percent + "%";
				};

				scope.fillStyle = function () {
					return {width: percentString()};
				};

				scope.thumbStyle = function () {
					return {left: percentString()};
				};


				scope.onClickSeekBar = function () {
					var percent = calculatePercent(seekBar, event);
					scope.value = percent * scope.max;
					notifyOnChange(scope.value);
				};

				scope.trackThumb = function () {
					$document.bind('mousemove.thumb', function (event) {
						var percent = calculatePercent(seekBar, event);
						scope.$apply(function () {
							scope.value = percent * scope.max;
							notifyOnChange(scope.value);
						});
					});
<commit_msg>Checkpoint-9-Directives :Revised-Fixed missing semicolon on seekBar.js<commit_after>(function () {
	function seekBar($document) {
		var calculatePercent = function (seekBar, event) {
			var offsetX = event.pageX - seekBar.offset().left;
			var seekBarWidth = seekBar.width();
			var offsetXPercent = offsetX / seekBarWidth;
			offsetXPercent = Math.max(0, offsetXPercent);
			offsetXPercent = Math.min(1, offsetXPercent);
			return offsetXPercent;
		};

		return {
			templateUrl: '/templates/directives/seek_bar.html',
			replace: true,
			restrict: 'E',
			scope: {
				onChange: '&'
			},
			link: function (scope, element, attributes) {
				scope.value = 0;
				scope.max = 100;

				var seekBar = $(element);

				attributes.$observe('value', function (newValue) {
					scope.value = newValue;
				});

				attributes.$observe('max', function (newValue) {
					scope.max = newValue;
				});

				var percentString = function () {
					var value = scope.value;
					var max = scope.max;
					var percent = value / max * 100;
					return percent + "%";
				};

				scope.fillStyle = function () {
					return {width: percentString()};
				};

				scope.thumbStyle = function () {
					return {left: percentString()};
				};

				scope.onClickSeekBar = function () {
					var percent = calculatePercent(seekBar, event);
					scope.value = percent * scope.max;
					notifyOnChange(scope.value);
				};

				scope.trackThumb = function () {
					$document.bind('mousemove.thumb', function (event) {
						var percent = calculatePercent(seekBar, event);
						scope.$apply(function () {
							scope.value = percent * scope.max;
							notifyOnChange(scope.value);
						});
					});

{'fraction_non_alphanumeric': 0.13806646525679758, 'fraction_numerical': 0.005740181268882176, 'mean_word_length': 2.8634772462077014, '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': '6253829', 'n_tokens_mistral': 1342, 'n_tokens_neox': 995, 'n_words': 221}