Module: functions

Classes

amIOnline
LoadingView

Members

(inner) menubarLoading

Loading with delay for menubar icons
Source:

(inner) waitForFinalEvent

Smooth out (resizing) events
Source:

Methods

(inner) applyFormFieldFunction(elements, func)

Iterate over form fields and apply a function on them
Parameters:
Name Type Description
elements object list of elements
func function function to apply
Source:

(inner) dataAsJson(data, xmlhttp) → {object}

Checks a given string is a JSON representation
Parameters:
Name Type Description
data string String of potential JSON information
xmlhttp object XMLHTTPObject to check for content type
Source:
Returns:
null if not JSON, false if error, evaled JSON otherwise
Type
object

(inner) dataHasJSONError(data, xmlhttp) → {boolean}

Check if the given data is a JSON error
Parameters:
Name Type Description
data string String of potential JSON error
xmlhttp object XMLHTTPObject to check
Source:
Returns:
if this was an error or not. Will raise the errorbox if it was one
Type
boolean

(inner) debug(message)

Debugging. Send a message to the console you have to set "loglevel = true" in the console prior to seeing output.
Parameters:
Name Type Description
message string error message
Source:

(inner) dropDownMessage(message) → {object}

A Dropdown Message. Will apear below the menu bar. Can be disposed by click or disappears after 10 seconds
Parameters:
Name Type Description
message string the message to display
Source:
Returns:
the container that displays the message
Type
object

(inner) errorPacketHandler(error) → {string}

An ErrorView. The input is a JSON object, generated by error.json
Parameters:
Name Type Description
error object the error object
Source:
Returns:
errorPacketHandler object
Type
string

(inner) getId(String) → {object}

Handy shortcut to document.getElementById This function was taken from the prototype library http://prototype.conio.net/
Parameters:
Name Type Description
String object or Array of IDs to look for with getElementById
Source:
Returns:
the object denoted by the given ID
Type
object

(inner) getTranslation(key, defaultValue) → {string}

Translation method - checks for the i18n to be present and returns the key
Parameters:
Name Type Description
key string Key to look up in the translation table
defaultValue string value if key was not set
Source:
Returns:
translated value
Type
string

(inner) handleErrorPage(data, status)

An error is being raised with a potential HTML Content
Parameters:
Name Type Description
data string the body of the error
status string the response status
Source:

(inner) highlightElements(listOfFadingElements, putInside)

Highlight elements with an animated box arround it
Parameters:
Name Type Description
listOfFadingElements object List of elements (or a single one) to be highlighted
putInside boolean should the fading view be put inside if the elements or arround
Source:

(inner) preg_replace_callback(pattern, callback, subject, limit) → {string}

Do a replace with a callback function
Parameters:
Name Type Description
pattern string RegExp pattern
callback function function to call for matches
subject string data to check for the pattern
limit number how many hits we want at most. -1 or not set for unlimited
Source:
Returns:
the result
Type
string

(inner) scrollToElement(element)

Scroll an element into the center of the screen
Parameters:
Name Type Description
element object the element
Source:

(inner) setInnerText(elem, text)

Set an inner text of an element
Parameters:
Name Type Description
elem object the element
text string the text
Source:

(inner) start(button)

Start the loading indicator with 500ms delay
Parameters:
Name Type Description
button string the button ID to set loading
Source:

(inner) stop(button)

Stop the loading indicator and remove its timeout
Parameters:
Name Type Description
button string the button ID to stop loading
Source:

(inner) timezoneFromInternationalizationAPI() → {string}

Tries to get the time zone key directly from the operating system for those environments that support the ECMAScript Internationalization API.
Source:
Returns:
the timezone
Type
string

(inner) windowSize() → {object}

Calculate and return the windows size
Source:
Returns:
object with {height, width}
Type
object

(inner) XRegExp(pattern, flags) → {RegExp}

Extended Regular Expression matching with support for the "s" and "x" flags
Parameters:
Name Type Description
pattern string regular expression pattern
flags string flags to be set
Source:
Returns:
the RegExp object
Type
RegExp