Difference between revisions of "The DRAFT1846Com File"
(Initial page contents) |
m |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Draft1846 Design Document Index}} | |||
This file contains scripts that are common to | This file contains scripts that are common to | ||
many draft1846 web pages. | many draft1846 web pages. | ||
All | All draft1846 global variables are contained in one | ||
'master variable' called D1846. <br>This isolates | 'master variable' called D1846. <br>This isolates | ||
them from global variables in other packages.<br> | them from global variables in other packages.<br> | ||
Line 19: | Line 19: | ||
Function resize() is triggered whenever a | Function resize() is triggered whenever a | ||
window resize event occurs.<br> | window resize event occurs.<br> | ||
Function resize() waits for 200 ms before | Function resize() waits for 200 ms (2 seconds) before | ||
executing setPage(). <br>Multiple window resize | executing setPage(). <br>Multiple window resize | ||
events that occur within this time peroid | events that occur within this time peroid | ||
will only trigger the setPage function once. | will only trigger the setPage function once. | ||
== Utility Functions == | == Utility Functions == | ||
As it turns out, these functions are actually only used by draft1846Next. But I haven't bothered to move them | |||
=== function fillHand() === | === function fillHand() === | ||
Function fillHand() deals the top cards from | Function fillHand() deals the top cards from | ||
Line 52: | Line 52: | ||
status table. It then appends a current player status table | status table. It then appends a current player status table | ||
to the draftrpt div. | to the draftrpt div. | ||
[[Category:Design]] |
Latest revision as of 11:13, 29 October 2020
DRAFT1846 Design edit |
This file contains scripts that are common to
many draft1846 web pages.
All draft1846 global variables are contained in one
'master variable' called D1846.
This isolates
them from global variables in other packages.
D1846 is initialized here too.
Page Resizing Functions
These 2 functions control the sizing of all DRAFT1846 pages.
function setPage()
Function setPage() adjusts the height and width
of rightofpage and the height of lefttofpage.
It is triggered by the resize() function.
function resize()
Function resize() is triggered whenever a
window resize event occurs.
Function resize() waits for 200 ms (2 seconds) before
executing setPage().
Multiple window resize
events that occur within this time peroid
will only trigger the setPage function once.
Utility Functions
As it turns out, these functions are actually only used by draft1846Next. But I haven't bothered to move them
function fillHand()
Function fillHand() deals the top cards from
DD1846.deck to DD1846.hand. It deals 2 more
cards than the number of players.
Function fillHand() returns FALSE if D1846.deck is
empty or contains only blank cards when
the function is called.
function emptyHand()
Function emptyHand() coppies all cards from DD1846.hand to the bottom of DD1846.deck. It then empties DD1846.hand.
Functions only used by draft1846Next and by draft1846Last
function draftDone()
The draftDone function deletes any previously displayed player
status table. It then appends the final player status table
to the draftrpt div.
The final player status table shows all
status for all players. Finally, The draftDone function appends
a draft completed message to the 'did' paragraph.
function playerDisplay()
The playerDisplay function deletes any previously displayed player status table. It then appends a current player status table to the draftrpt div.