From 4cdafcdd3f82f0bb22f93306968b4f5cfe9ea283 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sun, 7 Jul 2019 14:19:17 -0700 Subject: [PATCH] Fixed login screen keyboard use. --- package.json | 2 +- views/login-min.handlebars | 2 +- views/login.handlebars | 37 +++++++++++++++++++++---------------- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 5f6b2d8f..fb822a6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.3.7-i", + "version": "0.3.7-j", "keywords": [ "Remote Management", "Intel AMT", diff --git a/views/login-min.handlebars b/views/login-min.handlebars index 838990ee..739c034c 100644 --- a/views/login-min.handlebars +++ b/views/login-min.handlebars @@ -1 +1 @@ - {{{title}}} - Login
{{{title}}}
{{{title2}}}

Welcome


\ No newline at end of file + {{{title}}} - Login
{{{title}}}
{{{title2}}}

Welcome


\ No newline at end of file diff --git a/views/login.handlebars b/views/login.handlebars index af3eee92..6894da05 100644 --- a/views/login.handlebars +++ b/views/login.handlebars @@ -58,16 +58,16 @@ - + @@ -113,7 +113,7 @@ -
Back to login +
Back to login @@ -137,7 +137,7 @@ -
Back to login +
Back to login @@ -160,7 +160,7 @@ -
Back to login +
Back to login @@ -183,7 +183,7 @@ -
Back to login +
Back to login @@ -213,7 +213,7 @@ -
Back to login +
Back to login @@ -377,11 +377,13 @@ userInterfaceSelectMenu(); } - function showPassHint() { + function showPassHint(e) { messagebox("Password Hint", passhint); + haltEvent(e); + return false; } - function xgo(x) { + function xgo(x, e) { QV('message1', false); QV('message2', false); QV('message3', false); @@ -389,6 +391,8 @@ QV('message5', false); QV('message6', false); go(x); + haltEvent(e); + return false; } function go(x) { @@ -413,7 +417,7 @@ var ok = ((Q('username').value.length > 0) && (Q('username').value.indexOf(' ') == -1) && (Q('password').value.length > 0)); QE('loginButton', ok); setDialogMode(0); - if ((e != null) && (e.keyCode == 13)) { if (box == 1) { Q('password').focus(); } else if (box == 2) { Q('loginButton').click(); } } + if ((e != null) && (e.keyCode == 13)) { if ((box == 1) && (Q('username').value != '')) { Q('password').focus(); } else if ((box == 2) && (Q('password').value != '')) { Q('loginButton').click(); } } if (e != null) { haltEvent(e); } } @@ -460,11 +464,12 @@ } } if ((e != null) && (e.keyCode == 13)) { - if (box == 1) { Q('aemail').focus(); } - if (box == 2) { Q('apassword1').focus(); } - if (box == 3) { Q('apassword2').focus(); } - if (box == 4) { Q('apasswordhint').focus(); } - if (box == 5) { if (newAccountPass == 1) { Q('anewaccountpass').focus(); } else { Q('createButton').click(); } } + + if ((box == 1) && userok) { Q('aemail').focus(); } + if ((box == 2) && emailok) { Q('apassword1').focus(); } + if ((box == 3) && pass1ok) { Q('apassword2').focus(); } + if ((box == 4) && pass2ok) { if (passRequirements.hint === true) { Q('apasswordhint').focus(); } else { box = 5; } } + if (box == 5) { if (newAccountPass == 1) { Q('anewaccountpass').focus(); } else { box = 6; } } if (box == 6) { Q('createButton').click(); } } if (e != null) { haltEvent(e); }