<commit_before>IonicModule
.controller('$ionSlideBox', [
  '$scope',
  '$element',
  '$$ionicAttachDrag',
  '$interval',
  '$rootScope',
  '$timeout',
function(scope, element, $$ionicAttachDrag, $interval, $rootScope, $timeout) {
  var self = this;

  var relevantSlides = {
    previous: null,
    selected: null,
    next: null
  };
  var oldRelevantSlides = relevantSlides;

  // This is a live nodeList that is updated whenever child ion-slides
  // are added or removed
  var slideNodes = element[0].getElementsByTagName('ion-slide');
  var slideList = ionic.Utils.list(slideNodes);

  var slidesParent = angular.element(element[0].querySelector('.slider-slides'));

  // Successful slide requires velocity to be greater than this amount
  var SLIDE_SUCCESS_VELOCITY = (1 / 4); // pixels / ms
  var SLIDE_TRANSITION_DURATION = 250; //ms

  $$ionicAttachDrag(scope, element, {
    getDistance: function() { return slidesParent.prop('offsetWidth'); },
    onDragStart: onDragStart,
    onDrag: onDrag,
    onDragEnd: onDragEnd
  });

  // At the very end of every digest, check if slides changed
  // This is because our nodes won't be added until after data has been processed
  // (eg you add a slide to data with ng-if, then the ng-if processes and the element
  // now exists)
  $rootScope.$watch(function() {
    if (!checkSlidesChanged.queued) {
      $rootScope.$$postDigest(checkSlidesChanged);
    }
    return true;
  });

  self.element = element;
  self.isRelevant = isRelevant;
  self.previous = previous;
  self.next = next;

  // Methods calling straight back to Utils.list
  self.at = at;
  self.count = slideList.count;
  self.indexOf = indexOf;
  self.isInRange = slideList.isInRange;
  self.loop = slideList.loop;
  self.delta = slideList.delta;

  self.enableSlide = enableSlide;
  self.autoPlay = autoPlay;
  self.selected = selected;
  self.select = select;
  self.onDragStart = onDragStart;
  self.onDrag = onDrag;
  self.onDragEnd = onDragEnd;

  /** DEPRECATED METHODS **/
  self.update = deprecated.method(
    '$ionicSlideBoxDelegate.update() has been deprecated! Slidebox updates on its own now.',
    console.warn,
    angular.noop
  );
  self.currentIndex = deprecated.method(
     '$ionicSlideBoxDelegate.currentIndex() has been deprecated! Use self.selected() instead.',
     console.warn,
     self.selected
  );
  self.slide = deprecated.method(
     '$ionicSlideBoxDelegate.slide(newIndex[, speed]) has been deprecated! Use self.select(newIndex[, speed]) instead.',
     console.warn,
     self.select
  );
  self.slidesCount = deprecated.method(
     '$ionicSlideBoxDelegate.slidesCount has been deprecated! Use self.slidesCount() instead.',
     console.warn,
     self.count
  );
  self.slidesCount =
  self.stop = deprecated.method(
    '$ionicSlideBoxDelegate.stop() has been deprecated! Use $ionicSlideBoxDelegate.autoPlay(0) to stop instead.',
    console.warn,<commit_msg>chore(slideBox): remove extra deprecated slidesCount<commit_after>IonicModule
.controller('$ionSlideBox', [
  '$scope',
  '$element',
  '$$ionicAttachDrag',
  '$interval',
  '$rootScope',
  '$timeout',
function(scope, element, $$ionicAttachDrag, $interval, $rootScope, $timeout) {
  var self = this;

  var relevantSlides = {
    previous: null,
    selected: null,
    next: null
  };
  var oldRelevantSlides = relevantSlides;

  // This is a live nodeList that is updated whenever child ion-slides
  // are added or removed
  var slideNodes = element[0].getElementsByTagName('ion-slide');
  var slideList = ionic.Utils.list(slideNodes);

  var slidesParent = angular.element(element[0].querySelector('.slider-slides'));

  // Successful slide requires velocity to be greater than this amount
  var SLIDE_SUCCESS_VELOCITY = (1 / 4); // pixels / ms
  var SLIDE_TRANSITION_DURATION = 250; //ms

  $$ionicAttachDrag(scope, element, {
    getDistance: function() { return slidesParent.prop('offsetWidth'); },
    onDragStart: onDragStart,
    onDrag: onDrag,
    onDragEnd: onDragEnd
  });

  // At the very end of every digest, check if slides changed
  // This is because our nodes won't be added until after data has been processed
  // (eg you add a slide to data with ng-if, then the ng-if processes and the element
  // now exists)
  $rootScope.$watch(function() {
    if (!checkSlidesChanged.queued) {
      $rootScope.$$postDigest(checkSlidesChanged);
    }
    return true;
  });

  self.element = element;
  self.isRelevant = isRelevant;
  self.previous = previous;
  self.next = next;

  // Methods calling straight back to Utils.list
  self.at = at;
  self.count = slideList.count;
  self.indexOf = indexOf;
  self.isInRange = slideList.isInRange;
  self.loop = slideList.loop;
  self.delta = slideList.delta;

  self.enableSlide = enableSlide;
  self.autoPlay = autoPlay;
  self.selected = selected;
  self.select = select;
  self.onDragStart = onDragStart;
  self.onDrag = onDrag;
  self.onDragEnd = onDragEnd;

  /** DEPRECATED METHODS **/
  self.update = deprecated.method(
    '$ionicSlideBoxDelegate.update() has been deprecated! Slidebox updates on its own now.',
    console.warn,
    angular.noop
  );
  self.currentIndex = deprecated.method(
     '$ionicSlideBoxDelegate.currentIndex() has been deprecated! Use self.selected() instead.',
     console.warn,
     self.selected
  );
  self.slide = deprecated.method(
     '$ionicSlideBoxDelegate.slide(newIndex[, speed]) has been deprecated! Use self.select(newIndex[, speed]) instead.',
     console.warn,
     self.select
  );
  self.slidesCount = deprecated.method(
     '$ionicSlideBoxDelegate.slidesCount has been deprecated! Use self.slidesCount() instead.',
     console.warn,
     self.count
  );
  self.stop = deprecated.method(
    '$ionicSlideBoxDelegate.stop() has been deprecated! Use $ionicSlideBoxDelegate.autoPlay(0) to stop instead.',
    console.warn,
{'fraction_non_alphanumeric': 0.1180389477280492, 'fraction_numerical': 0.0027331738981892723, 'mean_word_length': 3.6990369181380416, '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': '922697', 'n_tokens_mistral': 1878, 'n_tokens_neox': 1790, 'n_words': 476}