In my previous post I had described about the setup and run Live Chat with openfire webchat . Here is the tip to add the Smileys to the webchat .
In my previous post we were adding Live Chat facility to our web application with the help of Openfire and WebChat. If you configure it properly then you must do the chat with it.
Now lets add the smileys (emotions) to our webchat application .
Open the WebChat folder present in your webserver .D:Softwareapache-tomcat-6.0.35webappswebchat or (open you server location ).In side that folder you find a chatmain.jsp file .Open it in any text editor you like. Write the bellow code after line no 431 .OR where ever you want to put your smiley buttons in your page.
this is the table containing the smileys buttons. To activate this buttons you have to write some javascript functions.
Now write these javascript part in side your chatmain.jsp file any where .
function openImotion(){ document.getElementById('dpop').style.display = "block"; } function appendText(elementId,val){ var chatbox = document.f.chatbox; chatbox.value += val; document.getElementById('dpop').style.display = "none"; } Now the coding part is complete. Make sure that the emotions images are present in its given sources like in the code present int above code
snipet . src=”images/emoticons/heart.png” title=”heart” onclick=”appendText(‘chatbox’,'(heart) ‘);” border=”0″ />
Thats all for adding the emotions to your chat box. Add these to your given file and enjoy the smileys.
Read the blog more intresting things are coming on openfire and your chat box.