Sametime 7.5 emoticon hint and tip...
Category None
One of the nice new features in the upcoming Sametime 7.5 is the addition of emoticons (finally I hear you say)
These look great in the new Sametime client, but if you're chatting with someone that may be on Sametime Links, you still get the text representation. It's really not very difficult to allow your Sametime links client to support the Sametime 7.5 emoticons, here's what you have to do:
By the way, this same code allows you to add emoticon support to prior versions of Sametime Links too. So if someone sends : - ) they receive
etc.
I'm sure someone that understands regular expressions better than me could have done a better job with my replace strings, but this works, it's free code, so I don't care
One of the nice new features in the upcoming Sametime 7.5 is the addition of emoticons (finally I hear you say)

These look great in the new Sametime client, but if you're chatting with someone that may be on Sametime Links, you still get the text representation. It's really not very difficult to allow your Sametime links client to support the Sametime 7.5 emoticons, here's what you have to do:
- Locate the Sametime 7.5 emoticons
After you install the Sametime 7.5 client, you can get the Sametime emoticons from the following directory:
C:\Documents and Settings\username\Application Data\Sametime\.metadata\.plugins\com.ibm.collaboration.realtime.palettes\palettes\Smileys - Create a new folder on your Sametime server called "emoticons" location:
\Lotus\Domino\Data\domino\html\sametime\stlinks\img\emoticons - Copy all the Sametime 7.5 emoticons into this new folder
- We need to update the Javascript contained in the file "chatApplet.html" to support the new emoticons. There is a chatApplet.html in each stlinks subdirectory example, en, fr, de etc. If you support multiple languages, you will need to update this file in each sub directory.
Within the chatApplet.html file find the function function parse(msg) the function ends with:
return msg;
}
Change those two lines to be:
//Code to allow for the Sametime 7.5 Emoticons
msg = msg.replace(/P|:\P/g, "<img src=..\\img\\emoticons\\EmoticonTongue.gif>");
msg = msg.replace(/\/:\)|\/:\)/g, "<img src=..\\img\\emoticons\\EmoticonEyebrow.gif>");
msg = msg.replace(/0)|0:\)/g, "<img src=..\\img\\emoticons\\EmoticonAngel.gif>");
msg = msg.replace(/:\'\(/g, "<img src=..\\img\\emoticons\\EmoticonCrying.gif>");
msg = msg.replace(/0|
o|
O|:\0|:\o|:\O/g, "<img src=..\\img\\emoticons\\EmoticonSurprised.gif>");
msg = msg.replace(/)|:\)/g, "<img src=..\\img\\emoticons\\EmoticonHappy.gif>");
msg = msg.replace(/lol/g, "<img src=..\\img\\emoticons\\EmoticonLaugh.gif>");
msg = msg.replace(/\;-\)|\;\)/g, "<img src=..\\img\\emoticons\\EmoticonWink.gif>");
msg = msg.replace(/|:D/g, "<img src=..\\img\\emoticons\\EmoticonBigSmile.gif>");
msg = msg.replace(/8-\)|8\)/g, "<img src=..\\img\\emoticons\\EmoticonCool.gif>");
msg = msg.replace(/@|:\@/g, "<img src=..\\img\\emoticons\\EmoticonAngry.gif>");
msg = msg.replace(//|:\//g, "<img src=..\\img\\emoticons\\EmoticonConfused.gif>");
msg = msg.replace(/(|:\(/g, "<img src=..\\img\\emoticons\\EmoticonSad.gif>");
msg = msg.replace(/$|:\$/g, "<img src=..\\img\\emoticons\\EmoticonShy.gif>");
msg = msg.replace(/S|:\S/g, "<img src=..\\img\\emoticons\\EmoticonGoofy.gif>");
msg = msg.replace(/\(\i\)/g, "<img src=..\\img\\emoticons\\EmoticonLightbulb.gif>");
msg = msg.replace(/\(y\)/g, "<img src=..\\img\\emoticons\\EmoticonThumbsUp.gif>");
msg = msg.replace(/\(n\)/g, "<img src=..\\img\\emoticons\\EmoticonThumbsDown.gif>");
msg = msg.replace(/rofl/g, "<img src=..\\img\\emoticons\\EmoticonHysterical.gif>");
return msg;
}
Hmm, the blog is automatically adding smilies for text, I don't know how to stop that so this emoticoncode.txt file contains the code. Use right mouse button on the link and select save target as... - Save the modifed chatApplet.html file
By the way, this same code allows you to add emoticon support to prior versions of Sametime Links too. So if someone sends : - ) they receive

I'm sure someone that understands regular expressions better than me could have done a better job with my replace strings, but this works, it's free code, so I don't care

Comments
Posted by Chris Miller At 12:44:17 PM On 08/04/2006 | - Website - |
Posted by Darryl At 12:31:02 PM On 02/02/2007 | - Website - |
You can hit right mouse button on the link and choose save as to get to it, and open with notepad etc.
Posted by Carl At 01:06:02 PM On 02/02/2007 | - Website - |
Posted by Jeffrey R Berg At 09:57:15 PM On 02/19/2007 | - Website - |
//var strParsedMsg = parse(message);
var strParsedMsg = new Chat_StringUtils( message );
These indicates to me that the function parse is not used but instead function Chat_StringUtils is.
Can someone clear that up for me as I am no JavaScript wizz
However, I did get this to work by adding lines like
str= this.ReplaceChar(str,'rofl', "<img src=..\\img\\emoticons\\EmoticonHysterical.gif>");
into the Chat_StringUtils function
p.s. Carl: I managed to get the other thing working too
Posted by lee At 01:40:52 PM On 03/20/2007 | - Website - |
Posted by hf fthyfyh At 12:25:57 PM On 04/18/2007 | - Website - |
Posted by medoune Gueye Ndoye At 01:45:25 PM On 11/10/2008 | - Website - |
Posted by null At 04:30:28 AM On 11/17/2011 | - Website - |