(Update with the copy of version: draft) |
(Update with the copy of version: draft) |
||
Line 11: | Line 11: | ||
== configure == | == configure == | ||
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. | 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. | ||
− | + | <br /><br /> | |
== open == | == open == | ||
− | Opens the Offers Widget and renders an offer based on the options provided. If no options are provided, it renders the default offer defined in the configuration. | + | Opens the Offers Widget and renders an offer based on the JSON options provided. If no options are provided, it renders the default offer defined in the configuration. |
− | + | <br /><br /> | |
=== Example === | === Example === | ||
<source lang='javascript'> | <source lang='javascript'> | ||
oMyPlugin.command('Offers.open', { | oMyPlugin.command('Offers.open', { | ||
− | |||
mode:'overlay', | mode:'overlay', | ||
+ | modal:true, | ||
layout:'leftText', | layout:'leftText', | ||
title:'Offer Title', | title:'Offer Title', | ||
Line 25: | Line 25: | ||
body:'This is the body', | body:'This is the body', | ||
button:'Accept Offer', | button:'Accept Offer', | ||
− | + | cta:{ | |
+ | command: 'WebChat.open', | ||
+ | commandOptions: {'proactive': true,'userData': {'category': 'shoes'}}, | ||
+ | 'url': 'http://www.google.com', | ||
+ | 'target': '_blank' | ||
+ | }, | ||
video:'https://www.youtube.com/watch?v=########', | video:'https://www.youtube.com/watch?v=########', | ||
timeout: 11000, | timeout: 11000, | ||
+ | autoplay:true, | ||
+ | styles:{ | ||
+ | '.cx-body': { | ||
+ | 'background-color': '#FFFFFF', | ||
+ | 'color': '#008000' | ||
+ | } | ||
+ | } | ||
}); | }); | ||
</source> | </source> | ||
<br /> | <br /> | ||
− | |||
=== Options === | === Options === | ||
{| | {| | ||
Line 45: | Line 56: | ||
| Widget display type | | Widget display type | ||
| overlay, toaster | | overlay, toaster | ||
+ | |- | ||
+ | | modal | ||
+ | | boolean | ||
+ | | Smokescreen support option for overlay | ||
+ | | n/a | ||
|- | |- | ||
| layout | | layout | ||
| string | | string | ||
| Additional layout options for overlay | | Additional layout options for overlay | ||
− | | leftText, rightText | + | | leftText, rightText, minimal, stacked |
|- | |- | ||
| title | | title | ||
Line 71: | Line 87: | ||
| n/a | | n/a | ||
|- | |- | ||
− | | | + | | cta |
+ | | object | ||
+ | | An object containing the URL and/or CXBus command for call to action | ||
+ | | n/a | ||
+ | |- | ||
+ | | cta.command | ||
+ | | string | ||
+ | | A CXBus command to execute | ||
+ | | n/a | ||
+ | |- | ||
+ | | cta.commandOptions | ||
+ | | object | ||
+ | | Options related to CXBUs command | ||
+ | | n/a | ||
+ | |- | ||
+ | | cta.url | ||
| string - URL | | string - URL | ||
− | | URL for call to action | + | | URL string for call to action. |
+ | |||
+ | '''Note:''' The URL must be properly defined with the complete Protocol URL Address. For example, https://www.genesys.com | ||
| n/a | | n/a | ||
+ | |- | ||
+ | | cta.target | ||
+ | | string | ||
+ | | String to specify where to open the cta URL | ||
+ | | _blank, _parent, _self, _top, framename | ||
|- | |- | ||
| image | | image | ||
Line 85: | Line 123: | ||
| Video URL string, YouTube/Vimeo | | Video URL string, YouTube/Vimeo | ||
| n/a | | n/a | ||
+ | |- | ||
+ | | autoplay | ||
+ | | boolean | ||
+ | | Autoplay option for Video | ||
+ | | true, false | ||
|- | |- | ||
| timeout | | timeout | ||
| number | | number | ||
| Timeout integer in ms | | Timeout integer in ms | ||
+ | | n/a | ||
+ | |- | ||
+ | | countdownText | ||
+ | | string | ||
+ | | String for offer countdown text | ||
+ | | n/a | ||
+ | |- | ||
+ | | position | ||
+ | | object | ||
+ | | An object containing the properties for positioning the offers window | ||
+ | | left, right, top, bottom | ||
+ | |- | ||
+ | | styles | ||
+ | | object | ||
+ | | An object containing a custom CSS declarations | ||
| n/a | | n/a | ||
|- | |- | ||
|} | |} | ||
+ | <br /> | ||
=== Resolutions === | === Resolutions === | ||
Line 109: | Line 168: | ||
|- | |- | ||
|} | |} | ||
− | |||
== close == | == close == | ||
Closes an open offers widget. | Closes an open offers widget. | ||
− | + | <br /><br /> | |
=== Example === | === Example === | ||
<source lang='javascript'> | <source lang='javascript'> | ||
Line 118: | Line 176: | ||
</source> | </source> | ||
+ | <br /> | ||
=== Resolutions === | === Resolutions === | ||
{| | {| |
Revision as of 15:19, March 21, 2019
Contents
API Commands
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('Offers.open');
configure
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.
open
Opens the Offers Widget and renders an offer based on the JSON options provided. If no options are provided, it renders the default offer defined in the configuration.
Example
oMyPlugin.command('Offers.open', {
mode:'overlay',
modal:true,
layout:'leftText',
title:'Offer Title',
headline:'This is the headline',
body:'This is the body',
button:'Accept Offer',
cta:{
command: 'WebChat.open',
commandOptions: {'proactive': true,'userData': {'category': 'shoes'}},
'url': 'http://www.google.com',
'target': '_blank'
},
video:'https://www.youtube.com/watch?v=########',
timeout: 11000,
autoplay:true,
styles:{
'.cx-body': {
'background-color': '#FFFFFF',
'color': '#008000'
}
}
});
Options
Option | Type | Description | Accepted Values |
---|---|---|---|
mode | string | Widget display type | overlay, toaster |
modal | boolean | Smokescreen support option for overlay | n/a |
layout | string | Additional layout options for overlay | leftText, rightText, minimal, stacked |
title | string | String for widget title | n/a |
headline | string | String for Offer title header | n/a |
body | string | String for offer body text | n/a |
button | string | String for CTA button text | n/a |
cta | object | An object containing the URL and/or CXBus command for call to action | n/a |
cta.command | string | A CXBus command to execute | n/a |
cta.commandOptions | object | Options related to CXBUs command | n/a |
cta.url | string - URL | URL string for call to action.
Note: The URL must be properly defined with the complete Protocol URL Address. For example, https://www.genesys.com |
n/a |
cta.target | string | String to specify where to open the cta URL | _blank, _parent, _self, _top, framename |
image | string - URL | Image URL string | n/a |
video | string - URL | Video URL string, YouTube/Vimeo | n/a |
autoplay | boolean | Autoplay option for Video | true, false |
timeout | number | Timeout integer in ms | n/a |
countdownText | string | String for offer countdown text | n/a |
position | object | An object containing the properties for positioning the offers window | left, right, top, bottom |
styles | object | An object containing a custom CSS declarations | n/a |
Resolutions
Status | When | Returns |
---|---|---|
resolved | When configuration options are provided, valid and set | n/a |
rejected | When no valid configuration options are provided | 'Invalid configuration; detailed CXBus warning' |
close
Closes an open offers widget.
Example
oMyPlugin.command('Offers.close');
Resolutions
Status | When | Returns |
---|---|---|
resolved | When the widget is closed | n/a |
rejected | When the widget is already closed | 'CXBus warning.' |