product icon

How to Print the Chatlog

Articles related to customization are written for a technical audience who have experience in web development. Knowledge of HTML, CSS, and JavaScript are required.

You can learn from this article how to print the chatlog.

File to edit: LanguagesForChatOnlyMode.js

var ic_hic_demo_timer = null;
ic_hic_demo_timer = setInterval(ic_hic_demo_timer_checkobject, 100);
function ic_hic_demo_timer_checkobject()
{
  if ((ICObject != null) && (ICObject.pChatLog != null) && (ICObject.pMainContentArea != null))
  {
    clearInterval(ic_hic_demo_timer);
    ICObject.MyCustomDiv = document.createElement("div");
    ICObject.MyCustomDiv.className = "demoButton";
    ICObject.MyCustomDiv.onclick = function () { ic_hic_demo_print(); }
    ICObject.MyCustomDiv.innerHTML = "Print<br />Chat<br />Log";
    ICObject.pMainContentArea.appendChild(ICObject.MyCustomDiv);
  }
}
function ic_hic_demo_print()
{
  var ic_hic_demo_window = window.open("", "", "toolbar=no, status=no, directories=no,
 menubar=no, titlebar=no, location=no, scrollbars=no, resizable=no, height=500, width=500,
 left=10, top=10");
  ic_hic_demo_window.document.open();
  ic_hic_demo_window.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title></title>');
  ic_hic_demo_window.document.write('<link type="text/css" rel="stylesheet"
href="https://secure.GoToLogMeIn Rescue.com/InstantChat/Standard/InstantChat.css" />'); 
  ic_hic_demo_window.document.write('</head><body style="font-family: tahoma, arial,
 verdana; font-size: 11px">'); 
  ic_hic_demo_window.document.write(ICObject.pChatLog.innerHTML);
  ic_hic_demo_window.document.write("</body></html>");
  ic_hic_demo_window.document.close();
  ic_hic_demo_window.print();
  ic_hic_demo_window.close();
}

File to edit: InstantChat.css

.demoButton
{
  position: absolute; 
  left: 94px;
  top: 32px;
  width: 50px;
  height: 43px;
  text-align: center;
  cursor: pointer;
  background-color: red;
  z-index: 2000;
}
Article last updated: 27 September, 2022