new SettingsPage()
A page which can be configured with widgets
- Source:
Extends
- BasePage
Members
-
configModel :ConfigModel
-
Model to use for configuration
Type:
- ConfigModel
- Default Value:
-
- {}
- Source:
-
groupClass :String
-
CSS class to use for widget groups
Type:
- String
- Default Value:
-
- span4
- Source:
-
icon :String
-
Icon for the page
Type:
- String
- Default Value:
-
- icon-cog
- Source:
-
routeEvent :String
-
Event name to observe on router
Type:
- String
- Default Value:
-
- route:settings
- Source:
-
router :Backbone.Router
-
Backbone Router used for navigating to specific widgets
Type:
- Backbone.Router
- Default Value:
-
- {}
- Source:
-
routeRoot :String
-
Type:
- String
- Default Value:
-
- ''
- Source:
-
SaveModalConstructor :Backbone.View
-
Constructor function for the save modal
Type:
- Backbone.View
- Default Value:
-
- ValidateOnSaveModal
- Source:
-
scrollSelector :String
-
Page element to scroll
Type:
- String
- Default Value:
-
- ''
- Source:
-
<abstract> strings :SettingsPageStrings
-
Strings for the settings page.
Type:
- SettingsPageStrings
- Default Value:
-
- {}
- Source:
-
template :function
-
Template for the view
Type:
- function
- Source:
-
validateUrl :String
-
Url to which config will be posted for validation
Type:
- String
- Default Value:
-
- ''
- Source:
-
<abstract> vent :Vent
-
Instance of Vent used for navigation
Type:
- Vent
- Source:
-
widgetGroupParent :String
-
CSS selector for the DOM element that the widget groups will be attached to
Type:
- String
- Source:
-
widgetGroups :Array.<Array.<module:settings/js/widget.Widget>>
-
Array of groups of widgets, where each widget group is itself an array. With the default settings each
group should contain at most three widgets. widgetGroups can also be initialized in initializeWidgetsType:
- Array.<Array.<module:settings/js/widget.Widget>>
- Default Value:
-
- []
- Source:
-
widgets :Array.<module:settings/js/widget.Widget>
-
Array containing all of the widgets.
Type:
- Array.<module:settings/js/widget.Widget>
- Default Value:
-
- []
- Source:
Methods
-
canLeavePage() → {boolean}
-
- Source:
Returns:
Returns true if the user has unsaved changes, or false otherwise
- Type
- boolean
-
getConfig() → {Object}
-
Returns the combined configuration from all of the widgets
- Source:
Returns:
- Type
- Object
-
handleBeforeUnload() → {String|undefined}
-
Event listener for window unload events
- Source:
Returns:
this.strings.confirmUnload if the user has unsaved changes, or undefined
otherwise- Type
- String | undefined
-
handleCancelButton() → {boolean}
-
Opens a confirm modal which will restore changes to configuration if accepted.
Called when the user presses the restore changes button- Source:
Returns:
false
- Type
- boolean
-
handleRouting(configItem)
-
called when navigating to the page.
Parameters:
Name Type Description configItemThe configItem whose widget should be opened and scrolled to
- Source:
-
handleSubmit(e) → {boolean}
-
Opens a modal which allows the
user to submit changes to the configuration.Parameters:
Name Type Description eEvent The jQuery event object
- Source:
Returns:
false
- Type
- boolean
-
<abstract> initializeWidgets()
-
Method for initializing this.widgetGroups
- Source:
-
loadFromConfig()
-
Updates each widget with the appropriate config item from the configModel. Called when the config model
loads- Source:
-
onConfigSaved(config)
-
Callback which will be called when the save is complete; can be overridden by subclasses.
Parameters:
Name Type Description configthe saved configuration
- Source:
-
render()
-
Renders the settings page. This will render all the widgets and append them to the page
- Source:
-
scrollToWidget(widget)
-
Scrolls the given widget into view
Parameters:
Name Type Description widgetmodule:settings/js/widget.Widget The widget to scroll to
- Source:
-
validate(widgets)
-
Validate the config in the given widgets by posting to validateUrl.
Parameters:
Name Type Description widgetsmodule:settings/js/widget.Widget | Array.<module:settings/js/widget.Widget> The widgets to validate
- Source:
Type Definitions
-
DescriptionCallback(systemProperty, path)
-
Parameters:
Name Type Description systemPropertyThe name of the system property containing the config file
pathThe path to the config file
- Source: