| Current Path : /home/jeromecohp/www/aesecure/template/ |
| Current File : /home/jeromecohp/www/aesecure/template/form_94_password.default.aec |
<script src="%AESECURESITEURL%aesecure/third/pGenerator/pGenerator.jquery.js"></script>
<div>
<label for="passwordLength">%PWDLENGTH% : </label><input id="passwordLength" name="passwordLength" type="number" value="20" style="width:50px;" max="40" min="10"/><br/>
<div id="div%ID%" class="ajaxResult"/>
<button id="tab%ID%DoIt" class="aeButtons aeButton btn btn-success" data-toggle="popover" data-content="%HINT%">%PROTECT%</button>
</div>
<script type="text/javascript">
$('#tab%ID%DoIt').pGenerator({
'bind': 'click',
'displayElement': '#div%ID%',
'passwordLength': 40,
'uppercase': true,
'lowercase': true,
'numbers': true,
'specialChars': true,
'onPasswordGenerated': function(generatedPassword) {
$('#div%ID%').html('<label for="passwordLength">%YOURPWD% : </label><input id="edtPwd" type="text" value="'+generatedPassword+'" size="45" style="padding:4px; border:solid 1px #999;" />');
}
});
// Get the password generated by pGenerator (fired prior this click event) and limit it
// to respect the length specified by the user (between 10 and 40)
$('#tab%ID%DoIt').click(function(event) {
var pwd=$('#edtPwd').val();
var lngth=parseInt($('#passwordLength').val());
// be sure that the length is between 20 and 40 and not something else than a number
if ( (isNaN(lngth)) || (lngth<10) || (lngth>40)) { lngth=20; }
$('#edtPwd').val(pwd.substring(0,lngth));
$('#edtPwd').select();
});
$('[data-toggle="popover"]').popover({trigger:'hover','placement':'top','html':true});
</script>