browserquest/BrowserQuest — pull request #125 by sergkr (2013-09-08 05:49:47+00:00)
Title: Fixes issue #53 (show error message when attempting to log in with incorrect password)

Note: This also fixes #119

This one is a bit nontrivial, mostly due to the large number of HTML/CSS changes to support showing error messages in the login form. The first seven commits are pretty much all prep work (form validation layout and functionality, HTML/CSS cleanup, etc.), and the actual fix is in the last commit (7fe0de5).

Notes:

- When the login form is submitted, instead of immediately launching the game and showing the "connecting to server" screen, we stay in the login form and show a loading spinner. I thought this would be a bit smoother than navigating away from the login form, and then bringing it back if it turns out the password is incorrect. However, the downside is we're doing a lot of work from within the login screen (we still have to launch the game in the background and connect to the database to determine if the password is correct), so it makes game startup seem a bit slower. Let me know if this is a concern, and I can try to think of something.

- The loading spinner itself is nothing fancy - I'm not exactly an artist, and all the examples I've been finding online all looked too modern, so I decided to whip something up myself. Please let me know if it's bad and I'll try to find something else. (And the existing spinner image in the repository looked like it was intended to be used with the fancy buttons, which we've done away with.)

- While I was adjusting the CSS to make space for the validation error messages, I also made sure that the "Create" link fits within the container in the create new character form, so this also fixes issue #119.

Let me know if you spot any issues with this, or if you have any suggestions. Thanks!