|
@@ -3,7 +3,7 @@
|
|
|
* http://github.com/RobinHerbots/jquery.inputmask
|
|
* http://github.com/RobinHerbots/jquery.inputmask
|
|
|
* Copyright (c) 2010 - 2013 Robin Herbots
|
|
* Copyright (c) 2010 - 2013 Robin Herbots
|
|
|
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
|
-* Version: 2.2.13
|
|
|
|
|
|
|
+* Version: 2.2.14
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
(function ($) {
|
|
(function ($) {
|
|
@@ -1348,7 +1348,7 @@ Input Mask plugin extensions
|
|
|
http://github.com/RobinHerbots/jquery.inputmask
|
|
http://github.com/RobinHerbots/jquery.inputmask
|
|
|
Copyright (c) 2010 - 2013 Robin Herbots
|
|
Copyright (c) 2010 - 2013 Robin Herbots
|
|
|
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
|
-Version: 2.2.13
|
|
|
|
|
|
|
+Version: 2.2.14
|
|
|
|
|
|
|
|
Optional extensions on the jquery.inputmask base
|
|
Optional extensions on the jquery.inputmask base
|
|
|
*/
|
|
*/
|
|
@@ -1445,7 +1445,7 @@ Input Mask plugin extensions
|
|
|
http://github.com/RobinHerbots/jquery.inputmask
|
|
http://github.com/RobinHerbots/jquery.inputmask
|
|
|
Copyright (c) 2010 - 2012 Robin Herbots
|
|
Copyright (c) 2010 - 2012 Robin Herbots
|
|
|
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
|
-Version: 2.2.13
|
|
|
|
|
|
|
+Version: 2.2.14
|
|
|
|
|
|
|
|
Optional extensions on the jquery.inputmask base
|
|
Optional extensions on the jquery.inputmask base
|
|
|
*/
|
|
*/
|
|
@@ -1938,7 +1938,7 @@ Input Mask plugin extensions
|
|
|
http://github.com/RobinHerbots/jquery.inputmask
|
|
http://github.com/RobinHerbots/jquery.inputmask
|
|
|
Copyright (c) 2010 - 2013 Robin Herbots
|
|
Copyright (c) 2010 - 2013 Robin Herbots
|
|
|
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
|
-Version: 2.2.13
|
|
|
|
|
|
|
+Version: 2.2.14
|
|
|
|
|
|
|
|
Optional extensions on the jquery.inputmask base
|
|
Optional extensions on the jquery.inputmask base
|
|
|
*/
|
|
*/
|
|
@@ -2108,3 +2108,56 @@ Optional extensions on the jquery.inputmask base
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
})(jQuery);
|
|
})(jQuery);
|
|
|
|
|
+/*
|
|
|
|
|
+Input Mask plugin extensions
|
|
|
|
|
+http://github.com/RobinHerbots/jquery.inputmask
|
|
|
|
|
+Copyright (c) 2010 - 2013 Robin Herbots
|
|
|
|
|
+Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
|
|
|
+Version: 2.2.14
|
|
|
|
|
+
|
|
|
|
|
+Regex extensions on the jquery.inputmask base
|
|
|
|
|
+Allows for using regular expressions as a mask
|
|
|
|
|
+*/
|
|
|
|
|
+(function ($) {
|
|
|
|
|
+ $.extend($.inputmask.defaults.aliases, { // $(selector).inputmask("Regex", { regex: "[0-9]*"}
|
|
|
|
|
+ 'Regex': {
|
|
|
|
|
+ mask: "r",
|
|
|
|
|
+ greedy: false,
|
|
|
|
|
+ repeat: 10, //needs to be computed
|
|
|
|
|
+ regex: null,
|
|
|
|
|
+ regexSplit: null,
|
|
|
|
|
+ definitions: {
|
|
|
|
|
+ 'r': {
|
|
|
|
|
+ validator: function (chrs, buffer, pos, strict, opts) {
|
|
|
|
|
+
|
|
|
|
|
+ function analyseRegex() { //ENHANCE ME
|
|
|
|
|
+ opts.regexSplit = [];
|
|
|
|
|
+ if (opts.regex.indexOf("*") != (opts.regex.length - 1)) {
|
|
|
|
|
+ opts.regex += "{1}";
|
|
|
|
|
+ }
|
|
|
|
|
+ opts.regexSplit.push(opts.regex);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (opts.regexSplit == null) {
|
|
|
|
|
+ analyseRegex();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var cbuffer = buffer.slice(), regexPart = "", isValid = false;
|
|
|
|
|
+ cbuffer.splice(pos, 0, chrs);
|
|
|
|
|
+ var bufferStr = cbuffer.join('');
|
|
|
|
|
+ for (var i = 0; i < opts.regexSplit.length; i++) {
|
|
|
|
|
+ regexPart += opts.regexSplit[i];
|
|
|
|
|
+ var exp = new RegExp("^" + regexPart + "$");
|
|
|
|
|
+ isValid = exp.test(bufferStr);
|
|
|
|
|
+ console.log(bufferStr + ' ' + isValid);
|
|
|
|
|
+ if (isValid) break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return isValid;
|
|
|
|
|
+ },
|
|
|
|
|
+ cardinality: 1
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+})(jQuery);
|