« New Lotus Award (formerly know as beacon) category this year... | Main| Easy Sametime Meeting test page access. »

Sametime 7.5 emoticon hint and tip...

Category
One of the nice new features in the upcoming Sametime 7.5 is the addition of emoticons (finally I hear you say)
st75emoticons.jpg
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:
  1. 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
  2. Create a new folder on your Sametime server called "emoticons" location:
    \Lotus\Domino\Data\domino\html\sametime\stlinks\img\emoticons
  3. Copy all the Sametime 7.5 emoticons into this new folder
  4. 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...
  5. 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 smile.jpg 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

Comments

Gravatar Image1 - Nice job... now can you get my stlinks to work all the way? :p

Gravatar Image2 - Wow! I was doing real good until you got to step #4 and I am now very lost. Please help me!

Gravatar Image3 - @2 use the code in this file: http://www.instant-tech.com/blogs/ctyler.nsf/emoticons/CTYR-6SAQYY/$File/emoticoncode.txt

You can hit right mouse button on the link and choose save as to get to it, and open with notepad etc.

Gravatar Image4 - You should probably remove the :/ replace... messes up url's

Gravatar Image5 - around line 178 (with the mod) there is a couple of lines

//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

Gravatar Image6 -

Gravatar Image7 - Emoticon Emoticon Emoticon Emoticon Emoticon Emoticon

Gravatar Image8 - Emoticon Emoticon Emoticon Emoticon Emoticon Emoticon Emoticon

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::rolleyes:;-)