Difference between revisions of "Board18com"

From BOARD18 Project WIKI
Jump to navigation Jump to search
(Created page with "board18com.js contains scripts that are common to all board18 web pages. == Global Variables== All board18 global variables are contained in one 'master variable' called BD1...")
 
(Added Release 2.5.0 Upgrade Note)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
board18com.js contains scripts that are common to  
{{ReleaseNoticeX|2.5|Design_Document_Client_Side_Coding_Details}}board18com.js contains scripts that are common to  
all board18 web pages.
all board18 web pages.


Line 29: Line 29:
of the specified containing object. It uses  
of the specified containing object. It uses  
findPos() to calculate the object's top/left.
findPos() to calculate the object's top/left.
== Function docPos(event) ==
Function docPos(event) returns the position
in the document of a mouse event.


==Function doLogNote(note)==
==Function doLogNote(note)==
Line 35: Line 39:
that has not yet timed out. <br>BD18.noteTimeout is a
that has not yet timed out. <br>BD18.noteTimeout is a
global variable with an initial value of null.
global variable with an initial value of null.
==Function logoutOK(resp)==
The logoutOK function is the callback function for the ajax
logout call.
==Function statswapOK(resp)==
The statswapOK function is the callback function for the ajax
statswap call.
==Function byte2hex(array)==
Function byte2hex converts an array of bytes to a string
of hex characters [2 hex characters per byte].
This function was inspired by code found on the web page:
http://locutus.io/php/strings/bin2hex/
==Function aboutBoard18()==
Function aboutBoard18 is called from the MAIN menu on
most BOARD18 pages. It displays a popup about message.

Latest revision as of 07:59, 28 July 2017

This page has been updated to comply with Release 2.5.x of BOARD18. Go Back

board18com.js contains scripts that are common to all board18 web pages.

Global Variables

All board18 global variables are contained in one 'master variable' called BD18. This isolates them from global variables in other packages.

Function setPage()

The setPage() function adjusts the height and width of rightofpage and the height of lefttofpage.

Function $(window).resize()

The $(window).resize() function waits for 200 ms before executing setPage(). Multiple window resize events that occur within this time peroid will only trigger the setPage function once.

Utility Functions for Positioning

The findPos(obj), getScrolled(object, scrolled) and getOffset(object, offset) functions calculate the real position of an element on the page adjusted for scrolling. I got them from this web site: http://help.dottoro.com/ljnvukbb.php

Function offsetIn(event, obj)

The offsetIn function finds the offset of the cursor [at a click event] from the top/left of the specified containing object. It uses findPos() to calculate the object's top/left.

Function docPos(event)

Function docPos(event) returns the position in the document of a mouse event.

Function doLogNote(note)

Function doLogNote displays a lognote for 30 seconds. A new lognote will replace any previous log note that has not yet timed out.
BD18.noteTimeout is a global variable with an initial value of null.

Function logoutOK(resp)

The logoutOK function is the callback function for the ajax logout call.

Function statswapOK(resp)

The statswapOK function is the callback function for the ajax statswap call.

Function byte2hex(array)

Function byte2hex converts an array of bytes to a string of hex characters [2 hex characters per byte]. This function was inspired by code found on the web page: http://locutus.io/php/strings/bin2hex/

Function aboutBoard18()

Function aboutBoard18 is called from the MAIN menu on most BOARD18 pages. It displays a popup about message.