Gmail Chat Implementation
Posted on 07. May, 2008 by Sajith M.R in Downloads, php

Today i implemented gmail chat window , not an ajax chat with a chat server, but its client side implementation.
Here you can see the demo: http://www.sajithmr.com/gtalk/
Take this link in a new tab or window, and take any other website without closing it.
After 3 seconds , (Consider it as a new chat message arrived situation) you can see the google chat notification sound , and title changing. (I didn’t get the actual gtalk notification sound, so i used windows notify.wav file )
You know google (gmail) implemented its sound notification is via swf object. Here me too done the same.
I wrote two function to check whether the browser is in focus or not.
Here is the functions:
function lostFocus()
{
document.title = 'Sajith M.R Says...';
state = 'nonfocus';
played = 0 ;
changeColorRed();
alterTitle();
}
function gotFocus()
{
document.title = 'Gmail Inbox(1)';
state = 'focus';
played = 0 ;
}
The alterTitle() function calls in 3 seconds setTimeOut manner.
function alterTitle()
{
if(state =='nonfocus')
{
if ( document.title == 'Gmail Inbox(1)')
{
if(played == 0)
{
soundManager.play('notify');
played = 1;
}
document.title = 'Sajith M.R Says...';
}
else
document.title = 'Gmail Inbox(1)';
setTimeout("alterTitle()",3000);
}
}
The soundmanager.js file handles the swf flash object and sound triggering.
<script type=”text/javascript” src=”script/soundmanager.js”></script>
These three simple scripts together created this demo: http://www.sajithmr.com/gtalk/
If you want the whole source code , mail me: admin@sajithmr.com
Comment Please …
Regards
Sajith.M.R
http://www.sajith.name



sanils
May 7th, 2008
This is cool implementation in the client side.
vikas
Jun 16th, 2008
Hi,
I looking for hints to implement a gmail like chat, and reading your post has been very informative. Thanks a lot for such a good break of the functionality. It would be very kind of you, if you can send the source code for the gtalk demo you have put on your website.
Thanks a lot.
Regards,
vika
Sajith M.R
Jun 16th, 2008
Hey Vikas,
Here is the full source code of client side implementation .
(Not the sever side)
http://www.sajithmr.com/downloads/gtalk.zip
Regards
Sajith
Leonardo Parada
Jul 20th, 2008
Hello:
What need your code for work like an real chat?…AJAX?
I want put on GMAIL CHAT on my blog…I will thank your help please.
Thanks and Congratulations.
Sajith M.R
Jul 20th, 2008
@Leonardo Parada
Hello, i dont have gmail full chat code. If you want to put a gmail chat on your blog, you can use google widget for that purpose, no need to code yourself. Gtalk widget for any blog is currently available.
Regards
Sajith
Mohamed Hanifa
Jul 30th, 2008
Hi
How gmail chat get value from another client or user side windows value .Thats what icant under stand..and how its working . you were discuss about only title bar
message and focus changing.
Colud u explain breifly please..
Thanks & Regards
R.Mohamed anifa
Raja
Sep 29th, 2008
Hi,
good work.
Do u have facebook like chat source
Plz if u hav send me
thanks.
M.V.Chowdary
Oct 3rd, 2008
Hai,
I have seen the site and I am curious to know the program regarding Gmail Chat Implementation
will u send it to the above mentioned e-mail id
sagay
Nov 13th, 2008
hey,
its very cool… Is there any script to find out the invisible chat persons in gmail ?… thanks in advance
vivek
Nov 20th, 2008
hi
sir i m vivek khtrri
i m working on similar project but i coudnd make it good chat
so pls send me ur code if u dont mind
priyesh
Jan 9th, 2009
Sir,
Can U pls send me the whole code..
jesima
Jan 23rd, 2009
sir,
i have seen the chat application.since i m doing my project in chat application i need he source code of chat application.kindly send me the source code of chat application as soon as possible.
with regards,
jesima.s
Yaci
Jan 24th, 2009
Sajith M.R, is your flash file secure? Can anyone hack me with downloading other .xml file or something so…?
Thanks for the script, I’ll use it on my chat once will check all is secure
Michael M.
Feb 13th, 2009
My nod Google – (Am at the good e-mail and website!!!)
mohanv
Mar 8th, 2009
i want more sexy photos pls send my email id
Zuhaib
Mar 10th, 2009
This can be done without the help of flash also and is easy .. do you have any idea on how to implement push chat as in gtalk? or may b something about comet?
Poobalan
Apr 13th, 2009
hi, very nice article… i need to develop a chat system like gmail..
can you give me some code ,,
please help me……..
Saboor
Jun 25th, 2009
hi
i also want to implement a chatting like Gmail or FaceBook ,
please, email me the source code on saboorahmedawan@gmail.com , i will be thankful to you.
yunus
Jul 22nd, 2009
hi
i have seen the chat application.since i m doing my project in chat application i need he source code of chat application.kindly send me the source code of chat application as soon as possible.
Goitom
Jul 27th, 2009
My dear friend
I really appreciate Ur work and i am thankful for that .dear sir i would like to recommend me what language shall i use and how i can develop mail giving web like (gmail) ,what environment should I need (where to compile and run and other things).
And plz email me the source code for http://www.sajithmr.com/gtalk/
on my email sevastena@gmail.com
Goitom
Jul 28th, 2009
Dear sir
First and for most i would like to appreciate ur valuable work, that is very kind of you .
Dear sir
I am 2 year collage student and i would like to develope an email system like gmail for my summer project.but still I don’t have any idea .
Dear sir plz help me on the following problems if you can .
1) How i can develop a web based email giving server system like gmail?
2) what computer language do i need to study
3) what tools or environment do i need (that is to build and run the my project)?
4)what technology are they using behind
thanks for your coorpration.
plz post or direct to any of the sites that you u know. Hear form U ur response as soon as possible .
thanks
Rahul Wadekar
Aug 4th, 2009
Hey, i was looking for similar kind of implementation on website. Will you please tell me how the messages are updated on receiving new mesages.
Thanks,
Rahul Wadekar
Aug 4th, 2009
Well i accomplish the task with rad window..but it has its own limitations and not feasible. so trying to use a div implementation instead. What do u suggest ?
Krishnakumar PS
Sep 4th, 2009
When I clicked the link you mentioned (http://www.sajithmr.com/gtalk/), I got below Warning!
Reported Attack Site!
Safe Browsing – Diagnostic page for sajithmr.com/gtalk
Medha
Sep 29th, 2009
Hi Sajith,
The above demo links are not working. Will youplease update it?
Thanks in advance.
keerthi
Dec 23rd, 2009
can u plz send me the source code for chat application
subha
Jan 4th, 2010
can u plz send me the source code for chat application
Sami
Jan 9th, 2010
Dear Sir… I really appreciate you valuable work…you really did a very good work… God Bless you and
i am also developing a chatting box for my site which i am building using php with zend framework
Plz send me your code
Thank You
Neha
Jan 28th, 2010
sir,
i think its a nice idea .
could you please forward the code to me.
i need it….
thanks…
waiting…!!!