Skip to content

Commit

Permalink
Merge pull request #99 from alfredobarron/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
alfredobarron committed Nov 25, 2015
2 parents 442f98c + 4ea0b62 commit a6e3a12
Show file tree
Hide file tree
Showing 21 changed files with 126 additions and 110 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = function(grunt){
compress: {
main: {
options: {
archive: 'smoke-v3.0.0.zip'
archive: 'smoke-v3.0.1.zip'
},
files: [
//{src: ['path/*'], dest: 'internal_folder/', filter: 'isFile'}, // includes files in path
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ All contributions are very welcome, We love it. There are several ways to help o
There are a few guidelines that we need contributors to follow so that we have a chance of keeping on top of things.


If you want to making changes Better avoid working directly on the master branch, to avoid conflicts if you pull in updates from origin, so, if make your contribution under the branch [`dev`](https://github.com/alfredobarron/smoke/tree/dev).
If you want to making changes Better avoid working directly on the master branch, to avoid conflicts if you pull in updates from origin, so, if make your contribution under the branch [`dev`](https://github.com/alfredobarron/smoke/tree/dev), into folder `docs/src/`.


##Community
Expand Down
94 changes: 51 additions & 43 deletions dist/js/smoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
// Se obtiene el nivel de la fuerza de la contraseña
var smkStrongPass = $(v).attr('data-smk-strongPass');

// Se eliminan los mensajes de error
$.smkRemoveError(input);

// Se obtiene el value de los input RADIO y/o CHECKBOX
Expand Down Expand Up @@ -411,53 +412,60 @@
$.fn.smkClear = function() {

// Se obtienen todos los inputs
var inputs = (this.is(':input')) ? $(this) : $(':input:not(:button):not(:disabled):not([data-smk-noclear])', this);
var inputs = (this.is(':input')) ? $(this) : $(':input:not(:button)', this);

// Se recorren todos los inputs del formulario
inputs.each(function(k,v) {
//Se obtiene el type y el tag del input
var type = this.type;
var tag = this.tagName.toLowerCase();
//Si el tag trae el valor 'input' se sustituye por el valor type
if (tag == 'input') {
tag = type;
}
//Se compara el type y se limpia
switch (type) {
case 'text':
case 'password':
case 'email':
case 'number':
case 'hidden':
case 'date':
case 'datetime':
case 'datetime-local':
case 'month':
case 'week':
case 'time':
case 'tel':
case 'url':
case 'search':
case 'range':
case 'color':
this.value = '';
break;
case 'checkbox':
case 'radio':
this.checked = false;
break;
}
//Se compara el tag y se limpia
switch (tag) {
case 'textarea':
this.value = '';
break;
case 'select':
this.selectedIndex = -1;
if($(this).hasClass('select2')){
$(this).select2('val', '');

// Se eliminan los mensajes de error
$.smkRemoveError(v);

// Si el input no contiene el attr data-smk-noclear
if ( $(v).attr('data-smk-noclear') === undefined ) {
//Se obtiene el type y el tag del input
var type = this.type;
var tag = this.tagName.toLowerCase();
//Si el tag trae el valor 'input' se sustituye por el valor type
if (tag == 'input') {
tag = type;
}
//Se compara el type y se limpia
switch (type) {
case 'text':
case 'password':
case 'email':
case 'number':
case 'hidden':
case 'date':
case 'datetime':
case 'datetime-local':
case 'month':
case 'week':
case 'time':
case 'tel':
case 'url':
case 'search':
case 'range':
case 'color':
this.value = '';
break;
case 'checkbox':
case 'radio':
this.checked = false;
break;
}
//Se compara el tag y se limpia
switch (tag) {
case 'textarea':
this.value = '';
break;
case 'select':
this.selectedIndex = 0;
if($(this).hasClass('select2')){
$(this).select2('val', '');
}
break;
}
break;
}
});
//$(this)[0].reset();
Expand Down
2 changes: 1 addition & 1 deletion dist/js/smoke.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lang/ar.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/lang/de.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lang/es.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lang/fr.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit a6e3a12

Please sign in to comment.