Michal Sojka [Tue, 14 Aug 2018 22:38:17 +0000 (00:38 +0200)]
Attempt to sanitize the JS code + fix few bugs
The problems solved by this commit:
- When another user logs in during logout timeout, he was logged out
automatically, even before choosing a coffee.
- Logout timer was not shown always when it should. After choosing a
coffee, the timer was shown for a while. Then, after the user page
was reloaded from the server, the timer disappeared and after an
elapsed second, the timer was shown again.
- Local debug area was not shown and hidden consistently.
The first problem was resolved by canceling the logout timer after
login. The last two problems were fixed by centralizing of the UI
updates to a single function, which does the update based on the value
of state variables.
Michal Sojka [Tue, 14 Aug 2018 21:25:04 +0000 (23:25 +0200)]
Unify logout button spelling and layout
Changes:
- Logout button text is always in small caps (both initial value from
HTML and modified value from JavaScript).
- Position of the "logout" text is always the same - when we add a
line with seconds counter below, we have to add also a line above.