Sha256: 5285745fefa907c5716d0d7270e414cc049a3627de46bd43d32277008bac0720

Contents?: true

Size: 1.54 KB

Versions: 81

Compression:

Stored size: 1.54 KB

Contents

/*
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);

Version data entries

81 entries across 81 versions & 6 rubygems

Version Path
jinda_lte-0.0.1 lib/generators/jinda_lte/templates/app/assets/jinda_assets/plugins/input-mask/jquery.inputmask.phone.extensions.js
rails_adminlte2-0.2.0 vendor/assets/javascripts/adminlte/plugins/input-mask/jquery.inputmask.phone.extensions.js
rails_adminlte2-0.1.0 vendor/assets/javascripts/adminlte/plugins/input-mask/jquery.inputmask.phone.extensions.js
admin-sys-1.0.2 public/admin/plugins/input-mask/jquery.inputmask.phone.extensions.js
admin-sys-1.0.1 public/admin/plugins/input-mask/jquery.inputmask.phone.extensions.js
adminlte2assets-rails-1.0.1 vendor/assets/javascript/AdminLTE/plugins/input-mask/jquery.inputmask.phone.extensions.js
adminlte2assets-rails-1.0.0 vendor/assets/javascript/AdminLTE/plugins/input-mask/jquery.inputmask.phone.extensions.js
admin-sys-1.0.0 public/admin/plugins/input-mask/jquery.inputmask.phone.extensions.js
adminlte-1.4 vendor/assets/javascripts/plugins/input-mask/jquery.inputmask.phone.extensions.js
roda-component-0.1.73 test/dummy/public/AdminLTE-master/js/plugins/input-mask/jquery.inputmask.phone.extensions.js
roda-component-0.1.72 test/dummy/public/AdminLTE-master/js/plugins/input-mask/jquery.inputmask.phone.extensions.js
roda-component-0.1.71 test/dummy/public/AdminLTE-master/js/plugins/input-mask/jquery.inputmask.phone.extensions.js
roda-component-0.1.70 test/dummy/public/AdminLTE-master/js/plugins/input-mask/jquery.inputmask.phone.extensions.js
roda-component-0.1.69 test/dummy/public/AdminLTE-master/js/plugins/input-mask/jquery.inputmask.phone.extensions.js
roda-component-0.1.68 test/dummy/public/AdminLTE-master/js/plugins/input-mask/jquery.inputmask.phone.extensions.js
roda-component-0.1.67 test/dummy/public/AdminLTE-master/js/plugins/input-mask/jquery.inputmask.phone.extensions.js
roda-component-0.1.66 test/dummy/public/AdminLTE-master/js/plugins/input-mask/jquery.inputmask.phone.extensions.js
roda-component-0.1.65 test/dummy/public/AdminLTE-master/js/plugins/input-mask/jquery.inputmask.phone.extensions.js
roda-component-0.1.64 test/dummy/public/AdminLTE-master/js/plugins/input-mask/jquery.inputmask.phone.extensions.js
roda-component-0.1.63 test/dummy/public/AdminLTE-master/js/plugins/input-mask/jquery.inputmask.phone.extensions.js