Wednesday 7th May 2008

by Sajith M.R

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

Tags: , , , , ,

· · · ◊ ◊ ◊ · · ·

34 Responses to “Gmail Chat Implementation”

  1. hichem says:

    like you want sara

  2. Sarada says:

    Getting page not found for http://www.sajithmr.com/gtalk/

  3. Saumya says:

    hello sir, I’m basic learner of .net framework with AJAX features & doing my project on similar application. Please send me source code for this application..

    so i can get some idea.

    Really gr8 work done.
    Thanks in anticipation.

  4. Neha says:

    sir,
    i think its a nice idea .
    could you please forward the code to me.
    i need it….

    thanks…

    waiting…!!!

  5. Sami says:

    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

  6. subha says:

    can u plz send me the source code for chat application

  7. keerthi says:

    can u plz send me the source code for chat application

  8. Medha says:

    Hi Sajith,

    The above demo links are not working. Will youplease update it?

    Thanks in advance.

  9. Krishnakumar PS says:

    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

  10. Rahul Wadekar says:

    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 ?

  11. Rahul Wadekar says:

    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,

  12. Goitom says:

    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

  13. Goitom says:

    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

  14. yunus says:

    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.

  15. Saboor says:

    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.

  16. Poobalan says:

    hi, very nice article… i need to develop a chat system like gmail..
    can you give me some code ,,
    please help me……..

  17. Zuhaib says:

    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?

  18. mohanv says:

    i want more sexy photos pls send my email id

  19. Michael M. says:

    My nod Google – (Am at the good e-mail and website!!!)

  20. Yaci says:

    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 :)

  21. jesima says:

    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

  22. priyesh says:

    Sir,
    Can U pls send me the whole code..

  23. vivek says:

    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

  24. sagay says:

    hey,
    its very cool… Is there any script to find out the invisible chat persons in gmail ?… thanks in advance

  25. M.V.Chowdary says:

    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

  26. Raja says:

    Hi,
    good work.
    Do u have facebook like chat source
    Plz if u hav send me
    thanks.

  27. 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

  28. Sajith M.R says:

    @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

  29. 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.

  30. Sajith M.R says:

    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

  31. vikas says:

    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

  32. sanils says:

    This is cool implementation in the client side.

· · · ◊ ◊ ◊ · · ·

Leave a Reply

وظائف 2011 تحويل العملات برامج برنامج تسريع التحميل برنامج الفلاش برنامج محول الصوتيات عربي hotel 2011 زيادة رواتب العساكر 1431