Skip to content

Commit

Permalink
Send to bower
Browse files Browse the repository at this point in the history
  • Loading branch information
wbruno committed Mar 17, 2016
1 parent 6416b91 commit fd23c0d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 10 deletions.
25 changes: 25 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "jquery.maskx",
"homepage": "https://github.com/wbruno/jquery.maskx",
"authors": [
"William Bruno <[email protected]>"
],
"description": "jQuery Plugin and Function mask for inputs and texts",
"main": "src/jquery.maskx.js",
"moduleType": [],
"keywords": [
"jquery",
"mask",
"regex",
"input",
"text",
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />


<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.0.0.min.js"></script>
<script type="text/javascript" src="src/jquery.maskx.js"></script>

<script type="text/javascript">
Expand Down Expand Up @@ -46,6 +45,10 @@
};

jQuery(document).ready(function(){

console.log(jQuery.maskx.user_defined('05570060'));


jQuery('.cartoes').maskx({maskx: 'cc'});//pela class

jQuery('#input_dinheiro').maskx({maskx: 'money'});//pelo id
Expand Down
4 changes: 2 additions & 2 deletions maskx.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"input",
"maskx"
],
"version": "0.1.7",
"version": "0.2.0",
"author": {
"name": "William Bruno",
"url": "https://github.com/wbruno"
Expand All @@ -33,4 +33,4 @@
"dependencies": {
"jquery": ">=1.4.2"
}
}
}
14 changes: 8 additions & 6 deletions src/jquery.maskx.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @use jQuery('$input[name="cc"]').maskx({maskx: 'cc'});
*/
; (function () {
; (function ($) {
'use strict';
/*global nomen:true, jQuery: false, setTimeout:false */

Expand All @@ -20,9 +20,9 @@
setTimeout(_execmascara, 1);
};
return this.each(function () {
var $this = jQuery(this),
opts = jQuery.extend({}, jQuery.fn.maskx.defaults, settings),
maskxFunc = jQuery.fn.maskx[opts.maskx];
var $this = $(this),
opts = $.extend({}, $.fn.maskx.defaults, settings),
maskxFunc = $.fn.maskx[opts.maskx];

if (typeof maskxFunc === 'function') {

Expand All @@ -40,7 +40,9 @@
}
});
};
jQuery.fn.maskx = plugin;

$.fn.maskx = plugin;
$.maskx = plugin;

plugin.defaults = {
maskx: '',
Expand Down Expand Up @@ -116,4 +118,4 @@
v = v.replace(/(\d{1})(\d{2})(\d{2})/, "$1:$2.$3");
return v;
};
}());
}(jQuery));

0 comments on commit fd23c0d

Please sign in to comment.