pureweb. util

The util namespace provides methods and classes of general utility.

Method Summary

configureLogging
Configures the logger with a logConfig object.
getNumericStyleProperty
Returns the property of the CSS element as a number.
getParameterByName
Parses a URL and returns the requested query parameter value, or an empty string.
getTagContent
Returns the text content of the XML node for the specified tag name, given a string containing XML.
parseBoolean
Parses a string, returning a primitive Boolean value of true or false.
parseNumber
Parses the specified string, returning a primitive number value.
startLogging
Sets up a logging console to receive log messages.
tryParse
Returns the native JS format based on a value and a type.

Classes

CommandFilter
DefaultCommandFilter

Namespaces

guidUtil
jsonConverter
stringUtil

Members

<static> CommandFilterFlags

An enumeration of commands types that may be filtered by a CommandFilter instance.
Properties:
Name Type Default Description
NONE number 0 Do not filter any commands.
REDUNDANT_INPUT_EVENTS number 1 Filter redundant input commands.
REDUNDANT_RESIZE_EVENTS number 2 Filter redundant resize commands
REDUNDANT_PINGS number 4 Filter redundant ping command.

<static> loggingLevel → goog.debug.Logger.Level

An enumeration of the valid logging levels supported by PureWeb.
Properties:
Name Type Default Description
ALL goog.debug.Logger.Level goog.debug.Logger.Level.ALL ALL indicates that all messages should be logged.
FINEST goog.debug.Logger.Level goog.debug.Logger.Level.FINEST FINEST indicates a highly detailed tracing message.
FINER goog.debug.Logger.Level goog.debug.Logger.Level.FINER FINER indicates a fairly detailed tracing message.
FINE goog.debug.Logger.Level goog.debug.Logger.Level.FINE FINE is a message level providing tracing information.
CONFIG goog.debug.Logger.Level goog.debug.Logger.Level.CONFIG CONFIG is a message level for static configuration messages.
INFO goog.debug.Logger.Level goog.debug.Logger.Level.INFO INFO is a message level for informational messages.
WARNING goog.debug.Logger.Level goog.debug.Logger.Level.WARNING WARNING is a message level indicating a potential problem.
SEVERE goog.debug.Logger.Level goog.debug.Logger.Level.SEVERE SEVERE is a message level indicating a serious failure.
SHOUT goog.debug.Logger.Level goog.debug.Logger.Level.SHOUT SHOUT is a message level for extra debugging loudness.
OFF goog.debug.Logger.Level goog.debug.Logger.Level.OFF OFF is a special level that can be used to turn off logging.

Method Detail

<static> configureLogging(logConfig)

Configures the logger with a logConfig object.
Parameters:
Name Type Description
logConfig Object A collection of name/value pairs.

<static> getNumericStyleProperty(style, prop) → {number}

Returns the property of the CSS element as a number.
Parameters:
Name Type Description
style Object The style object of a DOM element.
prop string The property you want to get.
Throws:
pureweb.NullArgumentException

<static> getParameterByName()

Parses a URL and returns the requested query parameter value, or an empty string.

<static> getTagContent(tagName, xmlString, opt_idx) → {?}

Returns the text content of the XML node for the specified tag name, given a string containing XML. Will return null if the tag name doesn't exist.
For example, getTagContent('name', 'Fred') will return 'Fred'.
Parameters:
Name Type Argument Description
tagName string The name of the tag, without angle brackets.
xmlString string The XML string containing the open and closing tags, as well as the content.
opt_idx number <optional>
The nth occurrence of the tag in the XML document; defaults to 0.

<static> parseBoolean(value) → {boolean}

Parses a string, returning a primitive Boolean value of true or false. Interprets null as false.
Parameters:
Name Type Argument Description
value string <nullable>
The string to be converted to a Boolean value.

<static> parseNumber(value) → {number}

Parses the specified string, returning a primitive number value.
Parameters:
Name Type Argument Description
value string <nullable>
The string to be converted to a Boolean value.

<static> startLogging()

Sets up a logging console to receive log messages.

<static> tryParse(value, type) → {*}

Returns the native JS format based on a value and a type. Will return null if no conversion was possible.
Parameters:
Name Type Argument Description
value string <nullable>
The value to parse.
type function The constructor function for the type to convert into. Note that Boolean (object) will return a boolean (primitive); Number (object) will return a number (primitive).
Throws:
pureweb.NullArgumentException