|
The Gravy Framework | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--GLOBALS
| Method Summary | |
<static> Object
|
_AjaxRequest( aRequestName, aReplyEventHandler, aBANK, anACCT, optPostData, optWaitFlag )
|
<static> void
|
_RequestAccountLoad( <String> aBANK, <String> anACCT )
Make a Load-Account-Data request to the server. NOTE: this is a Command helper function. NEVER call this from outside the context of a Command object! |
<static> void
|
_RequestAccountSave( <String> aBANK, <String> anACCT, <String> updates )
Make a Save-Account-Data request to the server. NOTE: this is a Command helper function. NEVER call this from outside the context of a Command object! |
<static> boolean
|
_SelectFirstUnreconciled( <boolean> selectFirst )
Select the first unreconciled Account NOTE: this is a Command helper function. NEVER call this from outside the context of a Command object! |
<static> Object
|
ArgsToString( args )
|
<static> Object
|
ArrayToString( a )
|
<static> Object
|
Break(msg)
|
<static> void
|
Breakpoint()
|
<static> void
|
busy()
set the cursor to the hourglass icon |
<static> void
|
BusyDo( <String> funcname, <String> funcargs, <int> optDelayMilliSecs )
generic utility function to queue up for future execution the specified function with the specified arguments after a specified amount of delay. |
<static> String
|
CallerName( <Arguments> argumentsObj )
This utility function returns the name of the function that called this routine. |
<static> Function
|
Class( <Function> theClass, <StringArray> optConstructorArgDescArray )
Declare a class and create the glue objects and code to allow "pretty" source; A mechanism is set up to insure that required constructor parameters each have a defined value; This function also defines the "name" attribute of the specified class and initializes it with the class name. |
<static> void
|
ClearGlobalVar( <String> varname )
static routine to dynamically undefine/delete a global variable |
<static> void
|
ClearGlobalVars()
static routine to dynamically undefine/delete ALL "...GlobalVars" variables |
<static> void
|
ClearPersistentVars()
static routine to dynamically undefine/delete ALL "...PersistentVars" variables |
<static> void
|
DebugWindow( <String> contents )
open debug window with contents in scrollable area |
<static> String
|
diamond(<boolean> optBlankFlag)
return the HTML to draw a diamond |
<static> boolean
|
DoCmd( command )
Do the given command in "synchonized" mode (meaning that it will wait until commands that are already running/queued have finished). |
<static> boolean
|
dollarKeyFilter( <int> keyCode, <String> valueSoFar )
is the given character a legal addition to the given dollar string |
<static> Object
|
dollarStrFilter(s)
|
<static> String
|
dot()
return the HTML to draw a biggish dot |
<static> void
|
DRAWVIEWS()
static function to draw the root view (and hence all views) |
<static> void
|
editElem( e, makeSelected, makeEdited, makeInvalid )
|
<static> void
|
editElemID( ID, makeSelected, makeEdited, makeInvalid )
|
<static> String
|
EmbedAttributeViewer( <View> parentView, <String> attribute, <Function> optFormatter, <Object> optParam )
Create and embed, as a subview, a ScalarView of the specified data model attribute. |
<static> String
|
EmbedDollarDualEditor( <View> parentView, <String> attribute, <String> className )
Create and embed, as a subview, a DualDollarController of the specified data model attribute which is expected to be a dollar amount data element. |
<static> DualMenuController
|
EmbedDualMenu( <View> parentView, <String> attribute, <SelectionModel> menuModel, <String> className, <Function> optEvtHndlr )
Create and embed, as a subview, a DualMenuController of the specified data model attribute |
<static> String
|
epsilon()
return the HTML to draw a smallish "E" |
<static> void
|
Error(msg)
|
<static> Function
|
Extends( <Function> superClass )
This utility function takes (via "THIS") a "class" and (re)sets its superClass. |
<static> Object
|
filterNum( str )
|
<static> String
|
FindComplexCode( <Collection> transtypes )
static routine to search for the special "complex" code |
<static> String
|
format_dollar( <anyType> v, <boolean> optZeroAsBlankFlag )
format given value as $#,###.00 |
<static> String
|
format_dollar_not( v )
like format_dollar except empty string returned for zero |
<static> String
|
FuncName(<Function> f)
This function returns the name of a given function; It does this by converting the function to a string, then using a regular expression to extract the function name from the resulting code. |
<static> String
|
genHook( <String> hookID, <String> optInnerHTML )
generate a piece of HTML, identified by the given ID, that can safely have its innerHTML replaced at runtime. |
<static> Object
|
GetArg( argname )
|
<static> Object
|
GetGlobalVar( <String> varname )
static routine to return the value of persistent variable with given name |
<static> Object
|
getHook( hookID )
|
<static> Object
|
GetPersistentVar( <String> varname )
static routine to return the value of the persistent variable with given name |
<static> Object
|
getTodayAsMMDDYYYY()
|
<static> Object
|
getTodayAsXXDDYYYY(monthNames)
|
<static> Object
|
GetXslDOM( xslURL )
retrieve XSL DOM from given URL |
<static> void
|
highlightElem( e, makeSelected, selectColor )
|
<static> Object
|
isDate(dateStr)
return error message on invalid date or null if valid |
<static> Object
|
isDigit(c)
Returns true if character c is a digit (0 .. |
<static> Object
|
isEmpty(s)
Check whether string s is "empty". |
<static> Object
|
isFloat(s)
Returns true if string s is an unsigned floating point (real) number. |
<static> Object
|
isInteger(s)
Returns true if all characters in string s are numbers. |
<static> Object
|
isLetter(c)
Returns true if character c is an English letter (A .. |
<static> Object
|
isSignedFloat(s)
Returns true if string s is a signed or unsigned floating point (real) number. |
<static> Object
|
isZeroDollars(v)
|
<static> boolean
|
keyFilter( <int> keyCode, <String> allowedChars )
Is the given keyCode in the given list of allowed characters? |
<static> void
|
LoudThrow( exceptionObj )
|
<static> Object
|
MissingArgException( argDesc, funcName )
|
<static> void
|
MUTEX_CPU_SLICE( <int> cmdID, <int> optStartID )
static routine to give a slice of CPU to mutex with given ID |
<static> boolean
|
noDuplicates( <String> s, <String> charList )
Is there no more than one occurance of each character in the given character list in the given string? |
<static> void
|
notbusy()
set the cursor to the default icon |
<static> Object
|
NullArgException( argDesc, funcName )
|
<static> Object
|
ObjectToInitializer( o )
|
<static> Object
|
ObjectToShortInitializer( o )
|
<static> Object
|
ObjectToString( o )
|
<static> void
|
OnAccountLoadReply( <XMLreq> xmlReq )
handle event for 'reply received from "load account data" server-request' |
<static> void
|
OnAccountSaveReply( <XMLreq> xmlReq )
handle event for 'reply received from "save account data" server-request' |
<static> void
|
OnAccountSelect( <int> selectedAccountKey )
handle event for 'user selects from the account menu' |
<static> void
|
OnBalanceClick( <int> balanceIndex )
handle event for 'click on a balance record' |
<static> void
|
OnBeforeUnLoad()
handle event for 'about to leave web page'; warn if attempting to leave with unsaved changes |
<static> void
|
OnCancelBtnPressed()
handle event for 'cancel button pressed' |
<static> void
|
OnDeleteBtnPressed()
handle event for 'delete button pressed' |
<static> void
|
OnEditBtnPressed()
handle event for 'edit button pressed' |
<static> void
|
OnExitBtnPressed()
handle event for 'exit button pressed' |
<static> void
|
OnFieldEditFocus( <Element> field )
handle "entering a text field" event per webreference tip) |
<static> boolean
|
OnFieldEditKey( <String> viewID )
handle "key pressed" events in text fields |
<static> Object
|
OnGlobalKeyPress()
pre-screen all keypress events for entire page This implementation handles ctrl-z and ctrl-y to invoke Undo and Redo respectively. |
<static> void
|
OnInsertBtnPressed()
handle event for 'insert button pressed' |
<static> void
|
OnLoad()
handle event for 'entering web page' |
<static> void
|
OnRedoBtnPressed()
redo-button-pressed event handler |
<static> void
|
OnSaveBtnPressed()
handle event for 'save button pressed' |
<static> boolean
|
OnScalarEditUpdate( <String> viewID )
ScalarEditController update-event handler |
<static> void
|
OnTransactionClick( <int> balanceIndex, <int> transIndex )
handle event for 'click on a transaction record' |
<static> Object
|
OnTrTypeSelect( <String> viewID )
handle event for 'user selects from the transaction type menu' |
<static> void
|
OnUndoBtnPressed()
undo-button-pressed event handler |
<static> void
|
OnUnreconciledClick( <int> balanceIndex )
handle event for 'click on an unreconciled panel' |
<static> Object
|
pleaseWait( <boolean> enableFlag, <String> msg, appId )
create and open a window (if enabled) with the specified message |
<static> void
|
selectElem( e, makeSelected )
|
<static> void
|
selectElemID( ID, makeSelected )
|
<static> void
|
SendStatusMessage( <String> msg )
send a message via the browser status bar |
<static> void
|
setBackgroundColor( ID, color )
|
<static> void
|
setElemBackgroundColor( e, color )
|
<static> void
|
setElemText( e, str )
|
<static> void
|
setElemVisibility( e, visibleFlag )
|
<static> void
|
SetGlobalVar( <String> varname, <Object> value )
static routine to dynamically define/update a global (to window/page but reloaded with page) variable with the given name and value. |
<static> void
|
SetPersistentVar( <String> varname, <Object> value )
static routine to dynamically define/update a persistent (across page loads) variable with the given name and value. |
<static> void
|
setText( ID, str )
|
<static> void
|
setVisibility( ID, visibleFlag )
|
<static> boolean
|
strFilter( s, <String> allowedChars )
Does the given string consist of only characters in the given list of allowed characters? |
<static> String
|
subitem( isInValid )
return the HTML to draw a subitem bullet |
<static> Object
|
timestamp()
return the current time in milliseconds since start of epoc |
<static> Object
|
TooFewArgsException( funcName, required, passed )
|
<static> Object
|
Trace(flag,msg)
|
<static> Object
|
TraceEvt(msg)
|
<static> Object
|
TraceMsg(msg)
|
<static> Object
|
TraceMVC(msg)
|
<static> String
|
trimStr(sInString)
strip leading and trailing whitespace |
<static> void
|
UNWAIT(appId)
close the "please wait" window if it exists otherwise no effect |
<static> String
|
URLDecode( <String> encoded )
This decodes URL-encoded strings because the Javascript function "unescape" only does part of the job; adapted from here. |
<static> void
|
ValidateArgs( <StringArray> optArgDescArray )
generic utility function to verify that required args (of the caller of this function) have been passed; The given array of descriptions defines how many arguments should be found with a defined value; Therefore, the caller of this routine should place its optional arguments at the end of its parameter list with no description specified in "optArgDescArray". |
<static> void
|
validateDate( hookID )
|
<static> void
|
validateDollar( hookID )
|
<static> void
|
validateFloat( hookID )
|
<static> void
|
validateInteger( hookID )
|
<static> void
|
WAIT(appId)
Create an idempotent "wait a minute" window, if one doesn't exist, and squirrel away a reference to it that survives window reloads |
<static> Object
|
WaitWindowName(appId)
|
<static> void
|
warnInvalid(theField, s)
Notify user that contents of field theField are invalid. |
<static> String
|
XformDOM( xslDOM, xmlDOM )
transform given XML DOM using given XSLT DOM |
<static> String
|
XformURL( xslURL, xmlDOM )
transform given XML DOM using an XSLT retrieved from given URL |
| Method Detail |
<static> Object _AjaxRequest( aRequestName, aReplyEventHandler, aBANK, anACCT, optPostData, optWaitFlag )
<static> void _RequestAccountLoad( <String> aBANK, <String> anACCT )
aBANK - Account bank number
anACCT - Account number
<static> void _RequestAccountSave( <String> aBANK, <String> anACCT, <String> updates )
aBANK - Account bank number
anACCT - Account number
updates - list of transaction update commands
<static> boolean _SelectFirstUnreconciled( <boolean> selectFirst )
selectFirst - if FALSE then leave selection alone if none unreconciled otherwise selected the first Account if none unreconciled.
<static> Object ArgsToString( args )
<static> Object ArrayToString( a )
<static> Object Break(msg)
<static> void Breakpoint()
<static> void busy()
<static> void BusyDo( <String> funcname, <String> funcargs, <int> optDelayMilliSecs )
funcname - the name of the function to call
funcargs - a string image of the parameters to be passed
optDelayMilliSecs - optional delay amount (default 5 milliSeconds)
<static> String CallerName( <Arguments> argumentsObj )
argumentsObj - the Javascript arguments object
<static> Function Class( <Function> theClass, <StringArray> optConstructorArgDescArray )
theClass - the "class constructor" function
optConstructorArgDescArray - optional array of strings describing required parameters for this class' "constructor"; Note: Optional constructor parameters should not be included in this array.
<static> void ClearGlobalVar( <String> varname )
varname - name of "persistent" variable
<static> void ClearGlobalVars()
<static> void ClearPersistentVars()
<static> void DebugWindow( <String> contents )
contents - what to put into this debug window
<static> String diamond(<boolean> optBlankFlag)
optBlankFlag - if true, says generate blanks of same size as 1 diamond
<static> boolean DoCmd( command )
<static> boolean dollarKeyFilter( <int> keyCode, <String> valueSoFar )
keyCode - the proposed new character
valueSoFar - the value so far
<static> Object dollarStrFilter(s)
<static> String dot()
<static> void DRAWVIEWS()
<static> void editElem( e, makeSelected, makeEdited, makeInvalid )
<static> void editElemID( ID, makeSelected, makeEdited, makeInvalid )
<static> String EmbedAttributeViewer( <View> parentView, <String> attribute, <Function> optFormatter, <Object> optParam )
parentView - the view to embed the new view into
attribute - the identifier of the attribute of the parent view's primary data model to view
optFormatter - optional formatter function
optParam - optional parameter to pass to model method if the attribute actually refers to a method rather than a data element
<static> String EmbedDollarDualEditor( <View> parentView, <String> attribute, <String> className )
parentView - the view to embed the new controller into
attribute - the identifier of the attribute of the parent view's primary data model to view/edit
className - the CSS classname to use for formatting
<static> DualMenuController EmbedDualMenu( <View> parentView, <String> attribute, <SelectionModel> menuModel, <String> className, <Function> optEvtHndlr )
parentView - the view to embed the new controller into
attribute - the identifier of the attribute of the parent view's primary data model to view/edit
menuModel - data model for the popup menu
className - the CSS classname to use for formatting
optEvtHndlr - optional edit event handler (default is to launch a ScalarEditCmd command).
<static> String epsilon()
<static> void Error(msg)
<static> Function Extends( <Function> superClass )
superClass - the "superclass constructor" function
<static> Object filterNum( str )
<static> String FindComplexCode( <Collection> transtypes )
transtypes - Decode collection of transaction-types
<static> String format_dollar( <anyType> v, <boolean> optZeroAsBlankFlag )
v - value to format
optZeroAsBlankFlag - optional flag to make zero format as blank
<static> String format_dollar_not( v )
<static> String FuncName(<Function> f)
f - reference to a function
<static> String genHook( <String> hookID, <String> optInnerHTML )
hookID - name of the HTML to be generated
optInnerHTML - optional HTML to be inserted into the generated HTML
<static> Object GetArg( argname )
<static> Object GetGlobalVar( <String> varname )
varname - name of "global" i.e. "static" variable
<static> Object getHook( hookID )
<static> Object GetPersistentVar( <String> varname )
varname - name of "persistent" variable
<static> Object getTodayAsMMDDYYYY()
<static> Object getTodayAsXXDDYYYY(monthNames)
<static> Object GetXslDOM( xslURL )
<static> void highlightElem( e, makeSelected, selectColor )
<static> Object isDate(dateStr)
<static> Object isDigit(c)
<static> Object isEmpty(s)
<static> Object isFloat(s)
<static> Object isInteger(s)
<static> Object isLetter(c)
<static> Object isSignedFloat(s)
<static> Object isZeroDollars(v)
<static> boolean keyFilter( <int> keyCode, <String> allowedChars )
keyCode - the charCode of the character to validate
allowedChars - the list of characters that are allowed
<static> void LoudThrow( exceptionObj )
<static> Object MissingArgException( argDesc, funcName )
<static> void MUTEX_CPU_SLICE( <int> cmdID, <int> optStartID )
cmdID - ID of command to resume
optStartID - optional ID of command on which we are waiting; if not specified then start at top of list of all pending commands.
<static> boolean noDuplicates( <String> s, <String> charList )
s - string to check
charList - list of characters that should occur only once
<static> void notbusy()
<static> Object NullArgException( argDesc, funcName )
<static> Object ObjectToInitializer( o )
<static> Object ObjectToShortInitializer( o )
<static> Object ObjectToString( o )
<static> void OnAccountLoadReply( <XMLreq> xmlReq )
xmlReq - the XML request being replied to
<static> void OnAccountSaveReply( <XMLreq> xmlReq )
xmlReq - the XML request being replied to
<static> void OnAccountSelect( <int> selectedAccountKey )
selectedAccountKey - the new menu-selection
<static> void OnBalanceClick( <int> balanceIndex )
balanceIndex - index into balance list (aka account data)
<static> void OnBeforeUnLoad()
<static> void OnCancelBtnPressed()
<static> void OnDeleteBtnPressed()
<static> void OnEditBtnPressed()
<static> void OnExitBtnPressed()
<static> void OnFieldEditFocus( <Element> field )
field - HTML element of text field generating this event
<static> boolean OnFieldEditKey( <String> viewID )
viewID - view ID of the FieldEditController generating this event.
<static> Object OnGlobalKeyPress()
<static> void OnInsertBtnPressed()
<static> void OnLoad()
<static> void OnRedoBtnPressed()
<static> void OnSaveBtnPressed()
<static> boolean OnScalarEditUpdate( <String> viewID )
viewID - view ID of the ScalarEditController generating this event.
<static> void OnTransactionClick( <int> balanceIndex, <int> transIndex )
balanceIndex - index into balance list (aka account data)
transIndex - index into transaction list (of balance)
<static> Object OnTrTypeSelect( <String> viewID )
viewID - ID of the controller generating this event
<static> void OnUndoBtnPressed()
<static> void OnUnreconciledClick( <int> balanceIndex )
balanceIndex - index into balance list (aka account data)
<static> Object pleaseWait( <boolean> enableFlag, <String> msg, appId )
enableFlag - iff true then create window
msg - message to place in window
<static> void selectElem( e, makeSelected )
<static> void selectElemID( ID, makeSelected )
<static> void SendStatusMessage( <String> msg )
msg - the message to send.
<static> void setBackgroundColor( ID, color )
<static> void setElemBackgroundColor( e, color )
<static> void setElemText( e, str )
<static> void setElemVisibility( e, visibleFlag )
<static> void SetGlobalVar( <String> varname, <Object> value )
varname - name of "persistent" variable
value - value to set variable to
<static> void SetPersistentVar( <String> varname, <Object> value )
varname - name of "persistent" variable
value - value to set variable to
<static> void setText( ID, str )
<static> void setVisibility( ID, visibleFlag )
<static> boolean strFilter( s, <String> allowedChars )
allowedChars - the list of characters that are allowed
keyCode - the charCode of the character to validate
<static> String subitem( isInValid )
<static> Object timestamp()
<static> Object TooFewArgsException( funcName, required, passed )
<static> Object Trace(flag,msg)
<static> Object TraceEvt(msg)
<static> Object TraceMsg(msg)
<static> Object TraceMVC(msg)
<static> String trimStr(sInString)
<static> void UNWAIT(appId)
<static> String URLDecode( <String> encoded )
encoded - the URL-encoded string to translate
<static> void ValidateArgs( <StringArray> optArgDescArray )
optArgDescArray - optional array of strings describing required parameters; Note: Optional constructor parameters should not be included in this array.
<static> void validateDate( hookID )
<static> void validateDollar( hookID )
<static> void validateFloat( hookID )
<static> void validateInteger( hookID )
<static> void WAIT(appId)
<static> Object WaitWindowName(appId)
<static> void warnInvalid(theField, s)
<static> String XformDOM( xslDOM, xmlDOM )
<static> String XformURL( xslURL, xmlDOM )
|
The Gravy Framework | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||