Board18Misc1

From BOARD18 Project WIKI
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
This page has been updated to comply with Release 2.6.x of BOARD18. Go Back

board18Misc1.js contains all of the setup code for the board18Misc page and all of the functions that manipulate the right of page content that displays players for selection.

Function gamePlayersResult(response)

Function gamePlayersResult is the call back function for the ajax call to gamePlayers.php. It reports any failure and then displays the "List of players in game" table at the top of the "rightofpage" division.

Input is is the following stringified JSON data structure.

 {
   "stat":"success||"fail"||"noplayers",
   "players":
   [
     {
       "playerid":"nnnn",
       "login":"pppppp",
       "fname":"fffffff",
       "lname":"ggggggg"
     },
     . . . . more players . . . . . 
   ]
 }


Function playerSortReturn(result)

Function playerSortReturn() is the callback function for the playerSort.php AJAX call. It creates a list of plaers sorted in the specified order and displays it in one of three hidden divisions. It then shows that division.

Function switchtoid()

Function switchtoid() empties the playerid list. It then hides the currently displayed list and sets BD18.sort to "ID". Finally it does an AJAX call to playerSort.php to load BD18.playerList with a list of players sorted by player ID.

Function switchtofn()

Function switchtofn() empties the playerid list. It then hides the currently displayed list and sets BD18.sort to "FN". Finally it does an AJAX call to playerSort.php to load BD18.playerList with a list of players sorted by first name.

Function switchtoln()

Function switchtoln() empties the playerid list. It then hides the currently displayed list and sets BD18.sort to "LN". Finally it does an AJAX call to playerSort.php to load BD18.playerList with a list of players sorted by last name.