1/* 2 Callback function that is called immediately after JivoChat is loaded 3*/ 4function jivo_onLoadCallback() { 5 // Create a DIV element for the label 6 window.jivo_cstm_widget = document.createElement('div') 7 jivo_cstm_widget.setAttribute('id', 'jivo_custom_widget') 8 document.body.appendChild(jivo_cstm_widget) 9 10 jivo_cstm_widget.textContent = window.jivo_text 11 12 // Adds handlers click on the icon - to maximize the window when clicked 13 jivo_cstm_widget.onclick = function () { 14 jivo_api.open() 15 } 16 17 // Change the CSS class if there are agents online 18 if (jivo_config.chat_mode == 'online') { 19 jivo_cstm_widget.setAttribute('class', 'jivo_online') 20 jivo_cstm_widget.textContent = window.jivo_text_online 21 } 22 23 // Now you can show the user a shortcut 24 window.jivo_cstm_widget.style.display = 'flex' 25} 26 27/* 28 Callback function jivo_onOpen and jivo_onClose called whenever the chat window JivoChat is expanded or collapsed by the user or by the proactive invitations rule. 29*/ 30function jivo_onOpen() { 31 // If chat is deployed - hide shortcut 32 if (jivo_cstm_widget) jivo_cstm_widget.style.display = 'none' 33} 34 35function jivo_onClose() { 36 // If chat is minimized - show label 37 if (jivo_cstm_widget) jivo_cstm_widget.style.display = 'block' 38} 39
40function jivo_onWidgetDestroy() { 41 document.getElementById("jivo_custom_widget").remove(); 42 document.getElementById("jivo-iframe-container").remove(); 43}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.