@@ -5,11 +5,6 @@ App.Actions.DB.update_db_username_hint = function(elm, hint) {
55 if ( hint . trim ( ) == '' ) {
66 $ ( elm ) . parent ( ) . find ( '.hint' ) . html ( '' ) ;
77 }
8- // remove prefix from value in order to eliminate duplicates
9- if ( hint . indexOf ( GLOBAL . DB_USER_PREFIX ) == 0 ) {
10- hint = hint . slice ( GLOBAL . DB_USER_PREFIX . length , hint . length ) ;
11- }
12-
138 $ ( elm ) . parent ( ) . find ( '.hint' ) . text ( GLOBAL . DB_USER_PREFIX + hint ) ;
149}
1510
@@ -20,10 +15,6 @@ App.Actions.DB.update_db_databasename_hint = function(elm, hint) {
2015 if ( hint . trim ( ) == '' ) {
2116 $ ( elm ) . parent ( ) . find ( '.hint' ) . html ( '' ) ;
2217 }
23- // remove prefix from value in order to eliminate duplicates
24- if ( hint . indexOf ( GLOBAL . DB_DBNAME_PREFIX ) == 0 ) {
25- hint = hint . slice ( GLOBAL . DB_DBNAME_PREFIX . length , hint . length ) ;
26- }
2718 $ ( elm ) . parent ( ) . find ( '.hint' ) . text ( GLOBAL . DB_DBNAME_PREFIX + hint ) ;
2819}
2920
@@ -34,7 +25,7 @@ App.Listeners.DB.keypress_db_username = function() {
3425 var current_val = ref . val ( ) ;
3526 if ( current_val . trim ( ) != '' ) {
3627 App . Actions . DB . update_db_username_hint ( ref , current_val ) ;
37- }
28+ }
3829
3930 ref . bind ( 'keypress input' , function ( evt ) {
4031 clearTimeout ( window . frp_usr_tmt ) ;
@@ -50,9 +41,13 @@ App.Listeners.DB.keypress_db_username = function() {
5041App . Listeners . DB . keypress_db_databasename = function ( ) {
5142 var ref = $ ( 'input[name="v_database"]' ) ;
5243 var current_val = ref . val ( ) ;
53- if ( current_val . trim ( ) != '' ) {
54- App . Actions . DB . update_db_databasename_hint ( ref , current_val ) ;
44+ if ( current_val . indexOf ( GLOBAL . DB_DBNAME_PREFIX ) == 0 ) {
45+ current_val = current_val . slice ( GLOBAL . DB_DBNAME_PREFIX . length , current_val . length ) ;
46+ ref . val ( current_val ) ;
5547 }
48+ if ( current_val . trim ( ) != '' ) {
49+ App . Actions . DB . update_db_username_hint ( ref , current_val ) ;
50+ }
5651
5752 ref . bind ( 'keypress input' , function ( evt ) {
5853 clearTimeout ( window . frp_dbn_tmt ) ;
@@ -97,6 +92,7 @@ App.Listeners.DB.keypress_v_password();
9792App . Listeners . DB . keypress_db_username ( ) ;
9893App . Listeners . DB . keypress_db_databasename ( ) ;
9994
95+
10096randomString = function ( min_length = 16 ) {
10197 var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz' ;
10298 var string_length = min_length ;
0 commit comments