|
|
@@ -3,7 +3,7 @@
|
|
|
* http://github.com/RobinHerbots/jquery.inputmask
|
|
|
* Copyright (c) 2010 - 2014 Robin Herbots
|
|
|
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
|
-* Version: 3.1.32
|
|
|
+* Version: 3.1.33
|
|
|
*/
|
|
|
!function(factory) {
|
|
|
"function" == typeof define && define.amd ? define([ "jquery", "./jquery.inputmask" ], factory) : factory(jQuery);
|
|
|
@@ -12,6 +12,7 @@
|
|
|
phone: {
|
|
|
url: "phone-codes/phone-codes.js",
|
|
|
maskInit: "+pp(pp)pppppppp",
|
|
|
+ countrycode: "",
|
|
|
mask: function(opts) {
|
|
|
opts.definitions = {
|
|
|
p: {
|
|
|
@@ -32,24 +33,28 @@
|
|
|
dataType: "json",
|
|
|
success: function(response) {
|
|
|
maskList = response;
|
|
|
+ },
|
|
|
+ error: function(xhr, ajaxOptions, thrownError) {
|
|
|
+ alert(thrownError + " - " + opts.url);
|
|
|
}
|
|
|
}), maskList = maskList.sort(function(a, b) {
|
|
|
return (a.mask || a) < (b.mask || b) ? -1 : 1;
|
|
|
- }), maskList.splice(0, 0, opts.maskInit), maskList;
|
|
|
+ }), "" != opts.countrycode && (opts.maskInit = "+" + opts.countrycode + opts.maskInit.substring(3)),
|
|
|
+ maskList.splice(0, 0, opts.maskInit), maskList;
|
|
|
},
|
|
|
nojumps: !0,
|
|
|
- nojumpsThreshold: 1
|
|
|
+ nojumpsThreshold: 1,
|
|
|
+ onBeforeMask: function(value, opts) {
|
|
|
+ var processedValue = value.replace(/^0/g, "");
|
|
|
+ return (processedValue.indexOf(opts.countrycode) > 1 || -1 == processedValue.indexOf(opts.countrycode)) && (processedValue = opts.countrycode + processedValue),
|
|
|
+ processedValue;
|
|
|
+ }
|
|
|
},
|
|
|
phonebe: {
|
|
|
alias: "phone",
|
|
|
url: "phone-codes/phone-be.js",
|
|
|
- maskInit: "+32(pp)pppppppp",
|
|
|
- nojumpsThreshold: 4,
|
|
|
- onBeforeMask: function(value) {
|
|
|
- var processedValue = value.replace(/^0/g, "");
|
|
|
- return (processedValue.indexOf("32") > 1 || -1 == processedValue.indexOf("32")) && (processedValue = "32" + processedValue),
|
|
|
- processedValue;
|
|
|
- }
|
|
|
+ countrycode: "32",
|
|
|
+ nojumpsThreshold: 4
|
|
|
}
|
|
|
}), $.fn.inputmask;
|
|
|
});
|