-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
9,510 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2017 Joey Huang | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,75 @@ | ||
# rails-poker | ||
scrum poker in rails5, docker-compose | ||
## rails-poker | ||
[![Code Climate](https://codeclimate.com/github/cdphp/rails-poker/badges/gpa.svg)](https://codeclimate.com/github/cdphp/rails-poker) | ||
[![Build Status](https://travis-ci.org/cdphp/rails-poker.svg?branch=master)](https://travis-ci.org/cdphp/rails-poker) | ||
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) | ||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fcdphp%2Frails-poker.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fcdphp%2Frails-poker?ref=badge_shield) | ||
--- | ||
## info | ||
rails poker is a rails 5 based project.</br> | ||
and include a chatroom in it ;)</br> | ||
I start the project with a purpose to buid a demo for **rails5 + actioncable + reactjs**</br> | ||
i can't stop my keybord while i found much fun with it!</br> | ||
then i extend the actioncable demo to a nice chating app</br> | ||
and build a internal use online srum-poker app</br> | ||
|
||
I think this will help someone who is interested in actioncable and reactjs,</br> | ||
maybe this can be the starting example. | ||
## demo | ||
[Chat room](http://poker.miaowu.org/)</br> | ||
[scum poker](http://poker.miaowu.org/usersessions/new)</br> | ||
|
||
## FEATURES | ||
- **Chat Room** | ||
> 1. random displayname by session, everyday changes, very interesting | ||
> 2. user join/quit staus(some problem with the quit) | ||
> 3. some mark-down support | ||
> 4. send image by url | ||
> 5. kamoji support | ||
- **Scrum Poker** | ||
> 1. create room and send the url to participants | ||
> 2. subject can change every turn | ||
> 3. organizer can switch the room status, **ready** -> **start poking** -> **draw result** | ||
> 4. the participants status will be showed on the right | ||
> 5. the result will showing as a pie chart | ||
|
||
## Support | ||
|
||
For support please create an issue here at GitHub | ||
|
||
## Pull Requests | ||
|
||
Feel free to submit any PRs here, too. :) | ||
|
||
Please indent using two spaces only, have a newline at the EOF and use UNIX line ending, thanks! | ||
|
||
# development | ||
|
||
```bashshell | ||
# install docker and docker-compose beforehand | ||
# clone the repo | ||
git clone https://github.com/cdphp/rails-poker.git | ||
# create the database | ||
docker-compose run app /bin/bash | ||
root@3b552a0a5c99:/usr/src/app# mysql -hdb -p | ||
Enter password: root | ||
mysql> CREATE DATABASE IF NOT EXISTS poker default charset utf8 COLLATE utf8_general_ci; | ||
mysql> exit | ||
Bye | ||
root@3b552a0a5c99:/usr/src/app# rake db:migrate | ||
root@3b552a0a5c99:/usr/src/app# exit | ||
exit | ||
docker-compose up | ||
# http://localhost:3000 | ||
``` | ||
|
||
# contribute | ||
如果你有什么想法或者建议,请不要客气尽可以提出来。<br> | ||
show me your ideas, thanks! | ||
|
||
## test chats | ||
url: http://poker.miaowu.org/chats/new | ||
---- | ||
Built by (c) Joey Huang and contributors. Released under the MIT license. | ||
|
||
## test poker | ||
url: http://poker.miaowu.org/ | ||
## License | ||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fcdphp%2Frails-poker.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fcdphp%2Frails-poker?ref=badge_large) |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
poker/app/assets/javascripts/components/chat/emoji-box.js.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
class EmojiBox extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { kamojis: this.getKamojis() }; | ||
} | ||
|
||
componentDidMount() { | ||
} | ||
|
||
handleKamoji(e){ | ||
this.props.onClickEmoji(e.target.innerHTML + ' ') | ||
} | ||
|
||
render() { | ||
let ks = this.state.kamojis.map((kamoji, index) => { | ||
return this.renderKamoji(index, kamoji); | ||
}); | ||
return ( | ||
<div className="dropdown-menu emoji-box" aria-labelledby="dropdownMenuButton"> | ||
<ul> | ||
{ks} | ||
</ul> | ||
</div> | ||
); | ||
} | ||
|
||
renderKamoji(index,k){ | ||
return( | ||
<li key={index}> | ||
<a className="emoji-item" title={k} onClick={(e) => this.handleKamoji(e)}>{k}</a> | ||
</li> | ||
); | ||
} | ||
|
||
getKamojis () { | ||
return this.getRandomArrayElements(kamojiList, 40); | ||
} | ||
|
||
getRandomArrayElements(arr, count) { | ||
var shuffled = arr.slice(0), i = arr.length, min = i - count, temp, index; | ||
while (i-- > min) { | ||
index = Math.floor((i + 1) * Math.random()); | ||
temp = shuffled[index]; | ||
shuffled[index] = shuffled[i]; | ||
shuffled[i] = temp; | ||
} | ||
return shuffled.slice(min); | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.