X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fpybind%2Fmgr%2Fdashboard%2Fstatic%2FAdminLTE-2.3.7%2Fplugins%2Finput-mask%2Fjquery.inputmask.phone.extensions.js;fp=src%2Fceph%2Fsrc%2Fpybind%2Fmgr%2Fdashboard%2Fstatic%2FAdminLTE-2.3.7%2Fplugins%2Finput-mask%2Fjquery.inputmask.phone.extensions.js;h=554d4ef14f86abfbc0b2a09d961ba5c6c7f6dc2b;hb=812ff6ca9fcd3e629e49d4328905f33eee8ca3f5;hp=0000000000000000000000000000000000000000;hpb=15280273faafb77777eab341909a3f495cf248d9;p=stor4nfv.git diff --git a/src/ceph/src/pybind/mgr/dashboard/static/AdminLTE-2.3.7/plugins/input-mask/jquery.inputmask.phone.extensions.js b/src/ceph/src/pybind/mgr/dashboard/static/AdminLTE-2.3.7/plugins/input-mask/jquery.inputmask.phone.extensions.js new file mode 100644 index 0000000..554d4ef --- /dev/null +++ b/src/ceph/src/pybind/mgr/dashboard/static/AdminLTE-2.3.7/plugins/input-mask/jquery.inputmask.phone.extensions.js @@ -0,0 +1,50 @@ +/* +Input Mask plugin extensions +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: 0.0.0 + +Phone extension. +When using this extension make sure you specify the correct url to get the masks + + $(selector).inputmask("phone", { + url: "Scripts/jquery.inputmask/phone-codes/phone-codes.json", + onKeyValidation: function () { //show some metadata in the console + console.log($(this).inputmask("getmetadata")["name_en"]); + } + }); + + +*/ +(function ($) { + $.extend($.inputmask.defaults.aliases, { + 'phone': { + url: "phone-codes/phone-codes.json", + mask: function (opts) { + opts.definitions = { + 'p': { + validator: function () { return false; }, + cardinality: 1 + }, + '#': { + validator: "[0-9]", + cardinality: 1 + } + }; + var maskList = []; + $.ajax({ + url: opts.url, + async: false, + dataType: 'json', + success: function (response) { + maskList = response; + } + }); + + maskList.splice(0, 0, "+p(ppp)ppp-pppp"); + return maskList; + } + } + }); +})(jQuery);