Sys

Sys

new Sys()

Description:
  • System class.
    Handles application & user configuration

Source:

Methods

getConfig(key) → {*}

Description:
  • Get config value

Source:
Since:
  • 4.4.4
Parameters:
Name Type Description
key String

Key setting

Returns:

The configuration from key

Type
*

off(evt, fn)

Description:
  • Removes an event

Source:
Since:
  • 4.3.20
Example
sys.off('saveConfig', (e, opt)=> {
	// do something
})
Parameters:
Name Type Description
evt String

Event name

fn function

Function to trigger

on(evt, fn)

Description:
  • Create a new event with JQuery eventing convenience
    Equal to $(window).on()

Source:
Since:
  • 4.3.20
Example
sys.off('saveConfig', (e, opt)=> {
	// do something
})
Parameters:
Name Type Description
evt String

Event name

fn function

Function to trigger

one(evt, fn)

Description:
  • Run the event once
    Trigger an event and immediately removes it

Source:
Since:
  • 4.3.20
Parameters:
Name Type Description
evt String

Event name

fn function

Function to trigger

setConfig(key, value) → {Boolean}

Description:
  • Set config value

Source:
Since:
  • 4.4.4
Parameters:
Name Type Description
key String

Key setting

value *

Value of the setting

Returns:

True if success

Type
Boolean

trigger(evt, fn)

Description:
  • Trigger an event

Source:
Since:
  • 4.3.20
Parameters:
Name Type Description
evt String

Event name

fn function

Function to trigger

Events

beforeSaveConfig

Description:
  • Triggered when configuration is about to be saved

Source:
Since:
  • 4.3.20
Properties:
Name Type Description
config Object

The configuration that will be saved (mutable)

loadConfig

Description:
  • Triggered when configuration is successfully loaded

Source:
Properties:
Name Type Description
config Object

The configuration that will be loaded (mutable)

saveConfig

Description:
  • Triggered when configuration is successfully saved

Source:
Since:
  • 4.3.20
Properties:
Name Type Description
config Object

The configuration that has been saved (mutable)