<commit_before>
(function () {
    'use strict';
    angular.module('ngFader', [])
	.directive('ngFader', function($interval) {

	function link(scope){

		/* ==================================================================
			List your images here. 
			The images array is the only code you should need to change.
		===================================================================== */
		scope.images = [{
			src: 'img/slideshow/slideshow_Image_1_low.jpg',
			alt: 'Add your image description here'
		}, {
			src: 'img/slideshow/slideshow_Image_2_low.jpg',
			alt: 'Add your image description here'
		}, {
			src: 'img/slideshow/slideshow_Image_3_low.jpg',
			alt: 'Add your image description here'
		}, {
			src: 'img/slideshow/slideshow_Image_4_low.jpg',
			alt: 'Add your image description here'
		}];


		//Pagination dots - gets number of images
	        scope.numberOfImages = scope.images.length;
	        scope.dots = function(num) {
	          return new Array(num);   
	        };

	        //Pagination - click on dots and change image
	        scope.selectedImage = 0;
	        scope.setSelected = function (idx) {
	          scope.stopSlider();
	          scope.selectedImage = idx;
	        };

	        //Slideshow controls
	        scope.sliderBack = function() {
	          scope.stopSlider();
	          scope.selectedImage === 0 ? scope.selectedImage = scope.numberOfImages - 1 : scope.selectedImage--;
	        };

	        scope.sliderForward = function() {
	          scope.stopSlider();
	          scope.autoSlider();
	        };

	        scope.autoSlider = function (){
	          scope.selectedImage < scope.numberOfImages - 1 ? scope.selectedImage++ : scope.selectedImage = 0;
	        };

	        scope.stopSlider = function() {
	          $interval.cancel(scope.intervalPromise);
	          scope.activePause = true;
	          scope.activeStart = false;
	        };
	        
	        scope.startSlider = function(){
	          scope.intervalPromise = $interval(scope.autoSlider, 3000);
	          scope.activeStart = true;
	          scope.activePause = false;
	        };
	        scope.startSlider();

	}

	  return {
	    restrict: 'E',
	    scope: false,
	    template: '<div class="ng-fader">'+
	    		//images will render here
			'<ul>' + 
				'<li ng-repeat="image in images"><img data-ng-src="{{image.src}}" data-ng-alt="{{image.alt}}" ng-show="selectedImage==$index"/></li>' + 
			'</ul>' + 
			//pagination dots will render here
			'<div class="ng-fader-pagination">' + 
				'<ul>' + 
					'<li ng-repeat="i in dots(numberOfImages) track by $index" ng-class="{current: selectedImage==$index}" ng-click="setSelected($index)"></li>' + 
				'</ul>' + 
			'</div>' + 
			//controls are here
			'<div class="ng-fader-controls">' + 
				'<ul>' + 
					'<li ng-click="sliderBack()">' + 
						'<i class="fa fa-backward"></i>' + 
					'</li>' + 
					'<li ng-class="{\'active\': activePause}" ng-click="stopSlider()">' + 
						'<i class="fa fa-pause"></i>' + 
					'</li>' + 
					'<li ng-class="{\'active\': activeStart}" ng-click="startSlider()">' + 
						'<i class="fa fa-play"></i>' + 
					'</li>' + 
					'<li ng-click="sliderForward()">' + 
						'<i class="fa fa-forward"></i>' + 
					'</li>' + 
				'</ul>' + 
			'</div>' +
		'</div>',
		link: link
	  };
	});

}());<commit_msg>Update ngFader.js<commit_after>(function () {
    'use strict';
    angular.module('ngFader', [])
	.directive('ngFader', function($interval) {

	function link(scope){

		/* ==================================================================
			List your images here. 
			The images array is the only code you should need to change.
		===================================================================== */
		scope.images = [{
			src: 'img/slideshow/slideshow_Image_1_low.jpg',
			alt: 'Add your image description here'
		}, {
			src: 'img/slideshow/slideshow_Image_2_low.jpg',
			alt: 'Add your image description here'
		}, {
			src: 'img/slideshow/slideshow_Image_3_low.jpg',
			alt: 'Add your image description here'
		}, {
			src: 'img/slideshow/slideshow_Image_4_low.jpg',
			alt: 'Add your image description here'
		}];


		//Pagination dots - gets number of images
	        scope.numberOfImages = scope.images.length;
	        scope.dots = function(num) {
	          return new Array(num);   
	        };

	        //Pagination - click on dots and change image
	        scope.selectedImage = 0;
	        scope.setSelected = function (idx) {
	          scope.stopSlider();
	          scope.selectedImage = idx;
	        };

	        //Slideshow controls
	        scope.sliderBack = function() {
	          scope.stopSlider();
	          scope.selectedImage === 0 ? scope.selectedImage = scope.numberOfImages - 1 : scope.selectedImage--;
	        };

	        scope.sliderForward = function() {
	          scope.stopSlider();
	          scope.autoSlider();
	        };

	        scope.autoSlider = function (){
	          scope.selectedImage < scope.numberOfImages - 1 ? scope.selectedImage++ : scope.selectedImage = 0;
	        };

	        scope.stopSlider = function() {
	          $interval.cancel(scope.intervalPromise);
	          scope.activePause = true;
	          scope.activeStart = false;
	        };

	        scope.toggleStartStop = function() {
	          if(scope.activeStart) {
	          	scope.stopSlider();
	          } else {
	          	scope.startSlider();
	          }
	        };
	        
	        scope.startSlider = function(){
	          scope.intervalPromise = $interval(scope.autoSlider, 3000);
	          scope.activeStart = true;
	          scope.activePause = false;
	        };
	        scope.startSlider();

	}

	  return {
	    restrict: 'E',
	    scope: false,
	    template: '<div class="ng-fader">'+
	    		//images will render here
			'<ul>' + 
				'<li ng-repeat="image in images" ng-click="toggleStartStop()" ng-swipe-right="sliderBack()" ng-swipe-left="sliderForward()"><img data-ng-src="{{image.src}}" data-ng-alt="{{image.alt}}" ng-show="selectedImage==$index"/></li>' + 
			'</ul>' + 
			//pagination dots will render here
			'<div class="ng-fader-pagination">' + 
				'<ul>' + 
					'<li ng-repeat="i in dots(numberOfImages) track by $index" ng-class="{current: selectedImage==$index}" ng-click="setSelected($index)"></li>' + 
				'</ul>' + 
			'</div>' + 
			//controls are here
			'<div class="ng-fader-controls">' + 
				'<ul>' + 
					'<li ng-click="sliderBack()">' + 
						'<i class="ngfader-back"></i>' + 
					'</li>' + 
					'<li ng-click="stopSlider()">' + 
						'<i class="ngfader-pause" ng-class="{\'active\': activePause}"></i>' + 
					'</li>' + 
					'<li ng-click="startSlider()">' + 
						'<i class="ngfader-play"  ng-class="{\'active\': activeStart}"></i>' + 
					'</li>' + 
					'<li ng-click="sliderForward()">' + 
						'<i class="ngfader-forward"></i>' + 
					'</li>' + 
				'</ul>' + 
			'</div>' +
		'</div>',
		link: link
	  };
	});

}());
{'fraction_non_alphanumeric': 0.20420204345949058, 'fraction_numerical': 0.003741545546121744, 'mean_word_length': 2.357487922705314, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 69, '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': '5273765', 'n_tokens_mistral': 2537, 'n_tokens_neox': 2172, 'n_words': 417}