1

I want to make the password field in jQuery terminal plugin the same as like the PuTTY password field, which will not show anything when we are entering a password. Currently, it is showing the password as "*****", but I don't want this type of behavior. If anybody has done this before, or if you have any idea, please share.

jcubic
  • 61,973
  • 54
  • 229
  • 402
ST66
  • 31
  • 3
  • You can use maskChar options default is this: `maskChar: '*'` you can use any string including empty. – jcubic Apr 25 '19 at 11:12
  • And you can also change mask in any time using `set_mask` if you use `.set_mask(true)` it will set mask to what ever you put into maskChar but you can overwrite it with string `.set_mask('-');` will set mask to dash (in fact it can be any string inlcuding the one that have more characters, you can use `"foo"`). – jcubic Apr 25 '19 at 11:25

1 Answers1

0

Use:

$('body').terminal($.noop, {
  login: function(user, pass) {
    return fetch(`/auth?user=${user}&pass=${pass}`).then(r => r.text());
  },
  maskChar: ''
});

this will login to the server, (NOTE: the code use new fetch and template literals) here is the code with ES5 (but you still need fetch, if your browser don't support it, you can use polyfill)

$('body').terminal($.noop, {
  login: function(user, pass) {
    return fetch('/auth?user=' + user + '&pass=' + pass).then(function(res) {
       return res.text();
    });
  },
  maskChar: ''
});
jcubic
  • 61,973
  • 54
  • 229
  • 402