<commit_before>/*!
 * Validetta (http://lab.hasanaydogdu.com/validetta/)
 * Version 1.0.1
 * Licensed under MIT (https://github.com/hsnayd/validetta/blob/master/LICENCE)
 * Copyright 2013-2015 <NAME> - http://www.hasanaydogdu.com 
 */
/*eslint-env es6:false*/

(function($) {
  'use strict';
  /**
   *  Declare variables
   */
  var FIELDS = {}; // Current fields/fields
  // RegExp for input validation rules
  var RRULE = new RegExp(/^(minChecked|maxChecked|minSelected|maxSelected|minLength|maxLength|equalTo|different|regExp|remote|callback)\[(\w{1,15})\]/i);
  // RegExp for mail control method
  // @from (http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state-%28type=email%29)
  var RMAIL = new RegExp(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/);
  //RegExp for input number control method
  var RNUMBER = new RegExp(/^[\-\+]?(\d+|\d+\.?\d+)$/);

  /**
   *  Form validate error messages
   */
  var messages = {
    required  : 'This field is required.',
    email     : 'Your E-mail address appears to be invalid.',
    number    : 'You can enter only numbers in this field.',
    maxLength : 'Maximum {count} characters allowed!',
    minLength : 'Minimum {count} characters allowed!',
    maxChecked  : 'Maximum {count} options allowed.',
    minChecked  : 'Please select minimum {count} options.',
    maxSelected : 'Maximum {count} selection allowed.',
    minSelected : 'Minimum {count} selection allowed.',
    notEqual    : 'Fields do not match.',
    different   : 'Fields cannot be the same as each other',
    creditCard  : 'Invalid credit card number.',
  };

  /**
   *  Plugin defaults
   */
  var defaults = {
    showErrorMessages : true, // If you dont want to display error messages set this options false
    inputWrapperClass : 'form-field', // Class of the parent container we want to append the error message to
    errorTemplateClass : 'form-inline-message', // Class of the error message string
    errorClass : 'form-input-error', // Class added to parent of each failing validation field
    validClass : 'form-input-valid', // Same for valid validation
    realTime: false, // To enable real-time form control, set this option true.
    onValid: function(){}, // This function to be called when the user submits the form and there is no error.
    onError: function(){}, // This function to be called when the user submits the form and there are some errors
    validators: {}, // Custom validators stored in this variable
  };

  /**
   * Clears the left and right spaces of given parameter.
   * This is the function for string parameter!
   * If parameter is an array, function will return the untrimmed parameter
   *
   * @param {string} value
   * @return {mixed}
   */
  var trim = function(value) {
    return typeof value === 'string' ? value.replace(/^\s+|\s+$/g, '') : value;
  };

  /**
   * Validator
   * {count} which used below is the specified maximum or minimum value
   * e.g if method is minLength and  rule is 2 (minLength[2])
   * Output error messages text will be : 'Please select minimum 2 options.'
   *<commit_msg>'form-input -> form-field' in default error classes<commit_after>/*!
 * Validetta (http://lab.hasanaydogdu.com/validetta/)
 * Version 1.0.1
 * Licensed under MIT (https://github.com/hsnayd/validetta/blob/master/LICENCE)
 * Copyright 2013-2015 <NAME> - http://www.<EMAIL>
 */
/*eslint-env es6:false*/

(function($) {
  'use strict';
  /**
   *  Declare variables
   */
  var FIELDS = {}; // Current fields/fields
  // RegExp for input validation rules
  var RRULE = new RegExp(/^(minChecked|maxChecked|minSelected|maxSelected|minLength|maxLength|equalTo|different|regExp|remote|callback)\[(\w{1,15})\]/i);
  // RegExp for mail control method
  // @from (http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state-%28type=email%29)
  var RMAIL = new RegExp(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/);
  //RegExp for input number control method
  var RNUMBER = new RegExp(/^[\-\+]?(\d+|\d+\.?\d+)$/);

  /**
   *  Form validate error messages
   */
  var messages = {
    required  : 'This field is required.',
    email     : 'Your E-mail address appears to be invalid.',
    number    : 'You can enter only numbers in this field.',
    maxLength : 'Maximum {count} characters allowed!',
    minLength : 'Minimum {count} characters allowed!',
    maxChecked  : 'Maximum {count} options allowed.',
    minChecked  : 'Please select minimum {count} options.',
    maxSelected : 'Maximum {count} selection allowed.',
    minSelected : 'Minimum {count} selection allowed.',
    notEqual    : 'Fields do not match.',
    different   : 'Fields cannot be the same as each other',
    creditCard  : 'Invalid credit card number.',
  };

  /**
   *  Plugin defaults
   */
  var defaults = {
    showErrorMessages : true, // If you dont want to display error messages set this options false
    inputWrapperClass : 'form-field', // Class of the parent container we want to append the error message to
    errorTemplateClass : 'form-inline-message', // Class of the error message string
    errorClass : 'form-field-invalid', // Class added to parent of each failing validation field
    validClass : 'form-field-valid', // Same for valid validation
    realTime: false, // To enable real-time form control, set this option true.
    onValid: function(){}, // This function to be called when the user submits the form and there is no error.
    onError: function(){}, // This function to be called when the user submits the form and there are some errors
    validators: {}, // Custom validators stored in this variable
  };

  /**
   * Clears the left and right spaces of given parameter.
   * This is the function for string parameter!
   * If parameter is an array, function will return the untrimmed parameter
   *
   * @param {string} value
   * @return {mixed}
   */
  var trim = function(value) {
    return typeof value === 'string' ? value.replace(/^\s+|\s+$/g, '') : value;
  };

  /**
   * Validator
   * {count} which used below is the specified maximum or minimum value
   * e.g if method is minLength and  rule is 2 (minLength[2])
   * Output error messages text will be : 'Please select minimum 2 options.'
   *
{'fraction_non_alphanumeric': 0.14782205746061167, 'fraction_numerical': 0.012974976830398516, 'mean_word_length': 3.1990920881971467, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '2529454', 'n_tokens_mistral': 2075, 'n_tokens_neox': 1995, 'n_words': 643}