44App . Actions . DB . update_db_username_hint = function ( elm , hint ) {
55 if ( hint . trim ( ) == '' ) {
66 $ ( elm ) . parent ( ) . find ( '.hint' ) . text ( '' ) ;
7- }
7+ }
88 $ ( elm ) . parent ( ) . find ( '.hint' ) . text ( GLOBAL . DB_USER_PREFIX + hint ) ;
99}
1010
@@ -14,7 +14,7 @@ App.Actions.DB.update_db_username_hint = function(elm, hint) {
1414App . Actions . DB . update_db_databasename_hint = function ( elm , hint ) {
1515 if ( hint . trim ( ) == '' ) {
1616 $ ( elm ) . parent ( ) . find ( '.hint' ) . text ( '' ) ;
17- }
17+ }
1818 $ ( elm ) . parent ( ) . find ( '.hint' ) . text ( GLOBAL . DB_DBNAME_PREFIX + hint ) ;
1919}
2020
@@ -26,7 +26,7 @@ App.Listeners.DB.keypress_db_username = function() {
2626 if ( current_val . trim ( ) != '' ) {
2727 App . Actions . DB . update_db_username_hint ( ref , current_val ) ;
2828 }
29-
29+
3030 ref . bind ( 'keypress input' , function ( evt ) {
3131 clearTimeout ( window . frp_usr_tmt ) ;
3232 window . frp_usr_tmt = setTimeout ( function ( ) {
@@ -44,7 +44,7 @@ App.Listeners.DB.keypress_db_databasename = function() {
4444 if ( current_val . trim ( ) != '' ) {
4545 App . Actions . DB . update_db_databasename_hint ( ref , current_val ) ;
4646 }
47-
47+
4848 ref . bind ( 'keypress input' , function ( evt ) {
4949 clearTimeout ( window . frp_dbn_tmt ) ;
5050 window . frp_dbn_tmt = setTimeout ( function ( ) {
@@ -54,19 +54,19 @@ App.Listeners.DB.keypress_db_databasename = function() {
5454 } ) ;
5555}
5656
57- App . Actions . DB . update_v_password = function ( ) {
57+ App . Actions . DB . update_password_meter = function ( ) {
5858 var password = $ ( 'input[name="v_password"]' ) . val ( ) ;
5959 var min_small = new RegExp ( / ^ (? = .* [ a - z ] ) .+ $ / ) ;
6060 var min_cap = new RegExp ( / ^ (? = .* [ A - Z ] ) .+ $ / ) ;
61- var min_num = new RegExp ( / ^ (? = .* \d ) .+ $ / ) ;
61+ var min_num = new RegExp ( / ^ (? = .* \d ) .+ $ / ) ;
6262 var min_length = 8 ;
6363 var score = 0 ;
64-
64+
6565 if ( password . length >= min_length ) { score = score + 1 ; }
6666 if ( min_small . test ( password ) ) { score = score + 1 ; }
6767 if ( min_cap . test ( password ) ) { score = score + 1 ; }
6868 if ( min_num . test ( password ) ) { score = score + 1 ; }
69- $ ( '# meter' ) . val ( score ) ;
69+ $ ( '.password- meter' ) . val ( score ) ;
7070}
7171
7272App . Listeners . DB . keypress_v_password = function ( ) {
@@ -75,7 +75,7 @@ App.Listeners.DB.keypress_v_password = function() {
7575 clearTimeout ( window . frp_usr_tmt ) ;
7676 window . frp_usr_tmt = setTimeout ( function ( ) {
7777 var elm = $ ( evt . target ) ;
78- App . Actions . DB . update_v_password ( elm , $ ( elm ) . val ( ) ) ;
78+ App . Actions . DB . update_password_meter ( elm , $ ( elm ) . val ( ) ) ;
7979 } , 100 ) ;
8080 } ) ;
8181}
@@ -88,7 +88,7 @@ App.Listeners.DB.keypress_v_password();
8888App . Listeners . DB . keypress_db_username ( ) ;
8989App . Listeners . DB . keypress_db_databasename ( ) ;
9090
91- randomString = function ( min_length = 16 ) {
92- $ ( 'input[name=v_password]' ) . val ( randomString2 ( min_length ) ) ;
93- App . Actions . DB . update_v_password ( ) ;
91+ applyRandomString = function ( min_length = 16 ) {
92+ $ ( 'input[name=v_password]' ) . val ( randomString2 ( min_length ) ) ;
93+ App . Actions . DB . update_password_meter ( ) ;
9494}
0 commit comments