<commit_before>function smoothScroll(e) {
  var scrlId = $(this).attr('href'), 
    targetElmPos = $(scrlId).offset().top;

  e.preventDefault();

  $('html,body').animate({
    scrollTop: targetElmPos
  }, 1000);

}

var player;
var tag = document.createElement('script');

tag.src = 'https://www.youtube.com/iframe_api';
var scriptTags = document.getElementsByTagName('script');
var lastScriptTag = scriptTags[scriptTags.length - 1];
lastScriptTag.parentNode.insertBefore(tag, lastScriptTag.nextSibling);

window.onYouTubeIframeAPIReady = function () {
  player = new window.YT.Player('player', {
    height: '390',
    width: '640',
    videoId: 'C7WTDPksvAE'
  });
};

$(function(){
  if(!window.optly.mrkt.isMobile()) {
    window.skrollr.init();
  }

  $('[smooth-scroll]').on('click', smoothScroll);

  $('[data-show-video]').on('click', function() {
    window.optly.mrkt.modal.open({modalType: 'nonprofits-video'});
    var playerInt = window.setInterval(function() {
      if(player.getPlayerState() !== 1) {
        player.playVideo();
      } else {
        window.clearInterval(playerInt);
      }
    }, 10);
  });

  $('[data-optly-modal="nonprofits-video"]').on('click', function() {
    player.stopVideo();
  });

  var orgFormHelperInst = window.optly.mrkt.form.orgForm({formId: 'org-form'});

  var orgForm = new Oform({
    selector: '#org-form'
  });

  orgForm.on('before', function() {
    orgFormHelperInst.processingAdd();
    return true;
  });

  orgForm.on('validationerror', w.optly.mrkt.Oform.validationError);

  orgForm.on('error', function() {
    orgFormHelperInst.processingRemove({callee: 'error'});
    window.analytics.track('signin xhr error', {
      category: 'account',
      label: w.location.pathname
    });
  }.bind());

  orgForm.on('load', orgFormHelperInst.load.bind(orgFormHelperInst));

  orgForm.on('done', function(){
    orgFormHelperInst.processingRemove({callee: 'done'});
  }.bind(orgFormHelperInst));

});<commit_msg>add error message to form helpers<commit_after>function smoothScroll(e) {
  var scrlId = $(this).attr('href'), 
    targetElmPos = $(scrlId).offset().top;

  e.preventDefault();

  $('html,body').animate({
    scrollTop: targetElmPos
  }, 1000);

}

var player;
var tag = document.createElement('script');

tag.src = 'https://www.youtube.com/iframe_api';
var scriptTags = document.getElementsByTagName('script');
var lastScriptTag = scriptTags[scriptTags.length - 1];
lastScriptTag.parentNode.insertBefore(tag, lastScriptTag.nextSibling);

window.onYouTubeIframeAPIReady = function () {
  player = new window.YT.Player('player', {
    height: '390',
    width: '640',
    videoId: 'C7WTDPksvAE'
  });
};

$(function(){
  if(!window.optly.mrkt.isMobile()) {
    window.skrollr.init();
  }

  $('[smooth-scroll]').on('click', smoothScroll);

  $('[data-show-video]').on('click', function() {
    window.optly.mrkt.modal.open({modalType: 'nonprofits-video'});
    var playerInt = window.setInterval(function() {
      if(player.getPlayerState() !== 1) {
        player.playVideo();
      } else {
        window.clearInterval(playerInt);
      }
    }, 10);
  });

  $('[data-optly-modal="nonprofits-video"]').on('click', function() {
    player.stopVideo();
  });

  var orgFormHelperInst = window.optly.mrkt.form.orgForm({formId: 'org-form'});

  var orgForm = new Oform({
    selector: '#org-form'
  });

  orgForm.on('before', function() {
    orgFormHelperInst.processingAdd();
    return true;
  });

  orgForm.on('validationerror', w.optly.mrkt.Oform.validationError);

  orgForm.on('error', function() {
    orgFormHelperInst.processingRemove({callee: 'error'});
    orgFormHelperInst.showOptionsError('Form Response Error');

    window.analytics.track('signin xhr error', {
      category: 'account',
      label: w.location.pathname
    });
  }.bind(orgFormHelperInst));

  orgForm.on('load', orgFormHelperInst.load.bind(orgFormHelperInst));

  orgForm.on('done', function(){
    orgFormHelperInst.processingRemove({callee: 'done'});
  }.bind(orgFormHelperInst));

});
{'fraction_non_alphanumeric': 0.182670945445569, 'fraction_numerical': 0.00740557886941496, 'mean_word_length': 4.135614702154626, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '4322420', 'n_tokens_mistral': 1404, 'n_tokens_neox': 1352, 'n_words': 200}