Browse Source

seamos mas explicitos sobre la pass

pull/14/head
kali kaneko (leap communications) 2 years ago
parent
commit
00c2af3d86
  1. 5
      assets/zxcvbn-bootstrap-strength-meter.js
  2. 2
      tmpl/adduser.html
  3. 3
      tmpl/index.html
  4. 2
      tmpl/load-password.js
  5. 3
      tmpl/password.html

5
assets/zxcvbn-bootstrap-strength-meter.js vendored

@ -1,11 +1,12 @@
//Requires zxcvbn.js and Bootstrap
(function ($) {
function disableSend () {
$('#cambiapass').prop('disabled', true).addClass('disabled');
$('#pass-tip').text('Piensa algo mejor porfa :)').show();
}
function enableSend () {
$('#pass-tip').text('').hide();
$('#cambiapass').prop('disabled', false).removeClass('disabled');
}
@ -15,7 +16,7 @@
var settings = $.extend({
passwordInput: '#Password',
userInputs: [],
ratings: ["Very weak", "Weak", "OK", "Strong", "Very strong"],
ratings: ["Very weak", "Weak", "meh", "Strong", "Very strong"],
//all progress bar classes removed before adding score specific css class
allProgressBarClasses: "progress-bar-danger progress-bar-warning progress-bar-success progress-bar-striped active",
//bootstrap css classes (0-4 corresponds with zxcvbn score)

2
tmpl/adduser.html

@ -26,7 +26,9 @@
</div>
<div class="form-group">
{{template "passwd-tips.html"}}
<label for="password">Contraseña:</label>
<div id="pass-tip" style="color:red"></div>
<input type="password" class="form-control {{if eq .Data "invalidPass"}}is-invalid{{end}}" id="password" name="password" placeholder="Contraseña">
{{if eq .Data "invalidPass"}}<div class="invalid-feedback">Password invalida, usa solo caracteres ASCII.</div>{{end}}
<div class="progress">

3
tmpl/index.html

@ -19,8 +19,9 @@
<input type="password" class="form-control" id="oldpass" name="oldpass" placeholder="Contraseña">
</div>
<div class="form-group">
<label for="password">Nueva contraseña:</label>
{{template "passwd-tips.html"}}
<label for="password">Nueva contraseña:</label>
<div id="pass-tip" style="color:red"></div>
<input type="password" class="form-control" id="password" name="password" placeholder="Contraseña">
<div class="progress">
<div id="StrengthProgressBar" class="progress-bar"></div>

2
tmpl/load-password.js

@ -3,7 +3,7 @@ window.onload = function() {
$(document).ready(function() {
$("#StrengthProgressBar").zxcvbnProgressBar({
passwordInput: "#password",
ratings: ["Muy d&eacute;bil", "D&eacute;bil", "OK", "Fuerte", "Muy buena!"]
ratings: ["Muy d&eacute;bil", "D&eacute;bil", "Casi buena!", "Fuerte", "Muy buena!"]
});
});

3
tmpl/password.html

@ -21,8 +21,9 @@
{{if eq .Data "WrongOldpass"}}<div class="invalid-feedback">Contraseña incorrecta.</div>{{end}}
</div>
<div class="form-group">
<label for="password">Nueva contraseña:</label>
{{template "passwd-tips.html"}}
<label for="password">Nueva contraseña:</label>
<div id="pass-tip" style="color:red"></div>
<input type="password" class="form-control {{if eq .Data "SameOldPass" "invalidPass"}}is-invalid{{end}}" id="password" name="password" placeholder="Contraseña">
{{ if eq .Data "SameOldPass"}}<div class="invalid-feedback">Cuando decíamos "cambiarla" nos referíamos a... cambiarla ;)</div>{{end}}
{{if eq .Data "invalidPass"}}<div class="invalid-feedback">Password invalida, usa solo caracteres ASCII.</div>{{end}}

Loading…
Cancel
Save