Skip to content

Commit

Permalink
Merge pull request #2 from RocketChat/master
Browse files Browse the repository at this point in the history
merging Rocket.Chat master
  • Loading branch information
shahar3012 committed Jun 27, 2015
2 parents dbfe678 + 58b337b commit 3330cb0
Show file tree
Hide file tree
Showing 35 changed files with 856 additions and 500 deletions.
5 changes: 3 additions & 2 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ email
http
jquery
less
markdown
meteor-platform
reactive-var
service-configuration
Expand Down Expand Up @@ -42,7 +41,7 @@ rocketchat:autolinker
rocketchat:emojione
rocketchat:file
rocketchat:highlight
#rocketchat:hubot
rocketchat:hubot
#rocketchat:irc
rocketchat:ldap
rocketchat:lib
Expand All @@ -58,3 +57,5 @@ todda00:friendly-slugs
underscorestring:underscore.string
yasaricli:slugify
konecty:nrr
konecty:change-case
kevohagan:sweetalert
5 changes: 3 additions & 2 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ html-tools@1.0.4
htmljs@1.0.4
http@1.1.0
id-map@1.0.3
iframely:oembed@0.0.2
iron:controller@1.0.8
iron:core@1.0.8
iron:dynamic-template@1.0.8
Expand All @@ -46,7 +45,9 @@ jparker:crypto-md5@0.1.1
jparker:gravatar@0.3.1
jquery@1.11.3_2
json@1.0.3
kevohagan:sweetalert@1.0.0
konecty:autolinker@1.0.2
konecty:change-case@2.3.0
konecty:delayed-task@1.0.0
konecty:mongo-counter@0.0.3
konecty:multiple-instances-status@1.0.3
Expand All @@ -57,7 +58,6 @@ less@1.0.14
livedata@1.0.13
localstorage@1.0.3
logging@1.0.7
markdown@1.0.4
matb33:collection-hooks@0.7.13
meteor@1.1.6
meteor-developer@1.1.3
Expand Down Expand Up @@ -97,6 +97,7 @@ rocketchat:autolinker@0.0.1
rocketchat:emojione@0.0.1
rocketchat:file@0.0.1
rocketchat:highlight@0.0.1
rocketchat:hubot@0.0.1
rocketchat:ldap@0.0.1
rocketchat:lib@0.0.1
rocketchat:markdown@0.0.1
Expand Down
81 changes: 43 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ The Complete Open Source Chat Solution

Checkout the latest version at http://rocket.chat

[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=49QX7TYCVZK8L)

## About

[![Code Climate][codeclimate-image]][codeclimate-url]
[![Code Climate](https://codeclimate.com/github/RocketChat/Rocket.Chat/badges/gpa.svg)](https://codeclimate.com/github/RocketChat/Rocket.Chat)
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/RocketChat/Rocket.Chat/raw/master/LICENSE)

Rocket.Chat is a Web Chat Server, developed in JavaScript, using the [Meteor](https://www.meteor.com/install) fullstack framework.
Expand All @@ -32,40 +34,6 @@ It is a great solution for communities and companies wanting to privately host t
##### [clasesdeperiodismo.com](http://www.clasesdeperiodismo.com/2015/05/30/un-chat-de-codigo-abierto-que-puedes-anadir-a-la-web/)
> Un chat de código abierto que puedes añadir a la web
## Installation

### Development

Prerequisites:

* [Git](http://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
* [Meteor](https://www.meteor.com/install)

Now just clone and start the app:

```sh
git clone https://github.com/RocketChat/Rocket.Chat.git
cd Rocket.Chat
meteor
```

### Production

#### Docker

[Official Docker Registry](https://registry.hub.docker.com/u/rocketchat/rocket.chat/)

```
docker pull rocketchat/rocket.chat
```

#### One-Click Deploy

##### Heroku

[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)


## Features

### Current
Expand All @@ -83,7 +51,8 @@ docker pull rocketchat/rocket.chat
- Transcripts / History
- I18n - [Internationalization with Lingohub](https://translate.lingohub.com/engelgabriel/rocket-dot-chat/dashboard)
- Hubot Friendly - [Hubot Integration Project](https://github.com/RocketChat/hubot-rocketchat)
- Media Embeds - [Iframely Responsive Web Embeds](https://github.com/itteco/iframely)
- Media Embeds
- Link Previews
- LDAP Authentication - [LDAP Authentication on Rocket.Chat Wiki](https://github.com/RocketChat/Rocket.Chat/wiki/LDAP-Authentication)

### Roadmap for v1.0
Expand Down Expand Up @@ -118,6 +87,39 @@ We are developing the APIs based on the competition, so stay tunned and you will

Checkout [Github Wiki](https://github.com/RocketChat/Rocket.Chat/wiki) (coming soon)

## Production Deployment

### Docker

Use the automated build at our [Official Docker Registry](https://registry.hub.docker.com/u/rocketchat/rocket.chat/)

[![Rocket.Chat logo](https://d207aa93qlcgug.cloudfront.net/1.95.5.qa/img/nav/docker-logo-loggedout.png)](https://registry.hub.docker.com/u/rocketchat/rocket.chat/)

```
docker pull rocketchat/rocket.chat
```

### Heroku

Host your own Rocket.Chat server for **FREE** with [One-Click Deploy](https://heroku.com/deploy?template=https://github.com/RocketChat/Rocket.Chat/tree/master)

[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/RocketChat/Rocket.Chat/tree/master)

## Development Installation

Prerequisites:

* [Git](http://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
* [Meteor](https://www.meteor.com/install)

Now just clone and start the app:

```sh
git clone https://github.com/RocketChat/Rocket.Chat.git
cd Rocket.Chat
meteor
```

## Credits

Thanks to [Diego Sampaio](https://github.com/sampaiodiego), [Gabriel Engel](https://github.com/engelgabriel), [Marcelo Schmidt](https://github.com/marceloschmidt), [Rafael Caferati](https://github.com/rcaferati) e [Rodrigo Nascimento](https://github.com/rodrigok)
Expand Down Expand Up @@ -147,7 +149,10 @@ Join the the conversation at [Twitter](http://twitter.com/RocketChatApp), [Faceb

Note that Rocket.Chat is distributed under the [MIT License](http://opensource.org/licenses/MIT).

[codeclimate-image]: https://codeclimate.com/github/RocketChat/Rocket.Chat/badges/gpa.svg
[codeclimate-url]: https://codeclimate.com/github/RocketChat/Rocket.Chat
### Donate

Rocket.Chat will be free forever, but you can help us speed-up the development!

[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=49QX7TYCVZK8L)

:smiling_imp:
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Rocket.Chat",
"description": "Have your own open-source Slack-like online chat, built with Meteor.",
"repository": "https://github.com/RocketChat/Rocket.Chat",
"logo": "http://rocket.chat/images/logo/logo-dark.svg",
"logo": "https://raw.githubusercontent.com/RocketChat/Rocket.Chat/master/public/images/logo/512x512.png",
"keywords": ["meteor", "social", "community", "chat"],
"website": "http://rocket.chat",
"env": {
Expand Down
7 changes: 7 additions & 0 deletions client/lib/chatMessages.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@
stopTyping()
Meteor.call 'sendMessage', { rid: rid, msg: msg, day: window.day }

deleteMsg = (element) ->
id = element.getAttribute("id")
Meteor.call 'deleteMessage', { id: id }, (error, result) ->
if error
return Errors.throw error.reason

update = (id, input) ->
if _.trim(input.value) isnt ''
msg = input.value
Expand Down Expand Up @@ -171,6 +177,7 @@
# isScrollable: isScrollable
# toBottom: toBottom
keydown: keydown
deleteMsg: deleteMsg
send: send
init: init
edit: edit
Expand Down
8 changes: 7 additions & 1 deletion client/lib/collections.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ Meteor.startup ->
ChatMessageHistory.insert record

changed: (record) ->
ChatMessageHistory.update {_id: record._id, msg: {$ne: record.msg}}, record
_id = record._id
delete record._id

ChatMessageHistory.update { _id: _id }, { $set: record }

removed: (record) ->
ChatMessageHistory.remove {_id: record._id}
1 change: 1 addition & 0 deletions client/methods/hideRoom.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Meteor.methods

ChatSubscription.update
rid: rid
'u._id': Meteor.userId()
,
$set:
alert: false
Expand Down
16 changes: 3 additions & 13 deletions client/methods/sendMessage.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,14 @@ Meteor.methods
if not Meteor.userId()
throw new Meteor.Error 203, t('User_logged_out')

Tracker.nonreactive ->
if _.trim(message.msg) isnt ''

message.ts = new Date(Date.now() + TimeSync.serverOffset())

message.u =
_id: Meteor.userId()
username: Meteor.user().username

message.html = message.msg
if _.trim(message.html) isnt ''
message.html = _.escapeHTML message.html
message = RocketChat.callbacks.run 'beforeSaveMessage', message
message.html = message.html.replace /\n/gm, '<br/>'

ChatMessage.upsert
rid: message.rid
t: 't'
,
$set: message
$unset:
t: 1
expireAt: 1
ChatMessage.insert message
2 changes: 0 additions & 2 deletions client/methods/typingStatus.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ Meteor.methods
if start

msgData =
'$set':
expireAt: moment().add(30, 'seconds').toDate()
'$setOnInsert':
msg: '...'
'u._id': Meteor.userId()
Expand Down
10 changes: 10 additions & 0 deletions client/methods/updateMessage.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,13 @@ Meteor.methods
$set:
ets: message.ets
message: message.msg

deleteMessage: (message) ->
if not Meteor.userId()
throw new Meteor.Error 203, t('general.User_logged_out')

Tracker.nonreactive ->

ChatMessage.remove
_id: message.id
'u._id': Meteor.userId()
24 changes: 18 additions & 6 deletions client/stylesheets/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ pre {
width: 100%;
}

q {
blockquote {
padding-left: 10px;
position: relative;
&:before {
content: ' ';
background-color: #ccc;
height: 22px;
height: 100%;
width: 3px;
position: absolute;
left: 50px;
left: 0px;
}
}

Expand Down Expand Up @@ -1957,6 +1958,13 @@ a.github-fork {
&.own:hover .edit-message {
display: inline-block;
}
.delete-message {
display: none;
cursor: pointer;
}
&.own:hover .delete-message {
display: inline-block;
}
.user {
display: inline-block;
font-weight: 600;
Expand Down Expand Up @@ -1990,8 +1998,8 @@ a.github-fork {
.info {
position: absolute;
text-align: right;
left: -15px;
width: 55px;
left: -20px;
width: 65px;
.time {
display: none;
}
Expand All @@ -2000,8 +2008,12 @@ a.github-fork {
}
.edit-message {
float: left;
margin-left: 5px;
margin-left: 1px;
}
.delete-message {
float: left;
}

}
&:hover {
.time {
Expand Down
12 changes: 5 additions & 7 deletions client/views/app/message.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,11 @@ Template.message.onViewRendered = (context) ->
wrapper = ul.parentElement

if context.urls?.length > 0
for url in context.urls
do (url) ->
Meteor.call 'iframely.oembed', url, (error, data) ->
height = lastNode.clientHeight

urlNode = lastNode.querySelector('.body a[href="'+url+'"]')
urlNode?.innerHTML = Blaze.toHTMLWithData Template.iframelyBaseWidget, data
for item in context.urls
do (item) ->
urlNode = lastNode.querySelector('.body a[href="'+item.url+'"]')
if urlNode?
$(urlNode).replaceWith Blaze.toHTMLWithData Template.oembedBaseWidget, item

if not lastNode.nextElementSibling?
if lastNode.classList.contains('own') is true
Expand Down
1 change: 1 addition & 0 deletions client/views/app/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<span class="edited">({{_ "edited"}})</span>
{{/if}}
<i class="icon-pencil edit-message"></i>
<i class="icon-trash-1 delete-message"></i>
</span>
<div class="body" dir="auto">
{{{body}}}
Expand Down
17 changes: 17 additions & 0 deletions client/views/app/room.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,23 @@ Template.room.events
Session.set('flexOpened', true)
Session.set('showUserInfo', $(e.currentTarget).data('username'))

'click .delete-message': (event) ->
msg = event.currentTarget.parentNode.parentNode
return if msg.classList.contains("system")
swal {
title: t('Are_you_sure')
text: t('You_will_not_be_able_to_recover')
type: 'warning'
showCancelButton: true
confirmButtonColor: '#DD6B55'
confirmButtonText: t('Yes_delete_it')
cancelButtonText: t('Cancel')
closeOnConfirm: false
html: false
}, ->
swal t('Deleted'), t('Your_entry_has_been_deleted'), 'success'
ChatMessages.deleteMsg(msg)

Template.room.onCreated ->
console.log 'room.onCreated' if window.rocketDebug
# this.scrollOnBottom = true
Expand Down
Loading

0 comments on commit 3330cb0

Please sign in to comment.