diff --git a/web/js/pages/add.web.js b/web/js/pages/add.web.js index 2762ba140..7a01f7460 100644 --- a/web/js/pages/add.web.js +++ b/web/js/pages/add.web.js @@ -3,11 +3,11 @@ App.Actions.WEB.update_ftp_username_hint = function(elm, hint) { $(elm).parent().find('.hint').html(''); } - //hint = hint.replace(/[^\w\d]/gi, ''); - if (hint.indexOf(GLOBAL.FTP_USER_PREFIX) == 0) { hint = hint.slice(GLOBAL.FTP_USER_PREFIX.length, hint.length); } + hint = hint.replace(/[^\w\d]/gi, ''); + $(elm).parent().find('.v-ftp-user').val(hint); $(elm).parent().find('.hint').text(GLOBAL.FTP_USER_PREFIX + hint); } diff --git a/web/js/pages/edit.web.js b/web/js/pages/edit.web.js index ef20c831a..1406d9d09 100644 --- a/web/js/pages/edit.web.js +++ b/web/js/pages/edit.web.js @@ -3,11 +3,11 @@ App.Actions.WEB.update_ftp_username_hint = function(elm, hint) { $(elm).parent().find('.hint').html(''); } - //hint = hint.replace(/[^\w\d]/gi, ''); - if (hint.indexOf(GLOBAL.FTP_USER_PREFIX) == 0) { hint = hint.slice(GLOBAL.FTP_USER_PREFIX.length, hint.length); } + hint = hint.replace(/[^\w\d]/gi, ''); + $(elm).parent().find('.v-ftp-user').val(hint); $(elm).parent().find('.hint').text(GLOBAL.FTP_USER_PREFIX + hint); }