SettingsView

web/SettingsView~ SettingsView

This class handles the rendering of and interaction with the settings.

Constructor

new SettingsView()

Description:
  • Constructor

Source:

Methods

bindSaveSettings(handle)

Description:
  • Bind the form to the event handler.

    A change in any field of the form will trigger the form validation. If the field input is not valid, an error message will be shown and the Generate button will be disabled. If the field input is valid the modified settings will be saved and the Generate button will be enabled.

    Save the modified settings to generate passwords based on these new settings

Source:
Parameters:
Name Type Description
handle function

pass control to the Controller

disableGenerateButton(state)

Description:
  • disable the Generate button to avoid errors in password generation

Source:
Parameters:
Name Type Description
state boolean

if true then disable the button

renderConfigError(e)

Description:
  • Render the error caused by the imported configuration Hide the fields because they cannot be updated Disable the Generate button because behaviour is unpredictable

Source:
Parameters:
Name Type Description
e Error

error object with the message to display

renderSettings(preset)

Description:
  • Update the fields in the settings with the contents of the current preset

Source:
Parameters:
Name Type Description
preset Object

settings belonging by the current preset

resetConfigError()

Description:
  • Reset the error indications

Source:

setErrorMessage(t)

Description:
  • Set the error message and show it or hide it on empty message

Source:
Parameters:
Name Type Description
t string

text or empty

showSettings()

Description:
  • Open the accordion to show the settings

Source: