@@ -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
@@ -32,9 +23,13 @@ App.Actions.DB.update_db_databasename_hint = function(elm, hint) {
3223App . Listeners . DB . keypress_db_username = function ( ) {
3324 var ref = $ ( 'input[name="v_dbuser"]' ) ;
3425 var current_val = ref . val ( ) ;
26+ if ( current_val . indexOf ( GLOBAL . DB_DBNAME_PREFIX ) == 0 ) {
27+ current_val = current_val . slice ( GLOBAL . DB_DBNAME_PREFIX . length , current_val . length ) ;
28+ ref . val ( current_val ) ;
29+ }
3530 if ( current_val . trim ( ) != '' ) {
3631 App . Actions . DB . update_db_username_hint ( ref , current_val ) ;
37- }
32+ }
3833
3934 ref . bind ( 'keypress input' , function ( evt ) {
4035 clearTimeout ( window . frp_usr_tmt ) ;
@@ -50,9 +45,13 @@ App.Listeners.DB.keypress_db_username = function() {
5045App . Listeners . DB . keypress_db_databasename = function ( ) {
5146 var ref = $ ( 'input[name="v_database"]' ) ;
5247 var current_val = ref . val ( ) ;
53- if ( current_val . trim ( ) != '' ) {
54- App . Actions . DB . update_db_databasename_hint ( ref , current_val ) ;
48+ if ( current_val . indexOf ( GLOBAL . DB_DBNAME_PREFIX ) == 0 ) {
49+ current_val = current_val . slice ( GLOBAL . DB_DBNAME_PREFIX . length , current_val . length ) ;
50+ ref . val ( current_val ) ;
5551 }
52+ if ( current_val . trim ( ) != '' ) {
53+ App . Actions . DB . update_db_username_hint ( ref , current_val ) ;
54+ }
5655
5756 ref . bind ( 'keypress input' , function ( evt ) {
5857 clearTimeout ( window . frp_dbn_tmt ) ;
@@ -97,6 +96,7 @@ App.Listeners.DB.keypress_v_password();
9796App . Listeners . DB . keypress_db_username ( ) ;
9897App . Listeners . DB . keypress_db_databasename ( ) ;
9998
99+
100100randomString = function ( min_length = 16 ) {
101101 var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz' ;
102102 var string_length = min_length ;
0 commit comments