<commit_before>/*!
 * tipso - A Lightweight Responsive jQuery Tooltip Plugin v1.0.5
 * Copyright (c) 2014-2015 <NAME>
 * http://tipso.object505.com
 * Licensed under the MIT license
 * http://object505.mit-license.org/
 */
;(function($, window, document, undefined) {
  var pluginName = "tipso",
    defaults = {
      speed           : 400,
      background      : '#55b555',
      color           : '#ffffff',
      position        : 'top',
      width           : 200,
      maxWidth        : '',
      delay           : 200,
      animationIn     : '',
      animationOut    : '',
      offsetX         : 0,
      offsetY         : 0,
      tooltipHover    : false,
      content         : null,
      ajaxContentUrl  : null,
      useTitle        : true,
      onBeforeShow    : null,
      onShow          : null,
      onHide          : null
    };

  function Plugin(element, options) {
    this.element = $(element);
    this.doc = $(document);
    this.win = $(window);
    this.settings = $.extend({}, defaults, options);
    this._defaults = defaults;
    this._name = pluginName;
    this._title = this.element.attr('title');
    this.mode = 'hide';
    this.ieFade = !supportsTransitions;

    this.init();
  }
  $.extend(Plugin.prototype, {
    init: function() {
      var obj = this,
        $e = this.element,
        $doc = this.doc;
      $e.addClass('tipso_style').removeAttr('title');
      if (isTouchSupported()) {
        $e.on('click' + '.' + pluginName, function(e) {
          obj.mode == 'hide' ? obj.show() : obj.hide();
          e.stopPropagation();
        });
        $doc.on('click', function closeTipso () {
          if (obj.mode == 'show') {
            obj.hide();
          }
        });
      } else {
        if (obj.settings.tooltipHover) {
          var waitForHover = null,
              hoverHelper = null;
          $e.on('mouseover' + '.' + pluginName, function() {
            clearTimeout(waitForHover);
            clearTimeout(hoverHelper);
            hoverHelper = setTimeout(function(){
              obj.show();
            }, 150);            
          });
          $e.on('mouseout' + '.' + pluginName, function() {            
            clearTimeout(waitForHover);
            clearTimeout(hoverHelper);
            waitForHover = setTimeout(function(){              
              obj.hide(); 
            }, 200);     

            $(obj.tooltip()).on('mouseover' + '.' + pluginName, function() {
              obj.mode = 'tooltipHover';
            });  
            $(obj.tooltip()).on('mouseout' + '.' + pluginName, function() {
              obj.mode = 'show';
              clearTimeout(waitForHover);
              waitForHover = setTimeout(function(){              
                obj.hide();
              }, 200);
            });       
          });
        } else {
          $e.on('mouseover' + '.' + pluginName, function() {
            obj.show();
          });
          $e.on('mouseout' + '.' + pluginName, function() {
            obj.hide();
          });
        }
      }
    },
    tooltip: function() {
      if (!this.tipso_bubble) {
        this.tipso_bubble = $(
          '<div class="tipso_bubble"><div class="tipso_content"></div><div class="tipso_arrow"></div></div>'
        );
      }
      return this.tipso_bubble;
    },
    show: function() {
      var tipso_bubble = this.tooltip(),
        obj = this,<commit_msg>Optimization. Taking advantage of jQuery caining on tipso tooltip<commit_after>/*!
 * tipso - A Lightweight Responsive jQuery Tooltip Plugin v1.0.5
 * Copyright (c) 2014-2015 <NAME>
 * http://tipso.object505.com
 * Licensed under the MIT license
 * http://object505.mit-license.org/
 */
;(function($, window, document, undefined) {
  var pluginName = "tipso",
    defaults = {
      speed           : 400,
      background      : '#55b555',
      color           : '#ffffff',
      position        : 'top',
      width           : 200,
      maxWidth        : '',
      delay           : 200,
      animationIn     : '',
      animationOut    : '',
      offsetX         : 0,
      offsetY         : 0,
      tooltipHover    : false,
      content         : null,
      ajaxContentUrl  : null,
      useTitle        : true,
      onBeforeShow    : null,
      onShow          : null,
      onHide          : null
    };

  function Plugin(element, options) {
    this.element = $(element);
    this.doc = $(document);
    this.win = $(window);
    this.settings = $.extend({}, defaults, options);
    this._defaults = defaults;
    this._name = pluginName;
    this._title = this.element.attr('title');
    this.mode = 'hide';
    this.ieFade = !supportsTransitions;

    this.init();
  }
  $.extend(Plugin.prototype, {
    init: function() {
      var obj = this,
        $e = this.element,
        $doc = this.doc;
      $e.addClass('tipso_style').removeAttr('title');
      if (isTouchSupported()) {
        $e.on('click' + '.' + pluginName, function(e) {
          obj.mode == 'hide' ? obj.show() : obj.hide();
          e.stopPropagation();
        });
        $doc.on('click', function closeTipso () {
          if (obj.mode == 'show') {
            obj.hide();
          }
        });
      } else {
        if (obj.settings.tooltipHover) {
          var waitForHover = null,
              hoverHelper = null;
          $e.on('mouseover' + '.' + pluginName, function() {
            clearTimeout(waitForHover);
            clearTimeout(hoverHelper);
            hoverHelper = setTimeout(function(){
              obj.show();
            }, 150);            
          });
          $e.on('mouseout' + '.' + pluginName, function() {            
            clearTimeout(waitForHover);
            clearTimeout(hoverHelper);
            waitForHover = setTimeout(function(){              
              obj.hide(); 
            }, 200);     

            obj.tooltip()
              .on('mouseover' + '.' + pluginName, function() {
                obj.mode = 'tooltipHover';
              })
              .on('mouseout' + '.' + pluginName, function() {
                obj.mode = 'show';
                clearTimeout(waitForHover);
                waitForHover = setTimeout(function(){
                  obj.hide();
                }, 200);
              })
          ;
          });
        } else {
          $e.on('mouseover' + '.' + pluginName, function() {
            obj.show();
          });
          $e.on('mouseout' + '.' + pluginName, function() {
            obj.hide();
          });
        }
      }
    },
    tooltip: function() {
      if (!this.tipso_bubble) {
        this.tipso_bubble = $(
          '<div class="tipso_bubble"><div class="tipso_content"></div><div class="tipso_arrow"></div></div>'
        );
      }
      return this.tipso_bubble;
    },
    show: function() {
      var tipso_bubble = this.tooltip(),
        obj = this,
{'fraction_non_alphanumeric': 0.14862705215748948, 'fraction_numerical': 0.01220398082231585, 'mean_word_length': 1.510576221735959, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '7338664', 'n_tokens_mistral': 2048, 'n_tokens_neox': 1959, 'n_words': 370}