Output Desk JavaScript API allows you to customize versatile aspects of the Chat Window.
If you experience any problems with our JavaScript API implementation, please contact us at support@srimax.com
By default, your Chat Window will be shown as below.
Page Contents
Online/Offline Text Caption
<script> ODL("appearance",{ "online-title": "Chat Here Now" }); </script>
<script> ODL("appearance",{ "offline-title": "Offline Now" }): </script>
Customizing Chat Window
To customize the language & the appearance of the online Chat Window, use the following script.
<script> ODL("appearance",{ "name-text": "Nome", "email-text":"E-mail", "department-text": "Selezionare Dipartimento", "product-text": "Selezionare Prodotto", "phone-text": "Telefono", "message-text": "Messaggio", "button-text": "Invia", "bar-background-color": "#f1645d;#fec776", "bar-text-color": "#000", "button-background-color": "#f1645d;#fec776", "button-text-color": "#000" }); </script>
Parameters
- name-text – Changes the Placeholder with the equivalent translation(any language) for Name using this parameter.
- email-text – Changes the Placeholder with the equivalent translation(any language) for Email using this parameter.
- department-text – Changes the Placeholder with the equivalent translation(any language) for Department using this parameter.
- product-text – Changes the Placeholder with the equivalent translation(any language) for Product using this parameter.
- phone-text – Changes the Placeholder with the equivalent translation(any language) for Phone using this parameter.
- message-text – Changes the Placeholder with the equivalent translation(any language) for Message text using this parameter.
- button-text – Changes the button caption with equivalent translation(any language) of it using this parameter.
- bar-background-color – Changes the Output Desk Chat Bar(if Chat Type is selected as Bar) & Chat Bar/Chat Window Header’s background color.
- bar-text-color – Changes the Output Desk Chat Bar(if Chat Type is selected as Bar) & Output Desk Chat Bar Header/Chat Window’s text color.
- button-background-color – Changes the Chat window Submit Button’s background color.
- button-text-color – Changes the Chat window Submit Button’s Font color.
Customized Chat Form
Open/Close Chat Window
Use the following JavaScript to use any other button in your website to open or close the Live Chat Window.
<script> document.getElementById(“btn”).click = function() { ODL('openchat'); }; </script>
<script> document.getElementById(“btn”).click = function() { ODL('closechat'); }; </script>
Customize Chat Form
Use the given JavaScript to set value in the form fields in the Chat Form.
<script> ODL("formfields", { "name":"Wilson", "email":"wilson@gmail.com", "department":"Marketing", "product":"Output Messenger", "message": "Hello" "tags":"Srimax Users", "is_new_ticket": true, "is_auto_submit": true }); </script>
- “name”: – Set the name to be displayed in the Name field in the chat form.
- “email”: – Enter the email to be displayed in the Email field in the chat form.
- “department”: – Provide the department to be displayed in the Department field in the chat form.
- “product”: – Enter the product to be displayed in the Product field in the chat form.
- “message”: – Enter message to be displayed in the chat form by default.
- “tags”: – Set tag name for your websites & Display the tag name in your tickets.
- “is_new_ticket”: – Set this field as true to create a new ticket whenever an existing visitor chats.
- “is_auto_submit”: – Set this field as true to allow your visitors to auto submit the chat form automatically.
Form field values displayed in Ticket