Board18Map7

From BOARD18 Project WIKI
Revision as of 08:52, 10 July 2015 by Rich (talk | contribs) (Added snapshot functions)
Jump to navigation Jump to search

board18Map7.js contains the function that implements the keyboard shortcut events and the functions that implement the call to the checkForUpdate.php routine. It now also contains the code for the new snapshot function.

Function setUpKeys()

The setUpKeys function performs all of the bind operations for the keyboard shortcut events.

Keyboard Shortcuts
KEY Action
Enter Accept Move
C Cancel Move
M Goto Stock Chart
F Flip Token
R Rotate Tile Clockwise
E Rotate Tile Counterclockwise

Function checkForUpdateCallback(resp)

The checkForUpdateCallback function is the callback function for the checkForUpdate function. It acts on the status returned by the checkForUpdate.php AJAX call.

Function checkForUpdate()

The checkForUpdate function does an AJAX post call for checkForUpdate.php passing the gameid.

Function delayCheckForUpdate()

The delayCheckForUpdate function waits 2 minutes before calling the checkForUpdate function.

Function resetCheckForUpdate()

The resetCheckForUpdate function stops any current setTimeout for the checkForUpdate function and then calls the delayCheckForUpdate function.

Function snapshotOK(response)

Function snapshotOK is the call back function for the ajax snapShot.php call.

Function snapshot()

Function snapshot is called by the submit method of the snapname submit button. It checks the input for missing fields and does an ajax call to snapShot.php.