|This page has been updated to comply with Release 2.6.x of BOARD18.||Go Back|
board18New2.js contains all of the code to actually create a new game and inform the players of this fact.
I found this generalized numeric test function at http://stackoverflow.com/questions/18082/
The goToMain function transfers control to the board18Main.php page.
The delayGoToMain function waits 3 seconds before calling the goToMain function.
The killGoToMain function stops any delayed calling of the goToMain function.
Function makeNewGame(name, boxid, players, player)
Function makeNewGame creates a JSON object for the ajax newgame call.
Function emailPlayerResult is the call back function for the ajax calls to emailPlayerAdd.php. It only needs to check for errors and it only needs to report the first error. Before reporting this error it will call the killGoToMain() function.
Output from emailPlayerAdd.php is an echo return status:
"success" - Email sent. "fail" - Uexpected error - No email sent.
Function newgameOK is the callback function for the ajax newgame call. After sending emails to all players it calls the delayGoToMain() function.
Function donewgame is called by the on-click method of the newgame submit button. It checks the input for missing fields and invalid values. It then does an ajax call to createGame.php.