Difference between revisions of "Board18Map7"

From BOARD18 Project WIKI
Jump to navigation Jump to search
(added checkForUpdate() functions)
(Added snapshot functions)
Line 2: Line 2:
board18Map7.js contains the function that implements the
board18Map7.js contains the function that implements the
keyboard shortcut events and the functions that implement
keyboard shortcut events and the functions that implement
the call to the checkForUpdate.php routine.
the call to the checkForUpdate.php routine. It now also
contains the code for the new snapshot function.


==Function setUpKeys()==
==Function setUpKeys()==
Line 42: Line 43:
setTimeout for the checkForUpdate function and then
setTimeout for the checkForUpdate function and then
calls the delayCheckForUpdate function.
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.

Revision as of 08:52, 10 July 2015

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.