Contents
Commands
setTheme
Sets the theme for Genesys Widgets from the list of registered themes. Default themes are 'light' and 'dark'. You can register as many new themes as you need.
Options
| Option | Type | Description |
|---|---|---|
| theme | string | Name of the theme you want to use. This name is specified in window._genesys.main.themes. Default themes are 'light' and 'dark'. |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | Theme exists and is successfully changed | The name of the theme that was chosen. e.g. 'light' |
| rejected | 'Invalid theme specified' |
getTheme
Get the CSS classname for the currently selected theme.
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | Always | CSS classname for the currently selected theme. e.g. 'cx-theme-light' |
| rejected | Never |
reTheme
Accepts an HTML reference (either string or jQuery wrapped set) and applies the proper CSS Theme Classname to that HTML and returns it back. When widgets receive the 'theme' event from App, they pass-in their UI containers into App.reTheme to have the old theme classname stripped and new classname applied.
Options
| Option | Type | Description |
|---|---|---|
| html | string or jQuery Wrapped Set | HTML string or jQuery Wrapped Set you want to have modified. |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When HTML is provided and theme is updated | HTML that was passed-in and modified |
| rejected | When no HTML is provided | 'No HTML provided by [plugin name]' |
themeDemo
Start an automated demo of each theme. All registered themes will be applied with a default delay between themes of 2 seconds. You can override this delay. This command is useful for comparing themes or testing themes with official or custom widgets.
Options
| Option | Type | Description |
|---|---|---|
| delay | number | Number of milliseconds between theme changes. Default value is 2000 milliseconds. |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | Always | |
| rejected | Never |
setLanguage
Options
| Option | Type | Description |
|---|---|---|
| lang | string | Change the language of Genesys Widgets. Switches all strings in Widgets to selected language. |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When language successfully changed | |
| rejected | When no language code is provided | No language code provided |
| rejected | When no matching language code is specified in your language pack | No matching language code found in language pack |
closeAll
Publishes the 'App.closeAll' event that requests all widgets to close.
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | Always | |
| rejected | Never |
