<commit_before>//= require jquery
//= require jquery_ujs
//= require jquery.cookie
//= require lodash
//= require is
//= require bootstrap
//= require rails.validations
//= require rails.validations.simple_form
//
//= require_tree ./init
//
//= require_self

var is = require('is')
var _  = require('lodash')

track = function(event, attributes, fn){
  console.log("Track: " + event + " " + JSON.stringify(attributes))

  if (is.fn(attributes)) fn = attributes, attributes = null;
  if (is.undefined(attributes)) { attributes = {} }
  if ($.cookie('invisible') == "true") {
    if (!is.undefined(fn)) { fn() }
    return
  }

  if (typeof(analytics) == 'undefined') {
    return
  }

  attrs = _.extend({
    iteration: '<%= MVP::Iteration.version %>'
  }, attributes)

  analytics.track(event, attrs, fn)
}

setupAutomaticTracing = function(){
  _.each(arguments, function(e){
    switch (e.toLowerCase()) {
      case 'buttons':
        $('.btn').on('click', function(){
          window.track("Button Clicked", { name: $(this).text() || $(this).attr('value') })
        })

        $('a:not(.btn)').on('click', function(){
          window.track("Link Clicked", { name: ($(this).text() || $(this).attr('value')) })
        })
        break;
    }<commit_msg>switch to links<commit_after>//= require jquery
//= require jquery_ujs
//= require jquery.cookie
//= require lodash
//= require is
//= require bootstrap
//= require rails.validations
//= require rails.validations.simple_form
//
//= require_tree ./init
//
//= require_self

var is = require('is')
var _  = require('lodash')

track = function(event, attributes, fn){
  console.log("Track: " + event + " " + JSON.stringify(attributes))

  if (is.fn(attributes)) fn = attributes, attributes = null;
  if (is.undefined(attributes)) { attributes = {} }
  if ($.cookie('invisible') == "true") {
    if (!is.undefined(fn)) { fn() }
    return
  }

  if (typeof(analytics) == 'undefined') {
    return
  }

  attrs = _.extend({
    iteration: '<%= MVP::Iteration.version %>'
  }, attributes)

  analytics.track(event, attrs, fn)
}

setupAutomaticTracing = function(){
  _.each(arguments, function(e){
    switch (e.toLowerCase()) {
      case 'buttons':
        $('.btn').on('click', function(){
          window.track("Button Clicked", { name: $(this).text() || $(this).attr('value') })
        })
        break;
      case 'links':
        $('a:not(.btn)').on('click', function(){
          window.track("Link Clicked", { name: ($(this).text() || $(this).attr('value')) })
        })
        break;
    }
{'fraction_non_alphanumeric': 0.2032838154808444, 'fraction_numerical': 0.0, 'mean_word_length': 3.068362480127186, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6646880', 'n_tokens_mistral': 830, 'n_tokens_neox': 807, 'n_words': 171}