Class: SettingsPage

settings/js/settings-page. SettingsPage

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 initializeWidgets

Type:
Default Value:
  • []
Source:

widgets :Array.<module:settings/js/widget.Widget>

Array containing all of the widgets.

Type:
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
configItem

The 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
e Event

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
config

the 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
widget module: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
widgets module:settings/js/widget.Widget | Array.<module:settings/js/widget.Widget>

The widgets to validate

Source:

Type Definitions

DescriptionCallback(systemProperty, path)

Parameters:
Name Type Description
systemProperty

The name of the system property containing the config file

path

The path to the config file

Source:
Copyright 2013--2018 Micro Focus International plc. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
Documentation generated by JSDoc 3.4.3 on Fri Jun 22nd 14:40 2018 using the DocStrap template.