Chatjs

Facebook style jQuery plugin for instant messaging.

View the Project on GitHub andrerpena/chatjs

Welcome to ChatjS

ChatJS is a jQuery plugin for instant messaging. It's completely client-side, so it's completely platform agnostic.

Server side communication is implemented through Adapters. The adapter is the piece of code that is responsible for handling client/server communucation. ChatJS comes with a demo adapter that you can see running in the bottom right of this page. It's just an echobot that will repeat what you say. You can use it as a boilerplate to implement your own. The server portion of your solution will be written according to the adapter specification.

I intend to display here a list of all adapter implementations. ASP.NET MVC coming soon.

Once your server code is ready, that's how ChatjS looks in the client:

<script type="text/javascript">
    $(function () {
        $.chat({
            userId: 1,
            roomId: 1,
            typingText: ' is typing...',
            emptyRoomText: "There's no one around here.",
            chatJsContentPath: '/basics/chatjs/',
            adapter: new DemoAdapter()
        });
    });
</script>

Contributing

Pull requests are very welcome.

If you want to implement an adapter, that's very welcome too. Please let me know if you need assistance by submitting a GitHub issue. I have a tight schedule but I'll answer as I have time.

ChatJS is written in TypeScript. If you are not familiar with it, TypeScript has a flat learning curve, as it's a JavaScript superset. If know JavaScript, you know TypeScript, except for the aspects in which it adds to the language.

I develop ChatJS in Visual studio because it's the IDE that i'm most used to and it has great typescript support. Alternatively, you can use WebStorm or simply use your editor of choice and the NPM TypeScript Transpiler to make it into vanilla JavaScript.