<commit_before>window.UAAccount = 'UA-331614-1'
# Use GA test account for dev and test instances
if $("body.test, body.development, body.staging").length
  window.UAAccount = 'UA-19475063-1'

window._gaq = []
_gaq.push(['_setAccount', UAAccount])
_gaq.push(['_setDomainName', '.malmo.se'])

(->
  ga = document.createElement('script')
  ga.type = 'text/javascript'
  ga.async = true
  ga.src = (if 'https:' is document.location.protocol then 'https://ssl' else 'http://www') + '.google-analytics.com/ga.js'
  s = document.getElementsByTagName('script')[0]
  s.parentNode.insertBefore(ga, s)
  return
)()

jQuery ($) ->
  # Delay click events so GA has time to collect data before executed
  window.gaDelayEvent = ($a, event) ->
    if !event.isDefaultPrevented() and !$a.attr('target') and !$a.attr('onclick')
      event.preventDefault()
      setTimeout('document.location = "' + $a.attr('href') + '"', 100)

  # Check if a custom URI is defined on the Sitevision page
  if typeof currentURI is "string"
    _gaq.push(['_trackPageview', currentURI + document.location.search])
  else
    _gaq.push(['_trackPageview'])

  # Track outgoing links as regular page views
  $("a[href^='http://'], a[href^='https://']").click (event) ->
    $a = $(@)
    # Don't hijack href's in search results and URL's to malmo.se apps
    if $a.parents('div.search').length is 0 and !$a.attr('href').match(/.malmo\.se\//)
      _gaq.push(['_trackPageview', 'ExternalLink ' + $a.attr("href")])
      gaDelayEvent($a, event)

  # Track file downloads
  fileTypes = ['doc', 'docx', 'xls','xlsx', 'ppt', 'pptx', 'pdf', 'zip']
  $('a').each () ->
    $a = $(@)
    href = $a.attr('href')
    if typeof href is "string"
      href = href.split('.').pop()
      extension  = href.split('#').shift(); # pdf files has an # in the search results

      if $.inArray(extension, fileTypes) isnt -1
        $a.click (event) ->
          link = $(this).attr("href")
          _gaq.push(['_trackPageview', 'FileDownload ' + link])
          gaDelayEvent($a, event)
<commit_msg>Added prototype to body class names for strap<commit_after>window.UAAccount = 'UA-331614-1'
# Use GA test account for dev and test instances
if $("body.test, body.development, body.staging, body.prototype").length
  window.UAAccount = 'UA-19475063-1'

window._gaq = []
_gaq.push(['_setAccount', UAAccount])
_gaq.push(['_setDomainName', '.malmo.se'])

(->
  ga = document.createElement('script')
  ga.type = 'text/javascript'
  ga.async = true
  ga.src = (if 'https:' is document.location.protocol then 'https://ssl' else 'http://www') + '.google-analytics.com/ga.js'
  s = document.getElementsByTagName('script')[0]
  s.parentNode.insertBefore(ga, s)
  return
)()

jQuery ($) ->
  # Delay click events so GA has time to collect data before executed
  window.gaDelayEvent = ($a, event) ->
    if !event.isDefaultPrevented() and !$a.attr('target') and !$a.attr('onclick')
      event.preventDefault()
      setTimeout('document.location = "' + $a.attr('href') + '"', 100)

  # Check if a custom URI is defined on the Sitevision page
  if typeof currentURI is "string"
    _gaq.push(['_trackPageview', currentURI + document.location.search])
  else
    _gaq.push(['_trackPageview'])

  # Track outgoing links as regular page views
  $("a[href^='http://'], a[href^='https://']").click (event) ->
    $a = $(@)
    # Don't hijack href's in search results and URL's to malmo.se apps
    if $a.parents('div.search').length is 0 and !$a.attr('href').match(/.malmo\.se\//)
      _gaq.push(['_trackPageview', 'ExternalLink ' + $a.attr("href")])
      gaDelayEvent($a, event)

  # Track file downloads
  fileTypes = ['doc', 'docx', 'xls','xlsx', 'ppt', 'pptx', 'pdf', 'zip']
  $('a').each () ->
    $a = $(@)
    href = $a.attr('href')
    if typeof href is "string"
      href = href.split('.').pop()
      extension  = href.split('#').shift(); # pdf files has an # in the search results

      if $.inArray(extension, fileTypes) isnt -1
        $a.click (event) ->
          link = $(this).attr("href")
          _gaq.push(['_trackPageview', 'FileDownload ' + link])
          gaDelayEvent($a, event)

{'fraction_non_alphanumeric': 0.18568665377176016, 'fraction_numerical': 0.010638297872340425, 'mean_word_length': 3.4579741379310347, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6881817', 'n_tokens_mistral': 1451, 'n_tokens_neox': 1407, 'n_words': 346}