Board18Misc2

From BOARD18 Project WIKI
Jump to navigation Jump to search
This page has been updated to comply with Release 2.6.x of BOARD18. Go Back

board18Misc2.js contains all of the code to actually process the buttons on game session edit form and to inform players of any change in games which they are playing.

Function changePlayer(login, game)

Function changePlayer is called by the on- click method of the submit button on the game session edit form. It sets BD18.mode based on missing fields and does an ajax call to changePlayers.php.

Function changePlayerResult(response)

Function changePlayerResult is the call back function for the ajax changePlayers.php call.

Output from changePlayers.php is an echo return status:

 "success" - All changes have been made.
 "fail"    - Uexpected error - No changes have been made.
 "dupadd"  - Add ID is duplicate - No changes have been made.

Function emailPlayerResult(response)

Function emailPlayerResult is the call back function for the ajax calls to emailPlayerAdd.php and emailPlayerRem.php.

Output from either program is an echo return status:

 "success" - Email sent.
 "fail"    - Uexpected error - No email sent.

function linkReturn(response)

Function linkReturn is the call back function for the ajax linkGet.php call. It creates and displays the game_link update division for the current game session. The response from linkGet.php is the following stringified JSON data structure.

 {
   "stat":"success||none||fail",
   "links":
   [
     {
       "link_name":"aaaaaa",
       "link_url":"bbbbbbb",
       "act_date":"mm/dd/yyyy"
     },
     . . . . more links . . . . . 
   ]
 }

Function addLink()

The addLink function is called by the on-click method of the Add button in the link form. It checks the input parameters for validity and then performs an AJAX call to the linkAdd.php function.

Function addReturn(response)

The addReturn function is the call back function for the ajax linkAdd.php call. It processes the response. On success, it calls the linkGet function. The response is the echo return status:

 "success", "fail" or "duplicate".

Function deleteCheck(linkname)

The deleteCheck function is called by the on-click method of the Link Name. It queries to make sure that the delete request is real.

Function deleteLink(gameid,linkname)

The deleteLink function is called by the on-click method of the "Yes" button on the delpop form. It performs an AJAX call to the linkDel.php function.

Function delReturn(response)

The delReturn function is the call back function for the ajax linkDel.php call. It processes the response. On success, it calls the linkGet function. The response is the echo return status:

 "success", "fail" or "missing".