| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <script>
- jQuery(document).ready(function(){
- $("#btnCompleteProductConfig").prop("disabled",true);
- jQuery(":password").keyup(function () {
- var pwStrengthErrorThreshold = 50;
- var pwStrengthWarningThreshold = 75;
- var $newPassword1 = jQuery(":password");
- var pw = jQuery(":password").val();
- var pwlength = (pw.length);
- if (pwlength > 5) pwlength = 5;
- var numnumeric = pw.replace(/[0-9]/g, "");
- var numeric = (pw.length - numnumeric.length);
- if (numeric > 3) numeric = 3;
- var symbols = pw.replace(/\W/g, "");
- var numsymbols = (pw.length - symbols.length);
- if (numsymbols > 3) numsymbols = 3;
- var numupper = pw.replace(/[A-Z]/g, "");
- var upper = (pw.length - numupper.length);
- if (upper > 3) upper = 3;
- var pwstrength = ((pwlength * 10) - 20) + (numeric * 10) + (numsymbols * 15) + (upper * 10);
- if (pwstrength < 0) pwstrength = 0;
- if (pwstrength > 100) pwstrength = 100;
- $newPassword1.removeClass('has-error has-warning has-success');
- if (pwstrength < pwStrengthErrorThreshold) {
- $newPassword1.addClass('has-error');
- $newPassword1.css('background-color', '#f003');;
- } else if (pwstrength < pwStrengthWarningThreshold) {
- $newPassword1.addClass('has-warning');
- $newPassword1.css('background-color', '#ff03');;
- } else {
- $newPassword1.addClass('has-success');
- $newPassword1.css('background-color', '#0f03');;
- $("#btnCompleteProductConfig").removeProp("disabled");
- }
- });
- });
- </script>
- {if file_exists("templates/$template/includes/alert.tpl")}
- {include file="$template/includes/alert.tpl" type="info" msg="{$LANG.passwordtips}"}
- {elseif file_exists("templates/six/includes/alert.tpl")}
- {include file="six/includes/alert.tpl" type="info" msg="{$LANG.passwordtips}"}
- {/if}
|