<commit_before>/**
  Used for tracking when the user clicks on a link

  @class ClickTrack
  @namespace Discourse
  @module Discourse
**/
Discourse.ClickTrack = {

  /**
    Track a click on a link

    @method trackClick
    @param {jQuery.Event} e The click event that occurred
  **/
  trackClick: function(e) {
    var $link = $(e.currentTarget);
    if ($link.hasClass('lightbox')) return true;

    e.preventDefault();

    // We don't track clicks on quote back buttons
    if ($link.hasClass('back') || $link.hasClass('quote-other-topic')) return true;

    // We don't track clicks in oneboxes
    // except when we force it with the "track-link" class
    if ($link.closest('.onebox-result').length > 0 && !$link.hasClass('track-link')) return true;

    // Remove the href, put it as a data attribute
    if (!$link.data('href')) {
      $link.addClass('no-href');
      $link.data('href', $link.attr('href'));
      $link.attr('href', null);
      // Don't route to this URL
      $link.data('auto-route', true);
    }
<commit_msg>thinking about it .. WE ALWAYS track external links. WE DON'T display external link counts inside oneboxes.<commit_after>/**
  Used for tracking when the user clicks on a link

  @class ClickTrack
  @namespace Discourse
  @module Discourse
**/
Discourse.ClickTrack = {

  /**
    Track a click on a link

    @method trackClick
    @param {jQuery.Event} e The click event that occurred
  **/
  trackClick: function(e) {
    var $link = $(e.currentTarget);
    if ($link.hasClass('lightbox')) return true;

    e.preventDefault();

    // We don't track clicks on quote back buttons
    if ($link.hasClass('back') || $link.hasClass('quote-other-topic')) return true;

    // Remove the href, put it as a data attribute
    if (!$link.data('href')) {
      $link.addClass('no-href');
      $link.data('href', $link.attr('href'));
      $link.attr('href', null);
      // Don't route to this URL
      $link.data('auto-route', true);
    }

{'fraction_non_alphanumeric': 0.14754926730672058, 'fraction_numerical': 0.0005053057099545225, 'mean_word_length': 2.9759036144578315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '3869240', 'n_tokens_mistral': 618, 'n_tokens_neox': 596, 'n_words': 196}