tweak.Registry Extends
Singleton that manages all tweaks. This should be instantiated only from goog.tweak.getRegistry().

Inheritance

Constructor

goog.tweak.Registry(queryParamscompilerOverrides)

Parameters

queryParams : string
Value of window.location.search.
compilerOverrides : !Object.<string | number | boolean>
Default value overrides set by the compiler.

Instance Methods

Public Protected Private
addOnRegisterListener(func)
Adds a callback to be called whenever a new tweak is added.
Arguments:
func : !Function
The callback.
code »
extractEntries(excludeChildEntriesexcludeNonSettings) !Array.<!goog.tweak.BaseSetting>
Creates and returns an array of all BaseSetting objects with an associted query parameter.
Arguments:
excludeChildEntries : boolean
Exclude BooleanInGroupSettings.
excludeNonSettings : boolean
Exclude entries that are not subclasses of BaseSetting.
Returns: !Array.<!goog.tweak.BaseSetting>  The settings.
code »
getBooleanSetting(id) !goog.tweak.BooleanSetting
Returns the boolean setting with the given ID. Asserts if the ID does not refer to a registered entry or if it refers to one of the wrong type.
Arguments:
id : string
The unique string that identifies this entry.
Returns: !goog.tweak.BooleanSetting  The entry.
code »
getEntry(id) !goog.tweak.BaseEntry
Returns the BaseEntry with the given ID. Asserts if it does not exists.
Arguments:
id : string
The unique string that identifies this entry.
Returns: !goog.tweak.BaseEntry  The entry.
code »
getNumericSetting(id) !goog.tweak.NumericSetting
Returns the numeric setting with the given ID. Asserts if the ID does not refer to a registered entry or if it refers to one of the wrong type.
Arguments:
id : string
The unique string that identifies this entry.
Returns: !goog.tweak.NumericSetting  The entry.
code »
getStringSetting(id) !goog.tweak.StringSetting
Returns the string setting with the given ID. Asserts if the ID does not refer to a registered entry or if it refers to one of the wrong type.
Arguments:
id : string
The unique string that identifies this entry.
Returns: !goog.tweak.StringSetting  The entry.
code »
hasEntry(id) boolean
No description.
Arguments:
id : string
The unique string that identifies this entry.
Returns: boolean  Whether a tweak with the given ID is registered.
code »
makeUrlQuery(opt_existingSearchStr) string
Returns the query part of the URL that will apply all set tweaks.
Arguments:
opt_existingSearchStr : string=
The part of the url between the ? and the #. Uses window.location.search if not given.
Returns: string  The query string.
code »
overrideDefaultValue(idvalue)
Sets a default value to use for the given tweak instead of the one passed to the register* function. This function must be called before the tweak is registered.
Arguments:
id : string
The unique string that identifies the entry.
value : string | number | boolean
The replacement value to be used as the default value for the setting.
code »
register(entry)
Registers the given tweak setting/action.
Arguments:
entry : goog.tweak.BaseEntry
The entry.
code »

Instance Properties

compilerDefaultValueOverrides_ :
A map of entry ID -> default value override for overrides set by the compiler.
Code »
defaultValueOverrides_ :
A map of entry ID -> default value override for overrides set by goog.tweak.overrideDefaultValue().
Code »
entryMap_ :
A map of entry id -> entry object
Code »
logger_ : goog.debug.Logger
The logger for this class.
Code »
onRegisterListeners_ :
List of callbacks to call when a new entry is registered.
Code »
parsedQueryParams_ :
The map of query params to use when initializing entry settings.
Code »

Static Methods

goog.tweak.Registry.parseQueryParams(queryParams) !Object.<string>
Simple parser for query params. Makes all keys lower-case.
Arguments:
queryParams : string
The part of the url between the ? and the #.
Returns: !Object.<string>  map of key->value.
code »

Package tweak

Package Reference