This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html ng-app> | |
<head> | |
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" type="text/css" /> | |
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script> | |
<meta charset="utf-8"> | |
<title>Tess</title> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery("form#adminForm, form#userForm").on("submit", function(event) { | |
var isTva = true; | |
var inputsTva = jQuery('form#adminForm #pluginistraxx_euvatchecker_field'); | |
// define reg part, each country code has match different quantifier | |
// for example, GB matches the characters GB literally (case sensitive), matches a digit 0-9, Matches exactly 5 times | |
var regTva = /^(RO\d{2,10}|GB\d{5}|GBGD\d{3}|CHE\d{9}|CZ\d{8,10}|(ATU|DK|FI|HU|LU|MT|SI)\d{8}|IE[A-Z\d]{8}|(DE|BG|EE|EL|LT|BE0|PT)\d{9}|CY\d{8}[A-Z]|(ES|GB)[A-Z\d]{9}|(BE0|PL|SK|RU)\d{10}|(FR|IT|LV)\d{11}|(LT|SE)\d{12}|(NL|GB)[A-Z\d]{12})$;/g; | |
//bind each related tva input, if not pass reg, return false | |
jQuery.each(inputsTva, function(){ | |
if(!regTva.test(jQuery(this).val())) { | |
isTva = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.validator.addMethod( "forValidPhone", function( value, element ) { | |
return this.optional( element ) || /^\((\d{3})\)[- ]?(\d{3})[- ]?(\d{4})$/i.test( value ); | |
}, "please enter the correct phone format" ); | |
$.validator.addMethod( "forValidSsn", function( value, element ) { | |
return this.optional( element ) || /^(\d{3}-\d{2}-\d{4})$/i.test( value ); | |
}, "please enter the correct ssn format" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isAmexNotSupported(type) { | |
var selectedCountryCode = $('#selected-country').parents('.dr_inputBox').find('li.active').data('country-code'); | |
var notAllowedCountries = ['AFG', 'ARG', 'BRA', 'COG', 'CIV', 'GNQ','ERI','FLK','GLP','GNB','IND','IRQ','LAO','LBY','MEX','MMR','SHN','STP','TUV' ]; | |
var AmexNotSupportedCountries = notAllowedCountries.concat(AmexNotSupportedCountries); | |
if(AmexNotSupportedCountries) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.validator.addMethod('supportSpecialCharEmail', function(value) { | |
var specialCharacter = 'ÀÈÌÒÙàèìòùÁÉÍÓÚÝáéíóúýÂÊÎÔÛâêîôûÃÑÕãñõÄËÏÖÜäëïöüąçÇßØÖÜåÆæÞþÐð¡а-яА-ЯёЁ©°\u0100-\u024F\u2E80-\u9FFF\u1100-\u11FF\uAC00-\uD7AF\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\uFB50-\uFC3F\uFE70-\uFEFC\u0600-\u06FF\u0750-\u077F\uFB50-\uFC3F\uFE70-\uFEFC'; | |
var specialSymbol = "!?#\$%\^\&*\)\(+=_.-"; | |
var localPattern = "[a-zA-Z0-9" + specialCharacter + specialSymbol +"]+"; | |
var domainPattern = '[a-zA-Z0-9' + specialCharacter + '](?:[a-zA-Z0-9-' + specialCharacter +']{0,61}[a-zA-Z0-9])?'; | |
var extensionPattern = '[A-Za-z]{2,10}'; | |
var pattern = new RegExp( '^' + localPattern + '@' + domainPattern + '[.]' + extensionPattern + '$'); | |
if (pattern.test($.trim(value))) { | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
var gruntConfig, | |
taskConfigs; | |
// set up a configuration | |
gruntConfig = { | |
qunit : { | |
files: 'local-testing/tests/*.html' | |
} | |
}; | |
}; |