Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miguelcastillo/semrequirechat
https://github.com/miguelcastillo/semrequirechat
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/miguelcastillo/semrequirechat
- Owner: MiguelCastillo
- License: mit
- Created: 2014-04-11T17:52:14.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-04-14T19:41:00.000Z (over 10 years ago)
- Last Synced: 2024-10-19T20:06:13.570Z (18 days ago)
- Language: JavaScript
- Size: 453 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
semRequireChat
==============SEM.js RequireJS skeleton demo app
1. This application has probably the most basic RequireJS setup you need to know.
2. It has a main.js, which is the main module (entry point) for the app; analogous to main function in other languages.
3. It has an index.html that ties requirejs, requirejs configuration, and the main module.
4. It has a chat module, which connects tosemrequirejs.herokuapp.com
and is located incommon/js/chat.js
.So, why does this even exist? The purpose is really to let folks get aquainted with a RequireJS infrastructure.
Instruction
==============
1. Download the zip.
2. Look at index.html to inspect how things tie together.
3. Open main.js, which is the main module and its currently empty for you to fill in.
4. Define a RequireJS module and import the chat module.
6. Create a chat module instance.new Chat();
.
7. Send a message with thesend
interface.
8. Level up 1: read and display all the messages using thegetAll
interface.
9. Level up 2: delete a message you have posted. DO NOT USE clearAll!Chat API
==============
1.Chat
is a constructor that optionally takes in a jQuery instance. You don't need to pass anything in, unless you intend to customize where the chat module writes messages to. Instantiate with a code likevar chat = new Chat();
. Located incommon/js/
.
2.send
is an interface that takes in a message as the first parameter and optionally an email address as the second one. The email address is only used to resolve your picture from avatar.com.
3.get
interface that takes in an ID and returns a particular message.
4.getAll
interface that returns all messages in the system.
5.clear
interface that takes in an ID of a message to delete.