Skip to content

Commit

Permalink
added web basic sample with localcache
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisallo committed Sep 21, 2018
1 parent 561aeb8 commit d7a361e
Show file tree
Hide file tree
Showing 89 changed files with 8,959 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,5 +1,5 @@
# Created by .ignore support plugin (hsz.mobi)
web-widget/node_modules
package-lock.json
node_modules
.idea
.node_modules
8 changes: 8 additions & 0 deletions web-basic-sample-localcache/.babelrc
@@ -0,0 +1,8 @@
{
"presets": ["env"],
"env": {
"test": {
"presets": ["env"]
}
}
}
2 changes: 2 additions & 0 deletions web-basic-sample-localcache/.eslintignore
@@ -0,0 +1,2 @@

**/*.min.js
21 changes: 21 additions & 0 deletions web-basic-sample-localcache/.eslintrc.js
@@ -0,0 +1,21 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true
},
extends: 'eslint:recommended',
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
rules: {
'linebreak-style': ['error', 'unix'],
quotes: ['warn', 'single'],
semi: ['warn', 'always'],
'no-console': 1,
'no-unused-vars': 1,
'no-inner-declarations': 1,
'no-useless-escape': 1
}
};
2 changes: 2 additions & 0 deletions web-basic-sample-localcache/.prettierignore
@@ -0,0 +1,2 @@
README.md
.eslintrc.js
4 changes: 4 additions & 0 deletions web-basic-sample-localcache/.prettierrc
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"printWidth": 120
}
52 changes: 52 additions & 0 deletions web-basic-sample-localcache/README.md
@@ -0,0 +1,52 @@
# SendBird JavaScript Web Basic Sample with SyncManager
This is full screen chat sample like Slack using [SendBird SDK](https://github.com/smilefam/SendBird-SDK-JavaScript) for desktop browsers. SyncManager is included and applied.

- [SendBird JavaScript Web Basic Sample with SyncManager](#sendbird-javascript-web-basic-sample-with-syncmanager)
- [Demo](#demo)
- [Run the sample](#run-the-sample)
- [Customizing the sample](#customizing-the-sample)

## [Demo](https://sample.sendbird.com/basic/syncmanager)
You can try out a live demo from the link [here](https://sample.sendbird.com/basic/syncmanager).


## Run the sample
1. Install packages

> Require that you have Node v8.x+ installed.
```bash
npm install
```

2. Run

```bash
npm start
```

## Customizing the sample
If you want to put some changes into the sample, you should build it using `webpack`.

1. Install packages

> Require that you have Node.js v8.x+ installed.
```bash
npm install
```

2. Modify files
If you want to change `APP_ID`, change `APP_ID` in const.js to the other `APP_ID` you want.
You can test the sample with local server by running the following command.

```bash
npm run start:dev
```

3. Build the sample
When the modification is complete, you'll need to bundle the file using `webpack`. The bundled files are created in the `dist` folder. Please check `webpack.config.js` for settings.

```bash
npm run build
```
55 changes: 55 additions & 0 deletions web-basic-sample-localcache/chat.html
@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">

<link rel="icon" href="https://dxstmhyqfqr1o.cloudfront.net/favicon/favicon.ico?hash=d17264e5094efd195edf">
<link rel="shortcut icon" href="https://dxstmhyqfqr1o.cloudfront.net/favicon/favicon.ico?hash=d17264e5094efd195edf">
<link href='https://fonts.googleapis.com/css?family=Exo+2:400,900italic,900,800italic,800,700italic,700,600italic,600,500italic,500,400italic,300italic,200italic,200,100italic,100,300'
rel='stylesheet' type='text/css'>

<link rel="stylesheet" href="dist/sample.main.css">
<title>Basic Sample with SyncManager | SendBird</title>
</head>

<body>
<div class="body">
<div class="body-left">
<div class="body-left-top">
<div class="top-logo">
<img src="https://dxstmhyqfqr1o.cloudfront.net/web-basic/symbol_SendBird_positive.svg" width="50" height="50" class="logo-image">
</div>
<div class="top-text">
SendBird
</div>
</div>
<div class="body-left-list">
<div class="chat-type">
<div>GROUP CHAT</div>
<div>
<div class="icon-create-chat" id="group_chat_add"></div>
</div>
</div>
<div id="group_list" class="chat-list chat-list-group">
<div id="default_item_group" class="default-item">Start by inviting user to create a channel.</div>
</div>
</div>
<div class="body-left-bottom" id="user_info">
<div class="bottom-profile">
<img src="https://dxstmhyqfqr1o.cloudfront.net/web-basic/image-profile.svg" width="30" height="30" class="image-profile">
</div>
<div class="bottom-nickname">
<div class="nickname-title">username</div>
<div class="nickname-content"></div>
</div>
</div>
</div>
<div class="body-center"></div>
</div>
<script src="./dist/sample.main.js"></script>
</body>

</html>

0 comments on commit d7a361e

Please sign in to comment.