Skip to content

Commit

Permalink
Merge pull request #105 from alfredobarron/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
alfredobarron committed Mar 20, 2016
2 parents a6e3a12 + 19ff0d5 commit 5f16f7f
Show file tree
Hide file tree
Showing 51 changed files with 951 additions and 70 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
.grunt
node_modules
docsHTML
docs/node_modules

# Extension to ognore
*.zip
*.
*.zip
Gruntfile.js
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.1.zip'
archive: 'smoke-v3.1.0.zip'
},
files: [
//{src: ['path/*'], dest: 'internal_folder/', filter: 'isFile'}, // includes files in path
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ If you want to making changes Better avoid working directly on the master branch

##Collaborators

- [+MisaelRojas](https://plus.google.com/+MisaelRojas)
- [@misaelrojas](https://github.com/misaelrojas)
- [@mostrosonido](https://twitter.com/mostrosonido)
- [@sdhp](https://github.com/sdhp)
- [@LespiletteMaxime](https://github.com/LespiletteMaxime)
- [@promogest](https://github.com/promogest)
- [@hidesuke](https://github.com/hidesuke)
- [@druzza](https://github.com/druzza)
- [@adaniello](https://github.com/adaniello)
- [@tamerwaw](https://github.com/tamerwaw)
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smoke",
"version": "3.0.0",
"version": "3.1.0",
"description": "Smoke form validation and components for Bootstrap",
"license": "LGPL",
"authors": [
Expand Down
24 changes: 24 additions & 0 deletions dist/css/smoke.css
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,30 @@ a.smk-full:focus {



/*
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| Show Pass
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
.smk-show-pass {
position: relative;
}
.smk-btn-show-pass {
position: absolute;
right: 0;
top: 25px;
z-index: 2;
display: block;
width: 34px;
height: 34px;
line-height: 34px;
text-align: center;
}





/*
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| Helper Styles
Expand Down
2 changes: 1 addition & 1 deletion dist/css/smoke.min.css

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

101 changes: 96 additions & 5 deletions dist/js/smoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
textDatetime : 'Please enter a valid date and time',
textMonth : 'Please enter a valid month',
textWeek : 'Please enter a valid week',
textTime : 'Please enter a valid time'
textTime : 'Please enter a valid time',
textPattern : 'Enter a valid string'
};
}

Expand Down Expand Up @@ -110,14 +111,31 @@
var smkMax = $(v).attr('data-smk-max');
// Se obtiene el nivel de la fuerza de la contraseña
var smkStrongPass = $(v).attr('data-smk-strongPass');
// Se obtiene el pattern de una expresión regular
var smkPattern = $(v).attr('data-smk-pattern');
// Se obtiene el valor pestaña centavos
var smkDecimalSeparator = $(v).attr('data-smk-decimal-separator');
// Se obtiene el valor pestaña miles
var smkThousandSeparator = $(v).attr('data-smk-thousand-separator');

//Obtiene las fichas de los valores por defecto de miles y centavos
if (typeof(smkDecimalSeparator) === 'undefined'){
//Valor por defecto
smkDecimalSeparator = '.'; //Default
}
if (typeof(smkThousandSeparator) === 'undefined'){
//Valor por defecto
smkThousandSeparator = ','; //Default
}

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

// Se obtiene el value de los input RADIO y/o CHECKBOX
if (type === 'radio' || type === 'checkbox') {
// Se obtiene el value del grupo de checks o radios
value = $("input[name=" + name + "]:checked").val();
//value = $("input[name=" + name + "]:checked").val();
value = $("input[name='" + name + "']:checked").val();
}

// Se validan los INPUTS que son requeridos y estan vacios
Expand Down Expand Up @@ -179,7 +197,8 @@
// Se valida el input DECIMAL
if (smkType === 'decimal') {
// Se crea la expresión regular para el input decimal
var decimalRegex = /^\d+(?:\.\d{1,4})?$/;
//var decimalRegex = /^\d+(?:\.\d{1,4})?$/;
var decimalRegex = (smkDecimalSeparator === ',') ? (/^\d+(?:\,\d{1,4})?$/) : (/^\d+(?:\.\d{1,4})?$/);
// Se valida que el value del input cumpla con la expresión regular
if (!decimalRegex.test(value)) {
// Se agrega el mensaje de error
Expand All @@ -192,7 +211,8 @@
// Se crea la expresión regular para el input currency con $ al inicio
//var currencyRegex = /^\$?(?:\d+|\d{1,3}(?:,\d{3})*)(?:\.\d{1,2}){0,1}$/;
// Se crea la expresión regular para el input currency
var currencyRegex = /^(?:\d+|\d{1,3}(?:,\d{3})*)(?:\.\d{1,4}){0,1}$/;
//var currencyRegex = /^(?:\d+|\d{1,3}(?:,\d{3})*)(?:\.\d{1,4}){0,1}$/;
var currencyRegex = (smkDecimalSeparator === ',' && smkThousandSeparator === '.') ? (/^(?:\d+|\d{1,3}(?:.\d{3})*)(?:\,\d{1,4}){0,1}$/) : (/^(?:\d+|\d{1,3}(?:,\d{3})*)(?:\.\d{1,4}){0,1}$/) ;
// Se valida que el value del input cumpla con la expresión regular
if (!currencyRegex.test(value)) {
// Se agrega el mensaje de error
Expand Down Expand Up @@ -341,6 +361,17 @@
}
}

// Se valida el pattern de una expresión regular
if (smkPattern !== '' && smkPattern !== undefined) {
// Se valida que el value del input cumpla con la expresión regular
var patternRegex = new RegExp('^(' + smkPattern + ')$');
// Se valida que el value del input cumpla con la expresión regular
if (!patternRegex.test(value)) {
// Se agrega el mensaje de error
result = $.smkAddError(input, languaje.textPattern);
}
}

}

input
Expand Down Expand Up @@ -462,7 +493,9 @@
case 'select':
this.selectedIndex = 0;
if($(this).hasClass('select2')){
$(this).select2('val', '');
//$(this).select2('val', '');
// new version
$(this).val('').trigger("change.select2");
}
break;
}
Expand Down Expand Up @@ -841,6 +874,9 @@
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
$.smkCurrency = function(number, prefix) {
if (typeof number !== 'string') {
number = number.toString();
}
var num = number.replace(',', '');
if(num !== ''&& !isNaN(num)){
num = Math.round(parseFloat(num) * Math.pow(10, 2)) / Math.pow(10, 2);
Expand Down Expand Up @@ -907,6 +943,61 @@



/**
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* ShowPass
* $('.panel').smkShowPass();
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
$.fn.smkShowPass = function(options) {

var self = $(this);
var parent = self.parent('.form-group');
var btnShow = '<span class="glyphicon glyphicon-eye-open smk-btn-show-pass" aria-hidden="true"></span>';

parent.addClass('smk-show-pass');
parent.append( btnShow );

// Evento del boton Remove
parent.find('.smk-btn-show-pass').click(function(event) {
event.preventDefault();
if (self.prop('type') == 'password') {
self.prop('type', 'text');
$(this).addClass('glyphicon-eye-close');
$(this).removeClass('glyphicon-eye-open');
} else {
self.prop('type', 'password');
$(this).removeClass('glyphicon-eye-close');
$(this).addClass('glyphicon-eye-open');
}
});

};




/**
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Hide email
* var email = $.smkHideEmail('[email protected]');
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
$.smkHideEmail = function(string) {
var parts = string.split('@');
var first = parts[0].charAt(0);
var last = parts[0].slice(-1);
var arterisk = '';
for (var i = 0; i < parts[0].length - 2; i++) {
arterisk = arterisk + '*';
}
var email = first + arterisk + last + '@' + parts[1];
return email;
};





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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/lang/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
textDatetime : 'Ingresa una fecha y hora válida',
textMonth : 'Ingresa un mes válido',
textWeek : 'Ingresa una semana válida',
textTime : 'Ingresa una hora válida'
textTime : 'Ingresa una hora válida',
textPattern : 'Ingresa una cadena de texto valida'
};

$.smkEqualPass.Languaje = {
Expand Down
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.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions dist/lang/ru.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
(function($){
$.fn.smkValidate.Languaje = {
// Fehlermeldung bei leeren Eingabefeldern
textEmpty : 'Обязательное поле',
// Fehlermeldung bei falschen Eingaben im Eingabefeld Email
textEmail : 'Введите правильный e-mail',
// Fehlermeldung in einem alphanumerischen Eingabefeld
textAlphanumeric : 'В это поле можно вводить только буквы и/или цифры',
// Fehlermeldung beim Eingabefeld Nummern
textNumber : 'В это поле можно вводить только цифры',
// Fehlermeldung beim Eingabefeld Nummernbereich
textNumberRange : 'Значение должно быть числом в диапазоне от <b> {@} </b> до <b> {@} </b>',
// Fehlermeldung beim Eingabefeld Dezimalzahlen
textDecimal : 'Значение должно быть дробным числом',
// Fehlermeldung beim Eingabefeld Währung
textCurrency : 'Пожалуйста, введите правильную сумму',
// Fehlermeldung in einem Auswahl/Select-Feld
textSelect : 'Необходимо сделать выбор',
// Fehlermeldung für die Eingabefelder Checkbox und Radio
textCheckbox : 'Необходимо отметить галочку',
// Fehlermeldung beim Eingabefeld mit einer vorgebenen Anzahl an Zeichen
textLength : 'Значение должно быть длиной в <b> {@} </b> символов',
// Fehlermeldung bei der Eingabe eines vorgegebenen Bereiches an Anzahl der Zeichen
textRange : 'Длина значения должна быть в пределах от <b> {@} </b> до <b> {@} </b> символов',
// Fehlermeldung für Passwortstärke (Voreinstellung)
textSPassDefault : 'Не менее 4 букв (слабый)',
// Fehlermeldung für Passwortstärke (schwach)
textSPassWeak : 'Не менее 6 букв (средний)',
// Fehlermeldung für Passwortstärke (mittel)
textSPassMedium : 'Не менее 6 символов и 1 цифры (надежный)',
// Fehlermeldung für Passwortstärke (stark)
textSPassStrong : 'Не меннее 6 букв в разном регистре и одной цифры'
};

$.smkEqualPass.Languaje = {
// Mensaje de error para el input repassword
textEqualPass : 'Wachtwoorden komen niet overeen'
};

$.smkDate.Languaje = {
shortMonthNames : ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"],
monthNames : ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"]
};
}(jQuery));
1 change: 1 addition & 0 deletions dist/lang/ru.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smoke-docs",
"version": "3.0.0",
"version": "3.1.0",
"homepage": "https://github.com/alfredobarron/smoke",
"authors": [
"Alfredo Barron <[email protected]>"
Expand All @@ -15,7 +15,7 @@
"tests"
],
"dependencies": {
"bootstrap": "~3.3.4",
"bootstrap": "~3.3.6",
"angular": "~1.3.15",
"angular-ui-router": "~0.2.14",
"angular-translate": "~2.6.1",
Expand Down
4 changes: 3 additions & 1 deletion docs/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ <h1>{{'COMPONENTS' | translate}}</h1>
<li><a href="" smooth-scroll target="progressbar">{{'PROGRESSBAR' | translate}}</a></li>
<li><a href="" smooth-scroll target="fullscreen">{{'FULLSCREEN' | translate}}</a></li>
<li><a href="" smooth-scroll target="panel">{{'PANEL' | translate}}</a></li>
<li><br></li>
<li><a href="http://codepen.io/alfredobarron/pen/BoerXw" target="_blank"><img src="images/codepen.png" alt=""></a></li>
</ul>
</div>

Expand Down Expand Up @@ -399,7 +401,7 @@ <h3>{{'OPTIONS' | translate }}</h3>
</section>

<blockquote class="blockquote-reverse">
<p>{{'FULL-EXAMPLE' | translate}}<a href="http://codepen.io/alfredobarron/pen/BoerXw" target="_blank">Codepen</a></p>
<p>{{'FULL-EXAMPLE' | translate}}<a href="http://codepen.io/alfredobarron/pen/BoerXw" target="_blank"><img src="images/codepen.png" alt=""></a></p>
</blockquote>
</div><!--/.col-lg-9 -->
</div><!--/.row -->
Expand Down
15 changes: 14 additions & 1 deletion docs/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ footer ul li .fb-share-button>span{
.advertise a:hover {
text-decoration: none;
}
.advertise .carousel-indicators {
bottom: -50px;
}

.list-unstyled li {
margin: 8px 0;
Expand All @@ -173,6 +176,9 @@ footer ul li .fb-share-button>span{
text-decoration: none;
border-left: 2px solid #3A3C3C;
}
.list-unstyled li img {
height: 20px;
}


.nav-tabs {
Expand Down Expand Up @@ -215,6 +221,10 @@ pre {
margin: 0;
}

.blockquote-reverse img {
height: 20px;
}

.error h1,
.error h2,
.error span,
Expand Down Expand Up @@ -338,7 +348,10 @@ pre {
font-size: 7em;
}
.error p{
font-size: 1.5em
font-size: 1.5em;
}
.advertise img {
margin-bottom: 10px;
}
}
@media (min-width: 1200px){
Expand Down
Loading

0 comments on commit 5f16f7f

Please sign in to comment.