This page was last edited on May 11, 2018, at 12:35.
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('ClickToCall.open');
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.
Opens the ClickToCall UI.
oMyPlugin.command('ClickToCall.open', {
userData: {},
form: {
autoSubmit: false,
firstname: 'John',
lastname: 'Smith',
phonenumber: 9256349345
},
formJSON: {...}
}).done(function(e){
// ClickToCall opened successfully
}).fail(function(e){
// ClickToCall failed to open
});
Option | Type | Description |
---|---|---|
form | string | Object containing form data to prefill the ClickToCall form and optionally auto-submit the form. |
form.autoSubmit | boolean | Automatically submit the ClickToCall form. |
form.firstname | string | Value for the first name input entry field. |
form.lastname | string | Value for the last input name entry field. |
form.phonenumber | number | Value for the phone number input entry field. |
formJSON | object | A JSON object containing a custom registration form definition. See Customizable ClickToCall Registration Form |
userData | object | Arbitrary data that is attached with ClickToCall form submit request. Properties defined here are merged with default userData set in the configuration object. |
Status | When | Returns |
---|---|---|
resolved | When ClickToCall is successfully opened | n/a |
rejected | When ClickToCall is already open | 'already opened' |
Closes the ClickToCall UI.
oMyPlugin.command('ClickToCall.close').done(function(e){
// ClickToCall closed successfully
}).fail(function(e){
// ClickToCall is already closed
});
Status | When | Returns |
---|---|---|
resolved | When ClickToCall is successfully closed | n/a |
rejected | When ClickToCall is already closed | 'already closed' |
Minimize or unminimize ClickToCall UI.
oMyPlugin.command('ClickToCall.minimize').done(function(e){
// ClickToCall minimized successfully
}).fail(function(e){
// ClickToCall ignores command
});
Status | When | Returns |
---|---|---|
resolved | Always | n/a |
rejected | Never | n/a |