mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
Updated hints to handle native browser's paste events
Hint is update in case page is reloaded and value is set (in case of form errors) Hints are now using secure inserting into DOM avoiding xss Dns record hint added
This commit is contained in:
parent
2981759550
commit
c50c7b2675
6 changed files with 211 additions and 84 deletions
|
@ -1,21 +1,27 @@
|
|||
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').html(GLOBAL.FTP_USER_PREFIX + 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() {
|
||||
$('input[name="v_ftp_user"]').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);
|
||||
});
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue