@ -10,16 +10,42 @@
var btn = '<div id="gen_password" class="btn btn-primary pull-right" style="width:10%">Generate</div>' ;
var passwd _btn = $ ( btn ) ;
var generated = '<div id="passwd_generated_text" style="width:10%; display:none; text-align:center">(modified)</div>' ;
var passwd _generated = $ ( generated ) ;
passwd _btn . click ( function ( ) {
$ ( 'input#password' ) . val ( generate _password ( 16 ) ) ;
$ ( 'input#password' ) . attr ( "style" , "width: 70% !important" ) ;
document . getElementById ( 'passwd_generated_text' ) . style . display = "inline-block" ;
} ) ;
$ ( 'input#password' ) . attr ( "style" , "width: 80% !important" ) ;
$ ( 'input#password' ) . after ( passwd _generated ) ;
$ ( 'input#password' ) . after ( passwd _btn ) ;
var webpasswd _btn = $ ( btn ) ;
var generated = '<div id="webpasswd_generated_text" style="width:10%; display:none; text-align:center">(modified)</div>' ;
var eye = '<div id="show_webpass" class="btn btn-info" style="display:inline-block" rel="tooltip" data-original-title="Show Web Password"><i id="show_webpass_icon" class="icon-eye-open" style="font-size:large"></i></div>' ;
var webpasswd _generated = $ ( generated ) ;
var show _webpasswd = $ ( eye ) ;
webpasswd _btn . click ( function ( ) {
$ ( 'input#webpassword' ) . val ( generate _password ( 16 ) ) ;
$ ( 'input#webpassword' ) . attr ( "style" , "width: 65% !important" ) ;
document . getElementById ( 'webpasswd_generated_text' ) . style . display = "inline-block" ;
} ) ;
$ ( 'input#webpassword' ) . attr ( "style" , "width: 80% !important" ) ;
show _webpasswd . click ( function ( ) {
var webpass _input = document . getElementById ( "webpassword" ) ;
if ( webpass _input . type === "password" ) {
webpass _input . type = "text" ;
$ ( 'i#show_webpass_icon' ) . attr ( "class" , "icon-eye-close" ) ;
$ ( 'div#show_webpass' ) . attr ( "data-original-title" , "Hide Web Password" ) ;
}
else {
webpass _input . type = "password" ;
$ ( 'i#show_webpass_icon' ) . attr ( "class" , "icon-eye-open" ) ;
$ ( 'div#show_webpass' ) . attr ( "data-original-title" , "Show Web Password" ) ;
}
} ) ;
$ ( 'input#webpassword' ) . attr ( "style" , "width: 75% !important" ) ;
$ ( 'input#webpassword' ) . after ( show _webpasswd ) ;
$ ( 'input#webpassword' ) . after ( webpasswd _generated ) ;
$ ( 'input#webpassword' ) . after ( webpasswd _btn ) ;
} ) ;