Conditional Chat Example (Always present link)
Demo of RightNow Syndicated Conditional Chat API
HTML
<script src="http://cx.rightnow.com/euf/rightnow/RightNow.Client.js"></script>
<h1>Syndicated Conditional Chat Demo</h1>
<div id="myChatLinkContainer">
<div id="myChatLink">Start Chat</div>
<span class="lead" id="myChatLinkInfo">
</span>
</div>
CSS
@import url('//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css');
JavaScript
RightNow.Client.Controller.addComponent(
{
container_element_id: "myChatLinkContainer",
info_element_id: "myChatLinkInfo",
link_element_id: "myChatLink",
instance_id: "sccl_0",
module: "ConditionalChatLink",
open_in_new_window:false,
label_available_with_wait_template: "Current Wait time: {TIME}",
label_unavailable_busy_template: "Current Wait time: {TIME}",
wait_threshold: 86400, //One day
ignore_preroute: false,
min_sessions_avail: 0,
enable_availability_check: true,
enable_polling: true,
type: 7
},
"https://coveredca.widget.custhelp.com/ci/ws/get"
);
//Widget loaded callback
RightNow.Client.Event.evt_widgetLoaded.subscribe(function (event_name, data) {
console.log(RightNow.Client.Event);
if (data[0].id == "sccl_0") {
console.log(sccl_0);
window.launchChat = function()
{
sccl_0.chatLinkClicked(sccl_0);
}
}
});