Giter Club home page Giter Club logo

chat's Introduction

Build Status

The GoInstant Chat widget provides real-time messaging inside a room of your application.

Chat

Sign up and build a GoInstant application today. You can learn more in our guides, and documentation.

Have questions? Contact us using this form or chat with us on IRC. #goinstant on Freenode.

Packaging

For your convenience, we've packaged the Chat widget in several ways.

Using our CDN

We host a copy on our CDN. Have a look at the docs to see how to reference those files, as well as how to initialize the component.

How do I build the script myself?

You may have your own build process. We've tried to make it easy to include the Chat widget in your build process.

Bower

We've packaged the Chat widget as a bower component.

bower install goinstant-chat

Component

We've packaged the Chat widget as a component.

component install goinstant/chat

Contributing

Development Dependencies

Set-Up

The following assumes that you have already installed the dependencies above.

git clone https://github.com/goinstant/chat.git
cd chat
npm install

Building Chat for Development

The Chat widget is built as a component. Feel free to manually install dependencies and build using the component command line tool.

For convenience, we've included a simple grunt command for installing component dependencies and building:

grunt build

If this command runs succesfully you'll now have components and build directories in your Git repo root.

Running Tests

Tests are written in mocha. They're run in an HTML file.

Just open the test/index.html file to run the tests.

On Mac OS, you can just run this command to open the HTML Runner in your default browser:

open test/index.html

Running Examples

This will open up an example of Chat at work, using your local build.

You should have run grunt build already.

1. Copy the example config.

cp config/config.example.js config/config.js

2. Replace the connectUrl with your GoInstant application's connectUrl.

If you haven't signed up for GoInstant yet, you can sign up and create an application here.

After you have an application's connectUrl, set inside of config.js:

config.js
window.config = {
  connectUrl: 'https://goinstant.net/YOUR_ACCOUNT/YOUR_APP',
  room: 'goinstant-widget-examples'
};

3. Open the example index and click an example.

open examples/index.html

Widgets are built on top of GoInstant

GoInstant is an API for integrating realtime, multi-user functionality into your app. You can check it out and sign up for free.

License

© 2013 GoInstant Inc., a salesforce.com company

Licensed under the BSD 3-clause license.

chat's People

Contributors

ntassone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chat's Issues

tests: sinon error: key#on

sinon error: TypeError: argument at index 2 is not a function: undefined

culprite:

on: sinon.stub().callsArg(2)

Move collapse class to wrapper

Currently the collapse button toggles a class .collapsed on a few individual elements, it should be applied to .gi-chat with the class name .gi-collapsed to keep consistent with the other widgets (user-list specifically).

Store message in progress

If I am typing a message and navigate to another page with the chat widget, it would be nice if my chat message I was in the middle of typing was there on the next page. Currently, when you leave the current page, you lose everything in your text box.

EDIT: This will help if someone navigates during a collaboration bundle session, and the people they're in the session with are typing at the time.

template: avatarUrl susceptible to XSS

The avatarUrl var in the message-template is susceptible to XSS, since it is inserted into our CSS without sanitation and users have permission the set the avatarUrl to anything.

This should be moved out of the template to use DOM instead. Similar to message text.

Emotes Feature

Add a generic set of emotes :) ;) :O :( ...
Maybe add an option for adding custom emotes.

tests stub usercache internals

The tests are stubbing the user cache internals instead of the user cache interface itself meaning that these tests will need to be rewritten any time user cache changes.

Add Collapse Tracking

The widget should remember the open/closed status of a given user on their last page load. This enables multi-page apps to retain a memory rather than always loading closed or always loading open.

Idea - Use key expire to delete chat messages

This could be a good widget to validate our key expiry. Afaik it doesn't get much use in any of our other demo apps, so perhaps using it here to delete old messages (declared when widget is instantiated?) might be a good idea !

Launch tasks

Just want to get a checklist of what has to be done to launch the Chat Widget for real.

  • Tests
  • Documentation
  • Example
  • Basic styling
  • Security Review

What else?

New message indicators

Add new message indicators.

Options (default):

{
  windowBlink: true,
  chatBlink: true,
  blinkText: 'New Message',
  sound: true,
  soundURL: 'https://cdn.goinstant.net/widgets/chat/latest/chat/sounds/ding.mp3'
}
  1. windowBlink: If window is not focused, blink the page title with "New Message" until window gets focused.
  2. chatBlink: If chat is collapsed, blink the chat header with "New Message" until chat gets expanded.
  3. sound: If window is not focused or chat is collapsed play sound once.

Optimize message storage

Store a historical user list separately instead of storing the userObj in each message. Should only be storing the userId on each message.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.