<commit_before>import Ember from 'ember';

export default Ember.Mixin.create({

  /**!
   * Set gestureAllow to a jQuery selector string to optionally specify
   * which child elements should be allowed to trigger a gesture.
   *
   * Can be used in tandem with gestureExclude.
   */
  gestureAllow : null,


  /**!
   * Set gestureExclude to a jQuery selector string to optionally specify
   * which child elements should not be allowed to trigger a gesture.
   *
   * Can be used in tandem with gestureAllow.
   */
  gestureExclude : null,


  /**!
   * @deprecated
   *
   * Maps to ENV.mobileTouch.useGestures; Default is `false`. Keep false
   * to improve performance if your app does not utilize the gestures hash.
   */
  __useGesturesHash : false,


  /**!
   *
   * Called when an event is bubbling to determine whether to discard
   * a gesture from firing.
   *
   * @param element
   * @returns {*}
   * @private
   */
  _filterTouchableElements : function (element) {

    var allowed = Ember.$(element),
      filter = this.get('gestureAllow'),
      exclude = this.get('gestureExclude'),
      viewEl = this.$()[0];

    if (element === viewEl) {
      return element;
    }
    if (filter) {
      allowed = allowed.filter(filter);
    }
    if (exclude) {
      allowed = allowed.not(exclude);
    }
    return allowed.length ? element : false;
  },


  /**!
   *
   */
  __setupGestures : Ember.on('init', function () {

    var EventManager = this.get('eventManager') || this;
    var events;
    var allow;
    var exclude;
    var gestures = this.get('gestures');

    //warn about gestures, remove in 2.0
    Ember.assert(
      'Using the Gestures hash has been deprecated. Set `ENV.mobileTouch.useGesturesHash` to `true` to' +
      ' temporarily allow.', !(!this.get('__useGesturesHash') && !!gestures));

    if (gestures) {
      Ember.Logger.warn('[DEPRECATED] Use of the Gestures hash on views and components will be removed in 2.0');
    }


    //warn about hammerOptions, remove in 2.0
    if (this.get('hammerOptions')) {
      Ember.Logger.warn('[DEAD CODE] Configuring hammerOptions directly on a view or component is no' +
      ' longer allowed.  Use ENV.mobileTouch.options in config/environment.js');
    }


    //warn if hammerAllow is present, remove in 2.0
    allow = this.get('hammerAllow');
    if (allow) {
      Ember.Logger.warn('[DEPRECATED] Use of hammerAllow on views and components will be removed in 2.0.  Use gestureAllow instead.');
      this.gestureAllow = allow;
    }


    //warn if hammerExclude is present, remove in 2.0
    exclude = this.get('hammerExclude');
    if (exclude) {
      Ember.Logger.warn('[DEPRECATED] Use of hammerExclude on views and components will be removed in 2.0.  Use gestureExclude instead.');
      this.gestureExclude = exclude;
    }


    //warn if click is present
    if (EventManager.get('click')) {
      Ember.Logger.warn(
        '[DEPRECATED] Use of click is deprecated in favor of `tap`, Only Tap will trigger and' +
        ' the click handler will overwrite `tap` and then be removed.');

      EventManager.set('tap', EventManager.get('click'));
      delete EventManager['click'];
    }

    if (gestures) {

      events = Ember.keys(gestures);

      //add gesture support for supplied gestures
      events.forEach(function(gesture) {
        EventManager.set(gesture, gestures[gesture]);
        delete gestures[gesture];
      });

    }

  })
});
<commit_msg>Remove deprecation about click handler per @runspired<commit_after>import Ember from 'ember';

export default Ember.Mixin.create({

  /**!
   * Set gestureAllow to a jQuery selector string to optionally specify
   * which child elements should be allowed to trigger a gesture.
   *
   * Can be used in tandem with gestureExclude.
   */
  gestureAllow : null,


  /**!
   * Set gestureExclude to a jQuery selector string to optionally specify
   * which child elements should not be allowed to trigger a gesture.
   *
   * Can be used in tandem with gestureAllow.
   */
  gestureExclude : null,


  /**!
   * @deprecated
   *
   * Maps to ENV.mobileTouch.useGestures; Default is `false`. Keep false
   * to improve performance if your app does not utilize the gestures hash.
   */
  __useGesturesHash : false,


  /**!
   *
   * Called when an event is bubbling to determine whether to discard
   * a gesture from firing.
   *
   * @param element
   * @returns {*}
   * @private
   */
  _filterTouchableElements : function (element) {

    var allowed = Ember.$(element),
      filter = this.get('gestureAllow'),
      exclude = this.get('gestureExclude'),
      viewEl = this.$()[0];

    if (element === viewEl) {
      return element;
    }
    if (filter) {
      allowed = allowed.filter(filter);
    }
    if (exclude) {
      allowed = allowed.not(exclude);
    }
    return allowed.length ? element : false;
  },


  /**!
   *
   */
  __setupGestures : Ember.on('init', function () {

    var EventManager = this.get('eventManager') || this;
    var events;
    var allow;
    var exclude;
    var gestures = this.get('gestures');

    //warn about gestures, remove in 2.0
    Ember.assert(
      'Using the Gestures hash has been deprecated. Set `ENV.mobileTouch.useGesturesHash` to `true` to' +
      ' temporarily allow.', !(!this.get('__useGesturesHash') && !!gestures));

    if (gestures) {
      Ember.Logger.warn('[DEPRECATED] Use of the Gestures hash on views and components will be removed in 2.0');
    }


    //warn about hammerOptions, remove in 2.0
    if (this.get('hammerOptions')) {
      Ember.Logger.warn('[DEAD CODE] Configuring hammerOptions directly on a view or component is no' +
      ' longer allowed.  Use ENV.mobileTouch.options in config/environment.js');
    }


    //warn if hammerAllow is present, remove in 2.0
    allow = this.get('hammerAllow');
    if (allow) {
      Ember.Logger.warn('[DEPRECATED] Use of hammerAllow on views and components will be removed in 2.0.  Use gestureAllow instead.');
      this.gestureAllow = allow;
    }


    //warn if hammerExclude is present, remove in 2.0
    exclude = this.get('hammerExclude');
    if (exclude) {
      Ember.Logger.warn('[DEPRECATED] Use of hammerExclude on views and components will be removed in 2.0.  Use gestureExclude instead.');
      this.gestureExclude = exclude;
    }


    if (EventManager.get('click')) {
      EventManager.set('tap', EventManager.get('click'));
      delete EventManager['click'];
    }

    if (gestures) {

      events = Ember.keys(gestures);

      //add gesture support for supplied gestures
      events.forEach(function(gesture) {
        EventManager.set(gesture, gestures[gesture]);
        delete gestures[gesture];
      });

    }

  })
});

{'fraction_non_alphanumeric': 0.11443375277572168, 'fraction_numerical': 0.0044411547002220575, 'mean_word_length': 2.745011086474501, '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': '1195126', 'n_tokens_mistral': 2087, 'n_tokens_neox': 1969, 'n_words': 637}