<commit_before>Factlink.Fact = function() {
  var elements;
  // This is to scare Mark:
  var timeout;
  var highlight_timeout;

  // The balloon which corresponds to this Fact
  var balloon;

  var _obj;
  // For use inside other function scopes
  var self = this;
  // Internal object which will hold all bound event handlers
  var _bound_events = {};
  // If you want to support more events add them to this variable:
  var _events = ["focus", "blur", "click", "update"];

  function initialize(id, elems, opinions) {
    elements = elems;

    _obj = {
      "id": id,
      "opinions": opinions
    };

    createEventHandlers(_events);

    highlight(1500);

    balloon = new Factlink.Balloon(id, self);

    // Bind the own events
    $(elements)
      .bind('mouseenter', self.focus)
      .bind('mouseleave', self.blur)
      .bind('click', self.click);

    bindFocus();

    bindClick(id);
  }

  // This may look like some magic, but here we expose the Fact.blur/focus/click
  // methods
  function createEventHandlers(events) {
    for ( var i = 0; i < events.length; i++ ) {
      _bound_events[events[i]] = [];

      self[events[i]] = (function(i) {
        var e = events[i];

        return function() {
          var args = [e].concat(Array.prototype.slice.call(arguments));

          if ( $.isFunction( args[1] ) ) {
            bind.apply(this, args);
          } else {
            trigger.apply(this, args);<commit_msg>Switcht to new .on notation<commit_after>Factlink.Fact = function() {
  var elements;
  // This is to scare Mark:
  var timeout;
  var highlight_timeout;

  // The balloon which corresponds to this Fact
  var balloon;

  var _obj;
  // For use inside other function scopes
  var self = this;
  // Internal object which will hold all bound event handlers
  var _bound_events = {};
  // If you want to support more events add them to this variable:
  var _events = ["focus", "blur", "click", "update"];

  function initialize(id, elems, opinions) {
    elements = elems;

    _obj = {
      "id": id,
      "opinions": opinions
    };

    createEventHandlers(_events);

    highlight(1500);

    balloon = new Factlink.Balloon(id, self);

    // Bind the own events
    $(elements)
      .on('mouseenter', self.focus)
      .on('mouseleave', self.blur)
      .on('click', self.click)

    bindFocus();

    bindClick(id);
  }

  // This may look like some magic, but here we expose the Fact.blur/focus/click
  // methods
  function createEventHandlers(events) {
    for ( var i = 0; i < events.length; i++ ) {
      _bound_events[events[i]] = [];

      self[events[i]] = (function(i) {
        var e = events[i];

        return function() {
          var args = [e].concat(Array.prototype.slice.call(arguments));

          if ( $.isFunction( args[1] ) ) {
            bind.apply(this, args);
          } else {
            trigger.apply(this, args);
{'fraction_non_alphanumeric': 0.1298791018998273, 'fraction_numerical': 0.004145077720207254, 'mean_word_length': 2.480769230769231, 'pattern_counts': {'":': 4, '<': 5, '<?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': '5086692', 'n_tokens_mistral': 929, 'n_tokens_neox': 868, 'n_words': 269}