This page was last edited on April 7, 2017, at 19:09.
Comments or questions about this documentation? Contact us for support!
Once you've registered your own plugin on the bus, you can call commands on other registered plugins. Below we'll quickly register a new plugin on the bus using the global bus object.
var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin');
oMyPlugin.command('CallUs.open');
Opens the CallUs UI.
oMyPlugin.command('CallUs.open').done(function(e){
// CallUs opened successfully
}).fail(function(e){
// CallUs failed to open
});
Status | When | Returns |
---|---|---|
resolved | When CallUs is successfully opened | n/a |
rejected | When CallUs is already open | 'Already opened' |
Closes the CallUs UI.
oMyPlugin.command('CallUs.close').done(function(e){
// CallUs closed successfully
}).fail(function(e){
// CallUs failed to close
});
Status | When | Returns |
---|---|---|
resolved | When CallUs successfully closed | n/a |
rejected | When CallUs is already closed | 'Already closed' |
Internal use only. The main App plugin shares configuration settings to widgets using each widget’s configure command. The configure command can only be called once at startup. Calling configure again after startup may result in unpredictable behavior.
oMyPlugin.command('CallUs.configure', {
contacts: [
{
displayName: 'Payments',
i18n: 'Number001',
number: '1 888 436 3797'
}
],
hours: ['8am - 8pm Mon - Fri']
}).done(function(e){
// CallUs configred successfully
}).fail(function(e){
// CallUs failed to configure
});
Option | Type | Description |
---|---|---|
contacts | Array | An array of objects that represent phone numbers and their labels. The first number in this list will display as the larger, main number. |
hours | Array | Array of strings to show stacked in the business hours section. Strings here are freeform. |
Status | When | Returns |
---|---|---|
resolved | When CallUs configuration is provided | n/a |
rejected | When no configuration provided | 'Invalid Configuration' |