<commit_before>/**
 *  Author: <NAME>
 *
 *  Twitter: @drublic
 *  Mail: <EMAIL>
 *
 */
(function () {

  'use strict';

  // Check if we are dealing with mobile
  var isMobile = function () {
    return ( window.innerWidth < 481 );
  };

  // If on mobile, hide address bar
  if (isMobile()) {
    window.setTimeout( function () {
      window.scrollTo(0, 0);
    }, 0);
  }

  // Check if svg capable
  var candoSvg = function () {
    return !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect;
  };

  if (!candoSvg()) {
    document.documentElement.className += ' no-svg';
  }

  /**
   * Menu
   */
  $(document).on('click', '.navigation__toggle', function () {
    $('.navigation').toggleClass('navigation--visible');
  });

  /**
   * Form
   */
  $('.form__nojs').addClass('form__nojs--hidden');

  var resetForm = function ($form) {
    $form[0].reset();
  };

  var errorForm = function ($form, data) {
    $('.contact--thanks__error').show();
    $('.contact--thanks__success').hide();

    $form.find('.form__message').show();

    $('.form__save')
      .attr('disabled', false)
      .val('Submit again');

    $.each(data.FieldErrors, function (element) {
      console.log(element.ErrorText);
    });

    // Normalize Thanks page
    $(document).on('click', '.contact--thanks__back', function () {
      $('.contact--thanks__error').hide();
      $('.contact--thanks__success').show();
    });
  };

  $('.form').submit(function () {
    var $form = $(this);
    var formData = $form.serializeArray();
    var success = true;

    $('.form__save')
      .attr('disabled', true)
      .val('Sending...');

    $.post('?file=form', formData, function (data) {
      if (data.success === 1) {
        resetForm($form);
      } else if (data.ErrorText) {
        errorForm($form, data);
        success = false;
      }
    }, 'json');

    setTimeout(function () {

      // Prevent thanks page from being shown if form is already submitted
      if (success) {
        window.location.hash = 'contact/thanks';
      }
    }, 500);

    return false;
  });
}());<commit_msg>Add parallax scrolling and initialize Hongkong<commit_after>/**
 *  Author: <NAME>
 *
 *  Twitter: @drublic
 *  Mail: <EMAIL>
 *
 */
(function () {

  'use strict';

  // Check if we are dealing with mobile
  var isMobile = function () {
    return ( window.innerWidth < 481 );
  };

  // If on mobile, hide address bar
  if (isMobile()) {
    window.setTimeout( function () {
      window.scrollTo(0, 0);
    }, 0);
  }

  // Check if svg capable
  var candoSvg = function () {
    return !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect;
  };

  if (!candoSvg()) {
    document.documentElement.className += ' no-svg';
  }

  /**
   * Menu
   */
  $(document).on('click', '.navigation__toggle', function () {
    $('.navigation').toggleClass('navigation--visible');
  });

  /**
   * Form
   */
  $('.form__nojs').addClass('form__nojs--hidden');

  var resetForm = function ($form) {
    $form[0].reset();
  };

  var errorForm = function ($form, data) {
    $('.contact--thanks__error').show();
    $('.contact--thanks__success').hide();

    $form.find('.form__message').show();

    $('.form__save')
      .attr('disabled', false)
      .val('Submit again');

    $.each(data.FieldErrors, function (element) {
      console.log(element.ErrorText);
    });

    // Normalize Thanks page
    $(document).on('click', '.contact--thanks__back', function () {
      $('.contact--thanks__error').hide();
      $('.contact--thanks__success').show();
    });
  };

  $('.form').submit(function () {
    var $form = $(this);
    var formData = $form.serializeArray();
    var success = true;

    $('.form__save')
      .attr('disabled', true)
      .val('Sending...');

    $.post('?file=form', formData, function (data) {
      if (data.success === 1) {
        resetForm($form);
      } else if (data.ErrorText) {
        errorForm($form, data);
        success = false;
      }
    }, 'json');

    setTimeout(function () {

      // Prevent thanks page from being shown if form is already submitted
      if (success) {
        window.location.hash = 'contact/thanks';
      }
    }, 500);

    return false;
  });

  // Parallax Scrolling
   $.hongkong();
}());
{'fraction_non_alphanumeric': 0.1958762886597938, 'fraction_numerical': 0.007331042382588774, 'mean_word_length': 2.5816242821985234, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '6460656', 'n_tokens_mistral': 1440, 'n_tokens_neox': 1359, 'n_words': 282}