edit.web.js 705 B

1234567891011121314151617181920212223
  1. App.Actions.WEB.update_ftp_username_hint = function(elm, hint) {
  2. if (hint.trim() == '') {
  3. $(elm).parent().find('.hint').html('');
  4. }
  5. if (hint.indexOf(GLOBAL.FTP_USER_PREFIX) == 0) {
  6. hint = hint.slice(GLOBAL.FTP_USER_PREFIX.length, hint.length);
  7. }
  8. $(elm).parent().find('.hint').html(GLOBAL.FTP_USER_PREFIX + hint);
  9. }
  10. App.Listeners.WEB.keypress_ftp_username = function() {
  11. $('input[name="v_ftp_user"]').bind('keypress', function(evt) {
  12. clearTimeout(window.frp_usr_tmt);
  13. window.frp_usr_tmt = setTimeout(function() {
  14. var elm = $(evt.target);
  15. App.Actions.WEB.update_ftp_username_hint(elm, $(elm).val());
  16. }, 100);
  17. });
  18. }
  19. //
  20. // Page entry point
  21. App.Listeners.WEB.keypress_ftp_username();