GithubHelp home page GithubHelp logo

freedomdebug / green-chat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from konukk/green-chat

0.0 2.0 0.0 1.25 MB

A simply web im, javascript chat ui component. javascript即时聊天组件

HTML 0.64% PHP 1.99% CSS 7.67% JavaScript 89.70%

green-chat's Introduction

green-chat

A simply web im, javascript chat ui component. javascript即时聊天组件

功能

  • 单人聊天
  • 在线、下线状态
  • 信息发送状态
  • 聊天历史记录
  • 兼容IE8+(IE7未测试)、chrome等主流浏览器

CHANGE LOGS

  • 添加发送表情功能

TODO

  • 群聊
  • 移动端适配

项目说明

  • 组件间通过事件驱动,详见代码

  • 组件依赖(jquery, EventEmitter, nanoScroller, avchat.js, web_socket.js等)

  • 项目基于LeanCloud Javascript Chat实现

    1. 实现了 获取聊天记录-conversation.php, 签名认证-signature.php
    2. 如使用本项目代码需申请LeanCloud账号,将im.html, conversation.php, signature.php中的appId, appKey, masterKey做相应替换

    得说下签名认证(signature.php)的实现,略坑... 具体要求可见权限和认证,说下注意的点

      1. peerid 是“字符“,是字符不是数字
      2. 要实现Hmac-sha1算法,跟Base64什么的可没有关系。。。详见程序
      3. 最容易忽视的是:watch_peer_id这个变量,需要按照”字符“升序排序的,字符升序!
    

如何集成

  1. 加载相关依赖(详见例子im.html)

  2. 实现“获取联系人列表”接口(本例中的rosters.php)

  3. 初始化组件

Green.init({
    rostersUrl      : 'rosters.php', // 联系人列表接口
    conversationUrl : 'conversation.php',// 聊天记录接口
    authUrl         : 'signature.php'// 可选,签名认证接口
});

green-chat's People

Contributors

konukk avatar kongsheng avatar

Watchers

James Cloos avatar tommy.hu avatar

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.