goog.tweak.Registry
Classgoog.tweak.Registry(queryParams, compilerOverrides)
Singleton that manages all tweaks. This should be instantiated only from goog.tweak.getRegistry().
queryParams
{string
}
compilerOverrides
{!Object
.<string
|number
|boolean
>}
.addOnRegisterListener(func)
Adds a callback to be called whenever a new tweak is added.
func
{!Function
}
.extractEntries(excludeChildEntries, excludeNonSettings)
Creates and returns an array of all BaseSetting objects with an associted query parameter.
excludeChildEntries
{boolean
}
excludeNonSettings
{boolean
}
Array
.<!goog.tweak.BaseSetting
>}
.getBooleanSetting(id)
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.
id
{string
}
goog.tweak.BooleanSetting
}
.getEntry(id)
Returns the BaseEntry with the given ID. Asserts if it does not exists.
id
{string
}
goog.tweak.BaseEntry
}
.getNumericSetting(id)
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.
id
{string
}
goog.tweak.NumericSetting
}
.getStringSetting(id)
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.
id
{string
}
goog.tweak.StringSetting
}
.hasEntry(id)
id
{string
}
boolean
}
.makeUrlQuery(opt_existingSearchStr)
Returns the query part of the URL that will apply all set tweaks.
opt_existingSearchStr
{string
=}
string
}
.overrideDefaultValue(id, value)
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.
id
{string
}
value
{string
|number
|boolean
}
.parseQueryParams(queryParams)
Simple parser for query params. Makes all keys lower-case.
queryParams
{string
}
Object
.<string
>}
.register(entry)
Registers the given tweak setting/action.
entry
{goog.tweak.BaseEntry
}