make password focus on input when prompted

This commit is contained in:
johnyma22 2012-10-15 02:12:45 +01:00
parent da9439d36e
commit 9a9abc3230

View file

@ -292,13 +292,13 @@ function handshake()
{ {
$("#editorloadingbox").html("<b>You need a password to access this pad</b><br>" + $("#editorloadingbox").html("<b>You need a password to access this pad</b><br>" +
"<input id='passwordinput' type='password' name='password'>"+ "<input id='passwordinput' type='password' name='password'>"+
"<button type='button' onclick=\"" + padutils.escapeHtml('require('+JSON.stringify(module.id)+").savePassword()") + "\">ok</button>"); "<button type='button' onclick=\"" + padutils.escapeHtml('require('+JSON.stringify(module.id)+").savePassword()") + "\">ok</button><script>$('#passwordinput').focus();</script>");
} }
else if(obj.accessStatus == "wrongPassword") else if(obj.accessStatus == "wrongPassword")
{ {
$("#editorloadingbox").html("<b>You're password was wrong</b><br>" + $("#editorloadingbox").html("<b>You're password was wrong</b><br>" +
"<input id='passwordinput' type='password' name='password'>"+ "<input id='passwordinput' type='password' name='password'>"+
"<button type='button' onclick=\"" + padutils.escapeHtml('require('+JSON.stringify(module.id)+").savePassword()") + "\">ok</button>"); "<button type='button' onclick=\"" + padutils.escapeHtml('require('+JSON.stringify(module.id)+").savePassword()") + "\">ok</button><script>$('#passwordinput').focus();</script>");
} }
} }