Skip to content

Commit

Permalink
rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
kexincchen committed Oct 1, 2024
1 parent ce591f5 commit 95585ef
Showing 1 changed file with 0 additions and 128 deletions.
128 changes: 0 additions & 128 deletions src/myCSSAhub/templates/myCSSAhub/password_reset_confirm.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,54 +17,6 @@
background-color: rgba(255, 255, 255, 0.4);
background-blend-mode: lighten;
}

#pswd_info {
position: absolute;
bottom: -180px;
left: 18%;
width: 220px;
padding: 15px;
background: #fefefe;
font-size: .875em;
border-radius: 5px;
box-shadow: 0 1px 3px #ccc;
border: 1px solid #ddd;
z-index: 1;
display: none;
}

#pswd_info h4 {
margin: 0 0 10px 0;
padding: 0;
font-weight: normal;
font-size: 12px;
}

#pswd_info::before {
content: "\25B2";
position: absolute;
top: -12px;
left: 45%;
font-size: 14px;
line-height: 14px;
color: #ddd;
text-shadow: none;
display: block;
}

.invalid {
background:url("{% static 'myCSSAhub/img/icon-invalid.png' %}") no-repeat 0 50%;
padding-left: 22px;
line-height: 24px;
color: #ec3f41;
}

.valid {
background:url("{% static 'myCSSAhub/img/icon-valid.png' %}") no-repeat 0 50%;
padding-left: 22px;
line-height: 24px;
color: #3a7d34;
}
</style>

{% for message in messages %}
Expand Down Expand Up @@ -111,23 +63,6 @@ <h5 class="card-title text-center">请设置新密码</h5>
data-parsley-group="step1"
autocomplete="off"
/>
<div id="pswd_info">
<h4>Password must meet the following requirements:</h4>
<ul>
<li id="letter" class="invalid">
At least <strong>one letter</strong>
</li>
<li id="capital" class="invalid">
At least <strong>one capital letter</strong>
</li>
<li id="number" class="invalid">
At least <strong>one number</strong>
</li>
<li id="length" class="invalid">
Be at least <strong>8 characters</strong>
</li>
</ul>
</div>
<div id="progress-container" style="padding-top:10px"></div>
</div>
</div>
Expand Down Expand Up @@ -190,11 +125,6 @@ <h4>Password must meet the following requirements:</h4>
<script type="text/javascript" src="{% static 'myCSSAhub/js/Password/password-score-options.js' %}"></script>
<script src="{% static 'myCSSAhub/vendors/jquery-ui/jquery-ui.min.js'%}"></script>
<script type="text/javascript">

var isEnoughLen = false;
var hasLetter = false;
var hasNumber = false;
var hasCapital = false;

//Password Strength Indicator
$(document).ready(function() {
Expand All @@ -211,62 +141,6 @@ <h4>Password must meet the following requirements:</h4>
append: true
}
});

$('#id_password').keyup(function (){
//console.log("Entering password");
var pswd = $(this).val();
//validate the length
if (pswd.length < 8) {
$('#length').removeClass('valid').addClass('invalid');
isEnoughLen = false;
} else {
$('#length').removeClass('invalid').addClass('valid');
isEnoughLen = true;
}

//validate letter
if (pswd.match(/[A-z]/)) {
$('#letter').removeClass('invalid').addClass('valid');
hasLetter = true ;
} else {
$('#letter').removeClass('valid').addClass('invalid');
hasLetter = false ;
}

//validate capital letter
if (pswd.match(/[A-Z]/)) {
$('#capital').removeClass('invalid').addClass('valid');
hasCapital = true ;
} else {
$('#capital').removeClass('valid').addClass('invalid');
hasCapital = false ;
}

//validate number
if (pswd.match(/\d/)) {
$('#number').removeClass('invalid').addClass('valid');
hasNumber = true ;
} else {
$('#number').removeClass('valid').addClass('invalid');
hasNumber = false ;
}

if (isEnoughLen && hasCapital && hasLetter && hasNumber) {
$('#id_password').addClass('is-valid').removeClass('is-invalid');
} else {
$('#id_password').addClass('is-invalid').removeClass('is-valid');
}
});

$('#id_password').focus(function (){
$('#pswd_info').show();
});

$('#id_password').blur(function (){
$('#pswd_info').hide();

});

});


Expand All @@ -279,10 +153,8 @@ <h4>Password must meet the following requirements:</h4>
});



</script>



{% endblock 'extra_js' %}

0 comments on commit 95585ef

Please sign in to comment.