forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit.web.js
More file actions
29 lines (26 loc) · 940 Bytes
/
Copy pathedit.web.js
File metadata and controls
29 lines (26 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
App.Actions.WEB.update_ftp_username_hint = function(elm, hint) {
if (hint.trim() == '') {
$(elm).parent().find('.hint').html('');
}
if (hint.indexOf(GLOBAL.FTP_USER_PREFIX) == 0) {
hint = hint.slice(GLOBAL.FTP_USER_PREFIX.length, hint.length);
}
$(elm).parent().find('.hint').text(GLOBAL.FTP_USER_PREFIX + hint);
}
App.Listeners.WEB.keypress_ftp_username = function() {
var ref = $('input[name="v_ftp_user"]');
var current_val = ref.val();
if (current_val.trim() != '') {
App.Actions.DB.update_ftp_username_hint(ref, current_val);
}
ref.bind('keypress', function(evt) {
clearTimeout(window.frp_usr_tmt);
window.frp_usr_tmt = setTimeout(function() {
var elm = $(evt.target);
App.Actions.WEB.update_ftp_username_hint(elm, $(elm).val());
}, 100);
});
}
//
// Page entry point
App.Listeners.WEB.keypress_ftp_username();