Skip to content

Instantly share code, notes, and snippets.

@maximilianoraul
Last active July 28, 2021 12:21
Show Gist options
  • Save maximilianoraul/2a7ddd1f1cfe61d7ebcdd69bf695f0b9 to your computer and use it in GitHub Desktop.
Save maximilianoraul/2a7ddd1f1cfe61d7ebcdd69bf695f0b9 to your computer and use it in GitHub Desktop.
$.jMaskGlobals = {
maskElements: 'input,td,span,div',
dataMaskAttr: '*[data-mask]',
dataMask: true,
watchInterval: 300,
watchInputs: true,
watchDataMask: false,
byPassKeys: [9, 16, 17, 18, 36, 37, 38, 39, 40, 91],
translation: {
'0': {pattern: /\d/},
'9': {pattern: /\d/, optional: true},
'#': {pattern: /\d/, recursive: true},
'A': {pattern: /[0-9zZ]/},
'S': {pattern: /[a-zA-Z]/},
'T': {pattern: /[0-9zZ]/},
}
};
console.log($.jMaskGlobals);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment