<commit_before>---
---
$(function() {
  if (typeof $.fn.toc == 'function') { 
    $('#article-toc').toc({
      'container':'article',
      'scrollToOffset':110,
      'prefix':'toc',
      'anchorName': function(i, heading, prefix) {
        return prefix+i;
    }});
    
    var affix = $('.toc-wrap');
    var width = $('.sidebar').width();
    affix.width(width);
    
    $('.toc-wrap').affix({
      offset: {
        top: $('.toc-wrap').offset().top - 102
      }
    })
  }
  
  $('[data-toggle="tooltip"]').tooltip();

  $('button.ext-sf-opendata').on('click', function(ev) {
    ga('send', 'event', 'Catalog', 'Search', $('#search-catalog .search-input').val(), 1);
  });

  $('a.ext-sf-opendata').on('click', function(ev) {
    ga('send', 'event', 'Catalog', 'Click Link', 'From ' + window.location.pathname, 1)
  });
  
  $('a.take-survey').on('click', function(ev) {
    ga('send', 'event', 'Take Survey', 'Click', 'Link', 1)
  });
  
   $('a.download').on('click', function(ev) {
    ga('send', 'event', 'Download', $(ev.target).data('download-type'), $(ev.target).parent().data('download-name'), 1)
  });
  

  // Set up custom validators to check for gov domains
  jQuery.validator.addMethod("matchGov", function(value, element) {
    return this.optional(element) || /[_a-z0-9-]+(\.[_a-z0-9-]+)*@(sfgov.org|sfmta.com|sfwater.org|sfmta.org|sfdph.org|sfport.com|flysfo.com|sfdpw.org|sfenvironment.org|sfpl.org|dcyf.org|first5sf.org)/.test(value);
  }, "Please enter a valid SFGov email address");

  //Reset validator defaults to integrate with Bootstrap 3 conventions
  $.validator.setDefaults({
    highlight: function(element) {
      $(element).closest('.form-group').addClass('has-error');
    },
    unhighlight: function(element) {
      $(element).closest('.form-group').removeClass('has-error');
    },
    errorElement: 'span',
    errorClass: 'help-block',
    errorPlacement: function(error, element) {
      if (element.parent('.input-group').length) {
        error.insertAfter(element.parent());<commit_msg>add sfcta to whitelist<commit_after>---
---
$(function() {
  if (typeof $.fn.toc == 'function') { 
    $('#article-toc').toc({
      'container':'article',
      'scrollToOffset':110,
      'prefix':'toc',
      'anchorName': function(i, heading, prefix) {
        return prefix+i;
    }});
    
    var affix = $('.toc-wrap');
    var width = $('.sidebar').width();
    affix.width(width);
    
    $('.toc-wrap').affix({
      offset: {
        top: $('.toc-wrap').offset().top - 102
      }
    })
  }
  
  $('[data-toggle="tooltip"]').tooltip();

  $('button.ext-sf-opendata').on('click', function(ev) {
    ga('send', 'event', 'Catalog', 'Search', $('#search-catalog .search-input').val(), 1);
  });

  $('a.ext-sf-opendata').on('click', function(ev) {
    ga('send', 'event', 'Catalog', 'Click Link', 'From ' + window.location.pathname, 1)
  });
  
  $('a.take-survey').on('click', function(ev) {
    ga('send', 'event', 'Take Survey', 'Click', 'Link', 1)
  });
  
   $('a.download').on('click', function(ev) {
    ga('send', 'event', 'Download', $(ev.target).data('download-type'), $(ev.target).parent().data('download-name'), 1)
  });
  

  // Set up custom validators to check for gov domains
  jQuery.validator.addMethod("matchGov", function(value, element) {
    return this.optional(element) || /[_a-z0-9-]+(\.[_a-z0-9-]+)*@(sfgov.org|sfmta.com|sfwater.org|sfmta.org|sfdph.org|sfport.com|flysfo.com|sfdpw.org|sfenvironment.org|sfpl.org|dcyf.org|first5sf.org|sfcta.org)/.test(value);
  }, "Please enter a valid SFGov email address");

  //Reset validator defaults to integrate with Bootstrap 3 conventions
  $.validator.setDefaults({
    highlight: function(element) {
      $(element).closest('.form-group').addClass('has-error');
    },
    unhighlight: function(element) {
      $(element).closest('.form-group').removeClass('has-error');
    },
    errorElement: 'span',
    errorClass: 'help-block',
    errorPlacement: function(error, element) {
      if (element.parent('.input-group').length) {
        error.insertAfter(element.parent());
{'fraction_non_alphanumeric': 0.22650720039052966, 'fraction_numerical': 0.007810593116914816, 'mean_word_length': 3.439869989165764, 'pattern_counts': {'":': 0, '<': 3, '<?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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6132028', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1400, 'n_words': 228}