Commit fa1e46ac by Nate Hardison Committed by Joe Blaylock

Modify chat login form to not prompt for uname/pwd

After a period of inactivity, users will be disconnected from the
chat server. By default, Candy.js prompts them for a username and
password in order to reconnect. However, since we've generated both
of these for the user, they don't know what their username and
password are, and we can just reconnect them automatically.

Therefore, we don't want Candy.js to ever display a login form.
Instead, we override the `showLoginForm` function to display a
notification and a button to click when the user is ready to
reconnect to the chat server.
parent d1eeee24
...@@ -29,6 +29,25 @@ ...@@ -29,6 +29,25 @@
$('#chat-toolbar #chat-sound-control').remove(); $('#chat-toolbar #chat-sound-control').remove();
/* After a period of inactivity, users will be disconnected
* from the chat server and prompted to log in again. They
* won't know their username/password, however, since we take
* care of that for them.
*
* Therefore, we override this function so that the user
* never sees a true login form. We just give them a button
* to click when they're ready to (re)connect.
*/
Candy.View.Pane.Chat.Modal.showLoginForm = function(message, presetJid) {
var loginMsg = "Click below to connect to the chat server" +
"<p>&nbsp</p>" +
"<button id='connect'>Connect</button>";
Candy.View.Pane.Chat.Modal.show(loginMsg);
$("#connect").click(function() {
Candy.Core.connect("${username}", "${password}");
});
}
Candy.Core.connect("${username}", "${password}"); Candy.Core.connect("${username}", "${password}");
$("#candy").focus(); $("#candy").focus();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment