-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from alfredobarron/dev
Dev
- Loading branch information
Showing
51 changed files
with
951 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
.grunt | ||
node_modules | ||
docsHTML | ||
docs/node_modules | ||
|
||
# Extension to ognore | ||
*.zip | ||
*. | ||
*.zip | ||
Gruntfile.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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' | ||
}; | ||
} | ||
|
||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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; | ||
} | ||
|
@@ -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); | ||
|
@@ -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; | ||
}; | ||
|
||
|
||
|
||
|
||
|
||
/** | ||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]>" | ||
|
@@ -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", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.