Merge branch 'master' of github.com:RocketChat/Rocket.Chat into standalone-package-testing

Conflicts:
	.meteor/packages
	.meteor/versions
	.travis.yml
pull/1045/head
George Secrieru 10 years ago
commit 6e5470a80b
  1. 44
      .meteor/packages
  2. 7
      .meteor/versions
  3. 10
      .travis.yml
  4. 41
      .travis/setbuildinfo.js
  5. 47
      README.md
  6. 10
      build-old.sh
  7. 17
      build.sh
  8. 6
      client/lib/accountBox.coffee
  9. 2
      client/lib/fileUpload.coffee
  10. 4
      client/lib/sideNav.coffee
  11. 6
      client/views/admin/users/adminUsers.coffee
  12. 40
      client/views/admin/users/adminUsers.html
  13. 8
      client/views/app/messagePopup.coffee
  14. 3
      client/views/app/room.coffee
  15. 4
      client/views/app/room.html
  16. 2
      client/views/app/sideNav/sideNav.html
  17. 2
      client/views/app/sideNav/userStatus.html
  18. 4
      client/views/app/tabBar/membersList.html
  19. 4
      client/views/login/form.coffee
  20. 2
      client/views/login/services.coffee
  21. 1
      client/views/main.html
  22. 2
      docker-compose.yml
  23. 4
      i18n/en.i18n.json
  24. 6
      i18n/pt.i18n.json
  25. 50
      lib/fileUpload.coffee
  26. 57
      packages/meteor-accounts-saml/.npm/package/npm-shrinkwrap.json
  27. 3
      packages/rocketchat-chatops/client/startup.coffee
  28. 2
      packages/rocketchat-chatops/client/tabBar.coffee
  29. 18
      packages/rocketchat-chatops/client/views/droneflight.coffee
  30. 19
      packages/rocketchat-chatops/client/views/droneflight.html
  31. 15
      packages/rocketchat-chatops/client/views/stylesheets/chatops.css
  32. 6
      packages/rocketchat-chatops/package.js
  33. 14
      packages/rocketchat-file/.npm/package/npm-shrinkwrap.json
  34. 32
      packages/rocketchat-ldap/.npm/package/npm-shrinkwrap.json
  35. 2
      packages/rocketchat-lib/package.js
  36. 3
      packages/rocketchat-lib/settings/client/rocketchat.coffee
  37. 2
      packages/rocketchat-lib/settings/client/startup.coffee
  38. 5
      packages/rocketchat-lib/settings/server/startup.coffee
  39. 4
      packages/rocketchat-markdown/markdown.coffee
  40. 13
      packages/rocketchat-oembed/server/server.coffee
  41. 13
      packages/rocketchat-soundcloud/lib/client/oembedSoundcloudWidget.html
  42. 3
      packages/rocketchat-soundcloud/lib/client/widget.coffee
  43. 10
      packages/rocketchat-soundcloud/lib/server/server.coffee
  44. 26
      packages/rocketchat-soundcloud/package.js
  45. 0
      packages/rocketchat-spotify/lib/client/oembedSpotifyWidget.html
  46. 0
      packages/rocketchat-spotify/lib/client/widget.coffee
  47. 3
      packages/rocketchat-spotify/lib/spotify.coffee
  48. 6
      packages/rocketchat-spotify/package.js
  49. 88
      packages/rocketchat-theme/assets/stylesheets/base.less
  50. 8
      packages/rocketchat-theme/assets/stylesheets/utils/_colors.import.less
  51. 15
      packages/rocketchat-theme/client/client.coffee
  52. 2
      packages/rocketchat-theme/package.js
  53. 43
      packages/rocketchat-theme/server/server.coffee
  54. 4
      public/buildinfo/buildinfo.txt
  55. 14
      server/methods/getRoomIdByNameOrId.coffee
  56. 52
      tests/jasmine/client/unit/spotifytest.coffee

@ -9,27 +9,42 @@ accounts-google
accounts-meteor-developer
accounts-password
accounts-twitter
blaze-html-templates
check
coffeescript
ddp-rate-limiter
ejson
email
fastclick
http
jquery
less
logging
meteor-base
mobile-experience
mongo
random
reactive-dict
reactive-var
reload
service-configuration
session
spacebars
standard-minifiers
tracker
arunoda:streams
rocketchat:lib
rocketchat:authorization
rocketchat:autolinker
rocketchat:colors
rocketchat:custom-oauth
rocketchat:emojione
rocketchat:favico
rocketchat:file
rocketchat:github-enterprise
rocketchat:gitlab
rocketchat:wordpress
rocketchat:highlight
rocketchat:ldap
rocketchat:logger
@ -43,11 +58,14 @@ rocketchat:slashcommands-join
rocketchat:slashcommands-leave
rocketchat:spotify
rocketchat:statistics
rocketchat:theme
rocketchat:webrtc
rocketchat:wordpress
#rocketchat:chatops
#rocketchat:livechat
#rocketchat:hubot
#rocketchat:irc
#rocketchat:livechat
#rocketchat:soundcloud
konecty:change-case
konecty:delayed-task
@ -75,6 +93,7 @@ mystor:device-detection
nimble:restivus
nooitaf:colors
pauli:accounts-linkedin
perak:codemirror
percolate:migrations
percolate:synced-cron
raix:handlebar-helpers
@ -88,22 +107,5 @@ todda00:friendly-slugs
underscorestring:underscore.string
yasaricli:slugify
yasinuslu:blaze-meta
rocketchat:theme
rocketchat:authorization
perak:codemirror
standard-minifiers
meteor-base
mobile-experience
mongo
blaze-html-templates
session
tracker
logging
reload
random
ejson
spacebars
check
rocketchat:github-enterprise
rocketchat:chatops
ddp-rate-limiter
# sanjo:jasmine
# velocity:html-reporter

@ -51,13 +51,13 @@ htmljs@1.0.5
http@1.1.1
id-map@1.0.4
idorecall:email-normalize@1.0.0
jalik:ufs@0.2.9
jalik:ufs-gridfs@0.1.0
jalik:ufs@0.3.0
jalik:ufs-gridfs@0.1.1
jparker:crypto-core@0.1.0
jparker:crypto-md5@0.1.1
jparker:gravatar@0.4.1
jquery@1.11.4
kadira:blaze-layout@2.1.0
kadira:blaze-layout@2.2.0
kadira:flow-router@2.7.0
kevohagan:sweetalert@1.0.0
konecty:autolinker@1.0.3
@ -122,7 +122,6 @@ reload@1.1.4
retry@1.0.4
rocketchat:authorization@0.0.1
rocketchat:autolinker@0.0.1
rocketchat:chatops@0.0.1
rocketchat:colors@0.0.1
rocketchat:custom-oauth@1.0.0
rocketchat:emojione@0.0.1

@ -28,18 +28,14 @@ script:
- cd .travis
- sh ./namefiles.sh
- cd ..
- meteor add rocketchat:livechat
- meteor add rocketchat:hubot
- meteor add sanjo:jasmine@0.20.2 velocity:console-reporter
- ./node_modules/velocity-cli/bin/velocity test-packages --ci
- ./node_modules/velocity-cli/bin/velocity test-app --ci
- meteor --test --once
- meteor add-platform ios
- meteor add rocketchat:livechat rocketchat:hubot
- meteor build --server demo.rocket.chat ../build
- cd .travis
- sh ./namedemo.sh
- cd ..
after_deploy:
- "curl -H \"Content-Type: application/json\" --data \"{'build': true}\" -X POST https://registry.hub.docker.com/u/singli/rocket.chat/trigger/$PUSHTOKEN/"
- "curl -H \"Content-Type: application/json\" --data \"{'build': true}\" -X POST https://registry.hub.docker.com/u/rocketchat/rocket.chat/trigger/$PUSHTOKEN/"
deploy:
provider: s3
access_key_id: "AKIAIKIA7H7D47KUHYCA"

@ -1,44 +1,39 @@
var BUILD_INFO_PATH = '../public/buildinfo/buildinfo.txt';
var PACKAGES_PATH = '../.meteor/packages';
var PACKAGES_PATH = '../.meteor/versions';
var BUILD_PATH = '../../build';
var LineByLineReader = require('line-by-line'),
mkdirp = require('mkdirp'),
fs = require('fs'),
lr = new LineByLineReader(BUILD_INFO_PATH);
var LineByLineReader = require('line-by-line');
var mkdirp = require('mkdirp');
var fs = require('fs');
var lr = new LineByLineReader(BUILD_INFO_PATH);
var firstline = "";
if (process.env.TRAVIS_BUILD_NUMBER) {
var transformVersion = function (firstline) {
var versions = firstline.split(".");
var versions = firstline.split(".");
return versions[0] + '.' + versions[1] + '.' + process.env.TRAVIS_BUILD_NUMBER + '\n';
return versions[0] + '.' + versions[1] + '.' + process.env.TRAVIS_BUILD_NUMBER + '\n';
};
lr.on('error', function (err) {
// 'err' contains error object
// 'err' contains error object
});
lr.on('line', function (line) {
if (firstline == "")
firstline = line;
if (firstline == "") {
firstline = line;
}
});
lr.on('end', function () {
var packages = fs.readFileSync(PACKAGES_PATH);
var verinfo = transformVersion(firstline);
var content = verinfo + packages;
mkdirp.sync(BUILD_PATH);
fs.writeFileSync(BUILD_PATH + "/version.txt", verinfo);
fs.writeFileSync(BUILD_INFO_PATH, content);
console.log('Version is ' + verinfo);
var packages = fs.readFileSync(PACKAGES_PATH);
var verinfo = transformVersion(firstline);
var content = verinfo + packages;
mkdirp.sync(BUILD_PATH);
fs.writeFileSync(BUILD_PATH + "/version.txt", verinfo);
fs.writeFileSync(BUILD_INFO_PATH, content);
console.log('Version is ' + verinfo);
});
}

@ -1,6 +1,6 @@
![Rocket.Chat logo](https://rocket.chat/images/logo/logo-dark.svg?v3)
The Complete Open Source Chat Solution
The Ultimate Open Source WebChat Platform
## Demo
@ -28,11 +28,8 @@ Try it on Ubuntu:
Try it with docker:
```
docker-compose up
```
[Deploy with docker](https://github.com/RocketChat/Rocket.Chat/wiki/Deploy-with-Docker)
and check it out at http://localhost:80
Download the Native Cross-Platform Desktop Application at [Rocket.Chat.Electron](https://github.com/RocketChat/Rocket.Chat.Electron/releases)
@ -81,45 +78,52 @@ It is a great solution for communities and companies wanting to privately host t
- Avatars
- Markdown
- Emojis
- Media Embeds
- Link Previews
- Sent Message Edit and Deletion
- Transcripts / History
- File Upload / Sharing
- Full text search
- Live chat / Messaging call center
- LDAP Authentication
- Support for Okta SSO through SAML v2
- Live chat / Messaging call center - Alpha testing now! [Issue #519](https://github.com/RocketChat/Rocket.Chat/issues/519)
- I18n - Supports 22 Languages [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
- Link Previews
- LDAP Authentication - [LDAP Authentication on Rocket.Chat Wiki](https://github.com/RocketChat/Rocket.Chat/wiki/LDAP-Authentication)
- Face to Face Video Conferencing aka WebRTC (Alpha) - [How to video chat](https://github.com/RocketChat/Rocket.Chat/wiki/Using-Face-to-face-video-conference-%28aka-webrtc%29)
- REST APIs - [Ready for testing ...](https://github.com/RocketChat/Rocket.Chat/wiki/REST-APIs)
- Remote Locations Video Monitoring - [Early access ...](https://github.com/RocketChat/Rocket.Chat/wiki/Remote-Video-Monitoring)
- Native Cross-Platform Desktop Application [Rocket.Chat.Electron - HELP WANTED](https://github.com/RocketChat/Rocket.Chat.Electron/releases)
- I18n - Supports 22 Languages
- Hubot Friendly
- Face to Face Video Conferencing (aka WebRTC)
- Multi-users Video Group Chat
- Audio calls
- Multi-users Audio Conference
- Screensharing
- REST APIs
- Remote Locations Video Monitoring
- Chat-ops powered by Hubot: scalable horizontal app integration (early access)
- Native Cross-Platform Desktop Application [Windows, Mac OSX, or Linux](https://rocket.chat/)
- Mobile app for iPhone, iPad, and iPod touch [Download on AppStore!](https://geo.itunes.apple.com/us/app/rocket.chat/id1028869439?mt=8)
- Mobile app for Android phone, tablet, and TV stick [Available now on Google Play!](https://play.google.com/store/apps/details?id=com.konecty.rocket.chat)
- Sandstorm.io instant Rocket.Chat server [Now on Sandstorm App Store](https://apps.sandstorm.io/app/vfnwptfn02ty21w715snyyczw0nqxkv3jvawcah10c6z7hj1hnu0)
### Roadmap
#### In Progress
- Support multiple teams on the same instance / same VPS infrastructure: [Issue #658](https://github.com/RocketChat/Rocket.Chat/issues/658), [Issue #630](https://github.com/RocketChat/Rocket.Chat/issues/630)
- Support for PostgreSQL: [Issue #533](https://github.com/RocketChat/Rocket.Chat/issues/533), [Issue #822](https://github.com/RocketChat/Rocket.Chat/issues/822)
- Native iOS Application [Issue #270](https://github.com/RocketChat/Rocket.Chat/issues/270), [Rocket.Chat.iOS - HELP WANTED](https://github.com/RocketChat/Rocket.Chat.iOS)
- Native Android Application [Issue #271 - HELP WANTED](https://github.com/RocketChat/Rocket.Chat/issues/271)
- Off-the-Record (OTR) Messaging [Issue #36](https://github.com/RocketChat/Rocket.Chat/issues/36), [Issue #268 - HELP WANTED](https://github.com/RocketChat/Rocket.Chat/issues/268)
- API-enabled methods: [Issue #202](https://github.com/RocketChat/Rocket.Chat/issues/202), [Issue #454](https://github.com/RocketChat/Rocket.Chat/issues/454), [Issue #455](https://github.com/RocketChat/Rocket.Chat/issues/455), [Issue #759](https://github.com/RocketChat/Rocket.Chat/issues/759)
- Voice calls: [Issue #542](https://github.com/RocketChat/Rocket.Chat/issues/542)
- Screensharing: [Issue #418](https://github.com/RocketChat/Rocket.Chat/issues/418)
- Scalable WebRTC broadcaster / media-server integration, [Issue #1118 - HELP WANTED](https://github.com/RocketChat/Rocket.Chat/issues/1118)
#### Planned
- Kerberos Authentication: [Issue #839](https://github.com/RocketChat/Rocket.Chat/issues/839)
- XMPP Multi-user chat (MUC): [Issue #404](https://github.com/RocketChat/Rocket.Chat/issues/404)
- More webhooks: GitLab, Confluence, Jira, Piwik, Wordpress: [Issue #233](https://github.com/RocketChat/Rocket.Chat/issues/233), [Issue #525](https://github.com/RocketChat/Rocket.Chat/issues/525), [Issue #637](https://github.com/RocketChat/Rocket.Chat/issues/637), [Issue #638](https://github.com/RocketChat/Rocket.Chat/issues/638), [Issue #747](https://github.com/RocketChat/Rocket.Chat/issues/747)
- Support multiple teams on the same instance / same VPS infrastructure: [Issue #658](https://github.com/RocketChat/Rocket.Chat/issues/658), [Issue #630](https://github.com/RocketChat/Rocket.Chat/issues/630)
- Clusterize / Descentralize: [Issue #520](https://github.com/RocketChat/Rocket.Chat/issues/520), [Issue #601](https://github.com/RocketChat/Rocket.Chat/issues/601)
- Anonymous use of Rocket.Chat: [Issue #604](https://github.com/RocketChat/Rocket.Chat/issues/604)
- File Sharing via P2P and Scalable Multicast: [Issue #369](https://github.com/RocketChat/Rocket.Chat/issues/369), [Issue #370](https://github.com/RocketChat/Rocket.Chat/issues/370)
- Anti-virus checking on file uploads: [Issue #757](https://github.com/RocketChat/Rocket.Chat/issues/757)
- Massively scalable hosting and provisioning
### Issues
@ -133,6 +137,13 @@ The docker image is ready.
Everyone can start hacking the adapter code, or launch his/her own bot within a few minutes now.
Please head over to the [Hubot Integration Project](https://github.com/RocketChat/hubot-rocketchat) for more information.
#### Chat-ops integrations powered by Hubot
Integrate your application with fly-in panels today! Early access is available for developers.
![Sample integration of a Drones Fleet Management System](https://raw.githubusercontent.com/Sing-Li/bbug/master/images/dronechatops.png)
#### Many, many, many more to come!
We are developing the APIs based on the competition, so stay tuned and you will see a lot happening here.

@ -0,0 +1,10 @@
#!/bin/bash
source ./build-info.sh
export METEOR_SETTINGS=$(cat settings.json)
meteor add rocketchat:livechat
meteor add rocketchat:hubot
meteor build --server https://demo.rocket.chat --directory /var/www/rocket.chat
cd /var/www/rocket.chat/bundle/programs/server
npm install
cd /var/www/rocket.chat/current
pm2 startOrRestart /var/www/rocket.chat/current/pm2.json

@ -1,8 +1,15 @@
#!/bin/bash
cd /var/www/rocket.chat
https://s3.amazonaws.com/rocketchatbuild/demo.rocket.chat-v.latest.tgz" -o rocket.chat.tgz
ROOTPATH=/var/www/rocket.chat
PM2FILE=pm2.json
if [ "$1" == "development" ]; then
ROOTPATH=/var/www/rocket.chat.dev
PM2FILE=pm2.dev.json
fi
cd $ROOTPATH
curl -fSL "https://s3.amazonaws.com/rocketchatbuild/demo.rocket.chat-v.latest.tgz" -o rocket.chat.tgz
tar zxvf rocket.chat.tgz && rm rocket.chat.tgz
cd /var/www/rocket.chat/bundle/programs/server
cd $ROOTPATH/bundle/programs/server
npm install
cd /var/www/rocket.chat/current
pm2 startOrRestart /var/www/rocket.chat/current/pm2.json
pm2 startOrRestart $ROOTPATH/current/$PM2FILE

@ -13,13 +13,13 @@
SideNav.closeFlex()
return;
status = 1
self.options.removeClass("_hidden")
self.options.removeClass("animated-hidden")
self.box.addClass("active")
SideNav.toggleArrow 1
close = ->
status = 0
self.options.addClass("_hidden")
self.options.addClass("animated-hidden")
self.box.removeClass("active")
SideNav.toggleArrow -1
@ -32,4 +32,4 @@
open: open
close: close
init: init
)()
)()

@ -24,6 +24,8 @@ readAsArrayBuffer = (file, callback) ->
return
readAsDataURL file.file, (fileContent) ->
return unless fileUploadIsValidContentType file.file.type
text = ''
if file.type is 'audio'

@ -48,12 +48,12 @@
animating = true
if status is -1 or (status isnt 1 and flexNav.opened)
flexNav.opened = false
flexNav.addClass "hidden"
flexNav.addClass "animated-hidden"
else
flexNav.opened = true
# added a delay to make sure the template is already rendered before animating it
setTimeout ->
flexNav.removeClass "hidden"
flexNav.removeClass "animated-hidden"
, 50
setTimeout ->
animating = false

@ -25,6 +25,12 @@ Template.adminUsers.helpers
adminClass: ->
return 'admin' if RocketChat.authz.hasRole(Meteor.userId(), 'admin')
username: ->
return '@' + @username if @username?
emailAddress: ->
return _.map(@emails, (e) -> e.address).join(', ')
Template.adminUsers.onCreated ->
instance = @
@limit = new ReactiveVar 50

@ -21,22 +21,32 @@
{{{_ "Showing_results" users.length}}}
</div>
<div class="list">
{{#each users}}
<div class="user-info" data-id="{{_id}}">
<li class='user-image status-{{status}}'>
{{> avatar username=username}}
<h3>{{name}}</h3>
</li>
<ul>
<li>@{{username}}</li>
{{#if email}}<li>{{email}}</li>{{/if}}
</ul>
</div>
{{/each}}
<table>
<thead>
<tr>
<td>&nbsp;</td>
<td width="34%">{{_ "Name"}}</td>
<td width="33%">{{_ "Username"}}</td>
<td width="33%">{{_ "E-mail"}}</td>
</tr>
</thead>
<tbody>
{{#each users}}
<tr class="user-info" data-id="{{_id}}">
<td>
<div class="user-image status-{{status}}">
{{> avatar username=username}}
</div>
</td>
<td>{{name}}</td>
<td>{{username}}</td>
<td>{{emailAddress}}</td>
</tr>
{{/each}}
</tbody>
</table>
{{#if hasMore}}
<li class="load-more">
<button class="button secondary load-more {{isLoading}}">{{_ "Load_more"}}</button>
</li>
<button class="button secondary load-more {{isLoading}}">{{_ "Load_more"}}</button>
{{/if}}
</div>
{{/unless}}

@ -44,13 +44,13 @@ Template.messagePopup.onCreated ->
template.suffix = val(template.data.suffix, ' ')
if template.triggerAnywhere is true
template.matchSelectorRegex = val(template.data.matchSelectorRegex, new RegExp "(?:^| )#{template.trigger}[A-Za-z0-9-_.]*$")
template.matchSelectorRegex = val(template.data.matchSelectorRegex, new RegExp "(?:^| )#{template.trigger}[^\s]*$")
else
template.matchSelectorRegex = val(template.data.matchSelectorRegex, new RegExp "(?:^)#{template.trigger}[A-Za-z0-9-_.]*$")
template.matchSelectorRegex = val(template.data.matchSelectorRegex, new RegExp "(?:^)#{template.trigger}[^\s]*$")
template.selectorRegex = val(template.data.selectorRegex, new RegExp "#{template.trigger}([A-Za-z0-9-_.]*)$")
template.selectorRegex = val(template.data.selectorRegex, new RegExp "#{template.trigger}([^\s]*)$")
template.replaceRegex = val(template.data.replaceRegex, new RegExp "#{template.trigger}[A-Za-z0-9-_.]*$")
template.replaceRegex = val(template.data.replaceRegex, new RegExp "#{template.trigger}[^\s]*$")
template.getValue = val template.data.getValue, (_id) -> return _id

@ -221,6 +221,9 @@ Template.room.helpers
compactView: ->
return 'compact' if Meteor.user()?.settings?.preferences?.compactView
fileUploadAllowedMediaTypes: ->
return RocketChat.settings.get('FileUpload_MediaTypeWhiteList')
Template.room.events
"touchstart .message": (e, t) ->
message = this._arguments[1]

@ -81,7 +81,7 @@
<div style="display: flex">
<div class="file">
<i class="octicon octicon-cloud-upload file"></i>
<input type="file" accept="image/*">
<input type="file" accept="{{fileUploadAllowedMediaTypes}}">
</div>
<div class="input-message-container">
{{> messagePopupConfig getPupupConfig}}
@ -152,4 +152,4 @@
{{> Template.dynamic template=flexTemplate data=flexData}}
</section>
</div>
</template>
</template>

@ -23,7 +23,7 @@
<div class="unread-rooms bottom-unread-rooms hidden">
{{_ "More_unreads"}} <i class="icon-down-big"></i>
</div>
<div class="flex-nav hidden">
<div class="flex-nav animated-hidden">
<section>
{{> Template.dynamic template=flexTemplate data=flexData}}
</section>

@ -11,7 +11,7 @@
</div>
{{/if}}
</div>
<nav class="options _hidden">
<nav class="options animated-hidden">
<div class="wrapper">
<a href="" data-status="online" class="status online"><span>{{_ "Online"}}</span></a>
<a href="" data-status="away" class="status away"><span>{{_ "Away" context="male"}}</span></a>

@ -2,7 +2,7 @@
<div class="content">
{{> videoCall}}
{{#if isGroupChat}}
<div class="list-view{{#if $.Session.get 'showUserInfo'}} -hidden{{/if}}">
<div class="list-view{{#if $.Session.get 'showUserInfo'}} animated-hidden{{/if}}">
{{#with roomUsers}}
<div class="status">
<h2>{{_ "Members_List"}}</h2>
@ -35,7 +35,7 @@
{{/with}}
</div>
{{/if}}
<div class="user-view animated{{#unless showUserInfo}} -hidden{{/unless}}">
<div class="user-view animated{{#unless showUserInfo}} animated-hidden{{/unless}}">
{{> userInfo user=flexUserInfo showAll=isGroupChat video=isDirectChat}}
</div>
</div>

@ -85,8 +85,7 @@ Template.loginForm.events
instance.state.set 'login'
else if error?.error is 'inactive-user'
instance.state.set 'wait-activation'
# else
# FlowRouter.go 'index'
else
loginMethod = 'loginWithPassword'
if RocketChat.settings.get('LDAP_Enable')
@ -100,7 +99,6 @@ Template.loginForm.events
else
toastr.error t 'User_not_found_or_incorrect_password'
return
FlowRouter.go 'index'
'click .register': ->
Template.instance().state.set 'register'

@ -57,7 +57,6 @@ Template.loginServices.events
toastr.error error.message
return
FlowRouter.go 'index'
else
loginWithService = "loginWith" + (if this.service.service is 'meteor-developer' then 'MeteorDeveloperAccount' else _.capitalize(this.service.service))
serviceConfig = this.service.clientConfig or {}
@ -68,4 +67,3 @@ Template.loginServices.events
console.log JSON.stringify(error), error.message
toastr.error error.message
return
FlowRouter.go 'index'

@ -34,7 +34,6 @@
<link rel="apple-touch-icon" sizes="144x144" href="/images/logo/apple-touch-icon-144x144.png?v=3">
<link rel="apple-touch-icon" sizes="152x152" href="/images/logo/apple-touch-icon-152x152.png?v=3">
<link rel="apple-touch-icon" sizes="180x180" href="/images/logo/apple-touch-icon-180x180.png?v=3">
<link rel="stylesheet" type="text/css" href="/theme.css" id="theme">
</head>
<body>

@ -6,7 +6,7 @@ db:
command: mongod --smallfiles
rocketchat:
image: singli/rocket.chat
image: rocketchat/rocket.chat
environment:
- MONGO_URL=mongodb://db:27017/rocketchat
- ROOT_URL=http://yourhost:8818

@ -116,6 +116,10 @@
"Esc_to" : "Esc to",
"False" : "False",
"Favorites" : "Favorites",
"FileUpload" : "File Upload",
"FileUpload_Enabled" : "Enable file upload",
"FileUpload_MaxFileSize" : "Max. size for uploaded files (in bytes)",
"FileUpload_MediaTypeWhiteList" : "Comma-separated Media Type list",
"Follow_social_profiles" : "Follow our social profiles, fork us on github and share your thoughts about the rocket.chat app on our trello board.",
"Forgot_password" : "Forgot your password",
"Fork_it_on_github" : "Fork it on github",

@ -110,6 +110,10 @@
"Esc_to" : "Esc para",
"False" : "Falso",
"Favorites" : "Favoritos",
"FileUpload" : "Upload de Arquivos",
"FileUpload_Enabled" : "Habilitar upload de arquivos",
"FileUpload_MaxFileSize" : "Tamanho máximo dos arquivos (em bytes)",
"FileUpload_MediaTypeWhiteList" : "Lista de tipos de mídia (separados por vírgula)",
"Follow_social_profiles" : "Siga-nos nas redes sociais, faça fork no github e compartilhe suas ideias sobre o app rocket.chat em nosso trello.",
"Forgot_password" : "Esqueceu sua senha",
"Fork_it_on_github" : "Fork it on github",
@ -179,7 +183,7 @@
"Message_deleting_not_allowed" : "Exclusão de mensagem não permitido",
"Message_editing_not_allowed" : "Edição de mensagem não permitido",
"Message_editing_blocked" : "Esta mensagem não pode mais ser editada",
"Message_MaxAllowedSize" : "Tamanho máximo de mensagem permitido ",
"Message_MaxAllowedSize" : "Tamanho máximo de mensagem permitido ",
"Message_pinning_not_allowed" : "Não Permitir Fixar Mensagem",
"Message_KeepHistory" : "Manter Histórico de Mensagens",
"Message_removed" : "Mensagem removida",

@ -1,6 +1,5 @@
if UploadFS?
@fileCollection = new Mongo.Collection 'rocketchat_uploads'
fileCollection.allow
insert: (userId, doc) ->
return userId
@ -11,14 +10,41 @@ if UploadFS?
remove: (userId, doc) ->
return userId is doc.userId
Meteor.fileStore = new UploadFS.store.GridFS
collection: fileCollection
name: 'rocketchat_uploads'
collectionName: 'rocketchat_uploads'
filter: new UploadFS.Filter
maxSize: 2097152
contentTypes: ['image/*', 'audio/*']
onFinishUpload: ->
console.log arguments
onRead: (fileId, file, req, res) ->
res.setHeader 'content-disposition', 'download'
fileUploadMediaWhiteList = ->
return _.map(RocketChat.settings.get('FileUpload_MediaTypeWhiteList').split(','), (item) -> return item.trim() )
@fileUploadIsValidContentType = (type) ->
list = fileUploadMediaWhiteList()
if _.contains list, type
return true
else
wildCardGlob = '/*'
wildcards = _.filter list, (item) -> return item.indexOf(wildCardGlob) > 0
if _.contains wildcards, type.replace(/(\/.*)$/, wildCardGlob)
return true;
return false;
initFileStore = ->
Meteor.fileStore = new UploadFS.store.GridFS
collection: fileCollection
name: 'rocketchat_uploads'
collectionName: 'rocketchat_uploads'
filter: new UploadFS.Filter
maxSize: RocketChat.settings.get('FileUpload_MaxFileSize')
contentTypes: fileUploadMediaWhiteList()
onFinishUpload: ->
console.log arguments
onRead: (fileId, file, req, res) ->
res.setHeader 'content-disposition', 'download'
if Meteor.isServer
initFileStore()
else
Tracker.autorun (c) ->
if RocketChat.settings.subscription.ready()
initFileStore()
c.stop()

@ -1,99 +1,102 @@
{
"dependencies": {
"connect": {
"version": "http://registry.npmjs.org/connect/-/connect-2.7.10.tgz",
"version": "2.7.10",
"dependencies": {
"qs": {
"version": "http://registry.npmjs.org/qs/-/qs-0.6.5.tgz"
"version": "0.6.5"
},
"formidable": {
"version": "http://registry.npmjs.org/formidable/-/formidable-1.0.14.tgz"
"version": "1.0.14"
},
"cookie-signature": {
"version": "http://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.1.tgz"
"version": "1.0.1"
},
"buffer-crc32": {
"version": "http://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.1.tgz"
"version": "0.2.1"
},
"cookie": {
"version": "http://registry.npmjs.org/cookie/-/cookie-0.0.5.tgz"
"version": "0.0.5"
},
"send": {
"version": "http://registry.npmjs.org/send/-/send-0.1.0.tgz",
"version": "0.1.0",
"dependencies": {
"mime": {
"version": "http://registry.npmjs.org/mime/-/mime-1.2.6.tgz"
"version": "1.2.6"
},
"range-parser": {
"version": "http://registry.npmjs.org/range-parser/-/range-parser-0.0.4.tgz"
"version": "0.0.4"
}
}
},
"bytes": {
"version": "http://registry.npmjs.org/bytes/-/bytes-0.2.0.tgz"
"version": "0.2.0"
},
"fresh": {
"version": "http://registry.npmjs.org/fresh/-/fresh-0.1.0.tgz"
"version": "0.1.0"
},
"pause": {
"version": "http://registry.npmjs.org/pause/-/pause-0.0.1.tgz"
"version": "0.0.1"
},
"debug": {
"version": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
"version": "2.2.0",
"dependencies": {
"ms": {
"version": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz"
"version": "0.7.1"
}
}
}
}
},
"querystring": {
"version": "http://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz"
"version": "0.2.0"
},
"xml-crypto": {
"version": "http://registry.npmjs.org/xml-crypto/-/xml-crypto-0.6.0.tgz",
"version": "0.6.0",
"dependencies": {
"xmldom": {
"version": "0.1.19"
},
"xpath.js": {
"version": "http://registry.npmjs.org/xpath.js/-/xpath.js-1.0.6.tgz"
"version": "1.0.6"
}
}
},
"xml-encryption": {
"version": "http://registry.npmjs.org/xml-encryption/-/xml-encryption-0.7.2.tgz",
"version": "0.7.2",
"dependencies": {
"ejs": {
"version": "http://registry.npmjs.org/ejs/-/ejs-0.8.8.tgz"
"version": "0.8.8"
},
"async": {
"version": "http://registry.npmjs.org/async/-/async-0.2.10.tgz"
"version": "0.2.10"
},
"xpath": {
"version": "http://registry.npmjs.org/xpath/-/xpath-0.0.5.tgz"
"version": "0.0.5"
},
"node-forge": {
"version": "http://registry.npmjs.org/node-forge/-/node-forge-0.2.24.tgz"
"version": "0.2.24"
}
}
},
"xml2js": {
"version": "http://registry.npmjs.org/xml2js/-/xml2js-0.2.0.tgz",
"version": "0.2.0",
"dependencies": {
"sax": {
"version": "http://registry.npmjs.org/sax/-/sax-1.1.2.tgz"
"version": "1.1.3"
}
}
},
"xmlbuilder": {
"version": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-2.6.4.tgz",
"version": "2.6.4",
"dependencies": {
"lodash": {
"version": "http://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz"
"version": "3.10.1"
}
}
},
"xmldom": {
"version": "http://registry.npmjs.org/xmldom/-/xmldom-0.1.19.tgz"
"version": "0.1.19"
}
}
}

@ -0,0 +1,3 @@
Meteor.startup ->
console.log('startup hooked')
GoogleMaps.load()

@ -24,7 +24,7 @@ Meteor.startup ->
id: 'chatops-button3'
i18nTitle: 'rocketchat-chatops:Chatops_Title'
icon: 'octicon octicon-inbox'
template: 'chatops_codemirror'
template: 'chatops_droneflight'
width: 675
order: 5
, RocketChat.callbacks.priority.MEDIUM, 'enter-room-tabbar-chatops'

@ -0,0 +1,18 @@
Template.chatops_droneflight.helpers
flightMapOptions: ->
if GoogleMaps.loaded()
console.log('helper run')
return {center: new google.maps.LatLng(35.6609285,-78.8456125), zoom: 17}
Template.chatops_droneflight.onCreated () ->
GoogleMaps.ready 'flightMap', (map) ->
console.log('ready')
redicon = { path: google.maps.SymbolPath.CIRCLE, fillColor: "red", fillOpacity: 0.8, strokeColor: "gold", strokeWeight: 2, scale: 10}
greenicon = {path: google.maps.SymbolPath.CIRCLE, fillColor: "green", fillOpacity: 0.8, strokeColor: "gold", strokeWeight: 2, scale: 10}
marker = new google.maps.Marker({position: new google.maps.LatLng(35.661848,-78.843165), icon: redicon, map: map.instance})
marker.setLabel('1')
marker2 = new google.maps.Marker({position: new google.maps.LatLng(35.660537,-78.846959), icon: greenicon, map: map.instance})
marker2.setLabel('2')

@ -0,0 +1,19 @@
<template name="chatops_droneflight">
<div class="control">
<div> <b>Drone 1:</b> mission <b>A3</b> waypoint <b>7</b> <span class="red">fuel 30%</span> </div>
<div> <b>Drone 2:</b> mission <b>A7</b> waypoint <b>2</b> <span class="green">fuel 100%</span> </div>
</div>
<div class="content">
<div class="map-container">
{{> googleMap name="flightMap" options=flightMapOptions }}
</div>
<div class="droneFlight">
<button class='button'><span> {{_ "Return to base"}}</span></button>
<button class='button'><span> {{_ "Cancel"}}</span></button>
</div>
</div>
</template>

@ -0,0 +1,15 @@
.map-container {
width: 670px;
max-width: 100%;
height: 500px;
padding: 5px, 5px, 5px 5px;
}
.red {
color: red;
}
.green {
color: green;
}

@ -10,7 +10,8 @@ Package.onUse(function(api) {
api.use([
'coffeescript',
'rocketchat:lib@0.0.1'
'rocketchat:lib@0.0.1',
'dburles:google-maps@1.1.5'
]);
// TAPi18n
@ -27,11 +28,14 @@ Package.onUse(function(api) {
api.addFiles("package-tap.i18n", ["client", "server"]);
api.addFiles([
'client/startup.coffee',
'client/tabBar.coffee',
'client/views/chatops.html',
'client/views/chatops.coffee',
'client/views/codemirror.html',
'client/views/codemirror.coffee',
'client/views/droneflight.html',
'client/views/droneflight.coffee',
'client/views/dynamicUI.html',
'client/views/stylesheets/chatops.css',
], 'client');

@ -1,29 +1,29 @@
{
"dependencies": {
"gm": {
"version": "http://registry.npmjs.org/gm/-/gm-1.18.1.tgz",
"version": "1.18.1",
"dependencies": {
"debug": {
"version": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
"version": "2.2.0",
"dependencies": {
"ms": {
"version": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz"
"version": "0.7.1"
}
}
},
"array-series": {
"version": "http://registry.npmjs.org/array-series/-/array-series-0.1.5.tgz"
"version": "0.1.5"
},
"array-parallel": {
"version": "http://registry.npmjs.org/array-parallel/-/array-parallel-0.1.3.tgz"
"version": "0.1.3"
}
}
},
"gridfs-stream": {
"version": "http://registry.npmjs.org/gridfs-stream/-/gridfs-stream-0.5.3.tgz"
"version": "0.5.3"
},
"mkdirp": {
"version": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz"
"version": "0.3.5"
}
}
}

@ -1,58 +1,58 @@
{
"dependencies": {
"ldapjs": {
"version": "http://registry.npmjs.org/ldapjs/-/ldapjs-0.7.1.tgz",
"version": "0.7.1",
"dependencies": {
"asn1": {
"version": "http://registry.npmjs.org/asn1/-/asn1-0.2.1.tgz"
"version": "0.2.1"
},
"assert-plus": {
"version": "http://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz"
"version": "0.1.5"
},
"bunyan": {
"version": "http://registry.npmjs.org/bunyan/-/bunyan-0.22.1.tgz",
"version": "0.22.1",
"dependencies": {
"mv": {
"version": "http://registry.npmjs.org/mv/-/mv-0.0.5.tgz"
"version": "0.0.5"
}
}
},
"nopt": {
"version": "http://registry.npmjs.org/nopt/-/nopt-2.1.1.tgz",
"version": "2.1.1",
"dependencies": {
"abbrev": {
"version": "http://registry.npmjs.org/abbrev/-/abbrev-1.0.7.tgz"
"version": "1.0.7"
}
}
},
"pooling": {
"version": "http://registry.npmjs.org/pooling/-/pooling-0.4.6.tgz",
"version": "0.4.6",
"dependencies": {
"once": {
"version": "http://registry.npmjs.org/once/-/once-1.3.0.tgz"
"version": "1.3.0"
},
"vasync": {
"version": "http://registry.npmjs.org/vasync/-/vasync-1.4.0.tgz",
"version": "1.4.0",
"dependencies": {
"jsprim": {
"version": "http://registry.npmjs.org/jsprim/-/jsprim-0.3.0.tgz",
"version": "0.3.0",
"dependencies": {
"extsprintf": {
"version": "http://registry.npmjs.org/extsprintf/-/extsprintf-1.0.0.tgz"
"version": "1.0.0"
},
"json-schema": {
"version": "http://registry.npmjs.org/json-schema/-/json-schema-0.2.2.tgz"
"version": "0.2.2"
},
"verror": {
"version": "http://registry.npmjs.org/verror/-/verror-1.3.3.tgz"
"version": "1.3.3"
}
}
},
"verror": {
"version": "http://registry.npmjs.org/verror/-/verror-1.1.0.tgz",
"version": "1.1.0",
"dependencies": {
"extsprintf": {
"version": "http://registry.npmjs.org/extsprintf/-/extsprintf-1.0.0.tgz"
"version": "1.0.0"
}
}
}

@ -47,13 +47,11 @@ Package.onUse(function(api) {
api.addFiles('settings/lib/settings.coffee');
// CLIENT
api.addFiles('client/Notifications.coffee', 'client');
api.addFiles('client/TabBar.coffee', 'client');
api.addFiles('client/MessageAction.coffee', 'client');
api.addFiles('settings/client/startup.coffee', 'client');
api.addFiles('settings/client/rocketchat.coffee', 'client');
// SERVER

@ -5,8 +5,9 @@
settingsDict = new ReactiveDict('settings')
RocketChat.settings.subscription = Meteor.subscribe 'settings'
RocketChat.settings.get = (_id) ->
return settingsDict.get(_id)
RocketChat.settings.onload '*', (key, value) ->
return settingsDict.set key, value
return settingsDict.set key, value

@ -1,2 +0,0 @@
Meteor.startup ->
Meteor.subscribe 'settings'

@ -34,6 +34,11 @@ RocketChat.settings.add 'Accounts_OAuth_Twitter', false, { type: 'boolean', grou
RocketChat.settings.add 'Accounts_OAuth_Twitter_id', '', { type: 'string', group: 'Accounts', section: 'Twitter' }
RocketChat.settings.add 'Accounts_OAuth_Twitter_secret', '', { type: 'string', group: 'Accounts', section: 'Twitter' }
RocketChat.settings.addGroup 'FileUpload'
RocketChat.settings.add 'FileUpload_Enabled', true, { type: 'boolean', group: 'FileUpload', public: true }
RocketChat.settings.add 'FileUpload_MaxFileSize', 2097152, { type: 'int', group: 'FileUpload', public: true }
RocketChat.settings.add 'FileUpload_MediaTypeWhiteList', 'image/*', { type: 'string', group: 'FileUpload', public: true }
RocketChat.settings.addGroup 'General'
RocketChat.settings.add 'Site_Url', __meteor_runtime_config__?.ROOT_URL, { type: 'string', group: 'General', i18nDescription: 'Site_Url_Description', public: true }
RocketChat.settings.add 'Site_Name', 'Rocket.Chat', { type: 'string', group: 'General', public: true }

@ -11,10 +11,10 @@ class Markdown
msg = message.html
# Support ![alt text](http://image url)
msg = msg.replace(/!\[(.*)\]\((https?:\/\/([\da-z\.-]+)([\/\w\# \.-]*)*\/?)\)/gm, '<a href="$2" title="$1" class="swipebox" target="_blank"><div class="inline-image" style="background-image: url($2);"></div></a>')
msg = msg.replace(/!\[([^\]]+)\]\((https?:\/\/[^\)]+)\)/gm, '<a href="$2" title="$1" class="swipebox" target="_blank"><div class="inline-image" style="background-image: url($2);"></div></a>')
# Support [Text](http://link)
msg = msg.replace(/\[(([\d\w\.-_] ?)+)\]\((https?:\/\/([\da-z\.-]+)([\/\w\# \.-]*)*\/?)\)/gm, '<a href="$3">$1</a>')
msg = msg.replace(/\[([^\]]+)\]\((https?:\/\/[^\)]+)\)/gm, '<a href="$2" target="_blank">$1</a>')
if RocketChat.settings.get('Markdown_Headers')
# Support # Text for h1

@ -15,11 +15,18 @@ getUrlContent = (urlObj, redirectCount = 5, callback) ->
hostname: urlObj.hostname
path: urlObj.path
rejectUnauthorized: !RocketChat.settings.get 'Allow_Invalid_SelfSigned_Certs'
headers: {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36'
}
httpOrHttps = if urlObj.protocol is 'https:' then https else http
parsedUrl = _.pick urlObj, ['host', 'hash', 'pathname', 'protocol', 'port', 'query']
RocketChat.callbacks.run 'oembed:beforeGetUrlContent',
requestOptions: opts
parsedUrl: parsedUrl
request = httpOrHttps.request opts, (response) ->
if response.statusCode is 301 and response.headers.location?
request.abort()
@ -109,6 +116,12 @@ OEmbed.getUrlMeta = (url, withFragment) ->
for header, value of content.headers
headers[changeCase.camelCase(header)] = value
RocketChat.callbacks.run 'oembed:afterParseContent',
meta: metas
headers: headers
parsedUrl: content.parsedUrl
content: content
return {
meta: metas
headers: headers

@ -0,0 +1,13 @@
<template name="oembedSoundcloudWidget">
{{#if parsedUrl}}
<blockquote>
<a href="https://www.soundcloud.com" style="color: #9e9ea6">SoundCloud</a><br/>
{{#if meta.twitterAudioArtistName}}
<a href="https://www.soundcloud.com/{{meta.twitterAudioArtistName}}">{{meta.twitterAudioArtistName}}</a><br/>
{{/if}}
<a href="{{meta.ogUrl}}">{{meta.ogTitle}}</a><br/>
<p>{{meta.ogDescription}}</p>
<iframe width="100%" height="150" src="{{meta.twitterPlayer}}" frameborder="0"></iframe><br/>
</blockquote>
{{/if}}
</template>

@ -0,0 +1,3 @@
Template.oembedBaseWidget.onCreated () ->
if this.data?.parsedUrl?.host is 'soundcloud.com' and this.data?.meta?.twitterPlayer?
this.data._overrideTemplate = 'oembedSoundcloudWidget'

@ -0,0 +1,10 @@
RocketChat.callbacks.add 'oembed:beforeGetUrlContent', (data) ->
# if data.parsedUrl is 'soundcloud.com'
# Do whatever you whant in sync way
# You can modify the object data.requestOptions to change how the request will be executed
RocketChat.callbacks.add 'oembed:afterParseContent', (data) ->
# if data.parsedUrl is 'soundcloud.com'
# Do whatever you whant in sync way
# You can modify the object data to change the parsed object

@ -0,0 +1,26 @@
Package.describe({
name: 'rocketchat:soundcloud',
version: '0.0.1',
summary: 'Soundcloud integration',
git: ''
});
Package.onUse(function(api) {
api.versionsFrom('1.0');
api.use([
'rocketchat:lib',
'coffeescript',
'templating',
'rocketchat:oembed@0.0.1'
]);
api.addFiles('lib/client/widget.coffee', 'client');
api.addFiles('lib/client/oembedSoundcloudWidget.html', 'client');
api.addFiles('lib/server/server.coffee', 'server');
});
Package.onTest(function(api) {
});

@ -24,7 +24,7 @@ class Spotify
changed = false
process message, message.msg, (message, msgParts, index, part) ->
re = /(?:^|\s)spotify:([^:]+):([^:]+)(?::([^:]+))?(?::(\S+))?(?:\s|$)/g
re = /(?:^|\s)spotify:([^:\s]+):([^:\s]+)(?::([^:\s]+))?(?::(\S+))?(?:\s|$)/g
while match = re.exec(part)
data = _.filter match.slice(1), (value) ->
return value?
@ -55,3 +55,4 @@ class Spotify
RocketChat.callbacks.add 'beforeSaveMessage', Spotify.transform, RocketChat.callbacks.priority.LOW
RocketChat.callbacks.add 'renderMessage', Spotify.render
RocketChat.Spotify = Spotify

@ -16,10 +16,10 @@ Package.onUse(function(api) {
'rocketchat:lib@0.0.1'
]);
api.addFiles('client/widget.coffee', 'client');
api.addFiles('client/oembedSpotifyWidget.html', 'client');
api.addFiles('lib/client/widget.coffee', 'client');
api.addFiles('lib/client/oembedSpotifyWidget.html', 'client');
api.addFiles('spotify.coffee', ['server','client']);
api.addFiles('lib/spotify.coffee', ['server','client']);
});
Package.onTest(function(api) {

@ -291,6 +291,11 @@ blockquote {
animation-iteration-count: infinite;
animation-timing-function: linear;
}
.icon-search {
position: absolute;
left: 2px;
top: 10px;
}
input {
padding-left: 20px;
}
@ -916,7 +921,7 @@ a.github-fork {
opacity: 1;
visibility: visible;
.transition(opacity .2s ease-out);
&.-hidden {
&.animated-hidden {
visibility: hidden;
opacity: 0;
}
@ -1013,7 +1018,7 @@ a.github-fork {
.transition(transform .3s cubic-bezier(.5, 0, .1, 1));
z-index:99;
&._hidden {
&.animated-hidden {
.transform(translateY(-100%) translateY(-50px));
}
> .wrapper {
@ -1114,7 +1119,7 @@ a.github-fork {
overflow-x: hidden;
width: @rooms-box-width;
.transition(transform .3s cubic-bezier(.5, 0, .1, 1));
&.hidden {
&.animated-hidden {
.transform(translateX(-100%));
header,
footer,
@ -1175,7 +1180,7 @@ a.github-fork {
padding: 0 10px;
z-index: 120;
text-align: left;
min-height: @footer-min-height;
height: @footer-min-height;
.transition-delay(.22s);
> div {
display: table-cell;
@ -1339,7 +1344,6 @@ a.github-fork {
left: 0;
width: 100%;
padding: 10px 15px 0px 15px;
z-index: 1000;
text-align: right;
min-height: @footer-min-height;
height: @footer-min-height;
@ -1607,7 +1611,7 @@ a.github-fork {
margin-right: -4px;
}
}
.hidden {
.animated-hidden {
visibility: hidden;
display: none;
}
@ -1843,66 +1847,20 @@ a.github-fork {
}
.list {
a {
.clearfix;
display: block;
padding: 10px 16px;
width: 100%;
border-bottom: 1px solid;
.transition(background .15s ease-out);
&:hover {
}
}
ul {
margin: 6px 0;
.user-image {
float: right;
margin-left: 12px;
}
li {
display: inline-block;
margin-right: 14px;
font-size: 11px;
position: relative;
&:after {
content: " ";
width: 4px;
height: 4px;
border-radius: 50%;
position: absolute;
right: -12px;
.calc(top,
~"50% - 2px");
}
&:nth-last-child(1) {
&:after {
display: none;
table {
width: 100%;
tbody {
td {
vertical-align: middle;
padding: 0 2px;
}
tr {
cursor: pointer;
}
}
}
.info {
display: block;
float: left;
.calc(width,~"100% - 150px");
i {
margin-right: 5px;
width: 20px;
text-align: left;
}
h3 {
font-size: 18px;
font-weight: 500;
}
a {
text-decoration: none;
}
}
.status {
display: block;
float: right;
width: 150px;
min-height: 30px;
text-align: right;
strong {
font-size: 12px;
font-weight: 500;
}
}
}
@ -2743,7 +2701,7 @@ a.github-fork {
1),
opacity .125s ease-out .1s);
}
> .-hidden {
> .animated-hidden {
.transform(translateX(100%));
opacity: 0;
}

@ -630,6 +630,14 @@ a.github-fork {
.status {
color: @secondary-font-color;
}
table {
tbody {
tr:nth-child(odd) {
background-color: @secondary-background-color;
}
}
}
}
}

@ -1,15 +0,0 @@
updateTheme = ->
el = $('#theme')[0]
if el
el.href = el.href.replace(/\?.*$/, '') + '?_dc=' + Random.id()
Meteor.startup ->
connected = Meteor.status().connected
Tracker.autorun ->
if connected is false and Meteor.status().connected is true
updateTheme()
connected = Meteor.status().connected
RocketChat.Notifications.onAll 'theme-updated', ->
updateTheme()

@ -12,12 +12,12 @@ Package.onUse(function(api) {
api.use('coffeescript');
api.use('underscore');
api.use('webapp');
api.use('webapp-hashing');
api.addFiles('server/server.coffee', 'server');
api.addFiles('server/variables.coffee', 'server');
api.addFiles('client/client.coffee', 'client');
api.addFiles('client/minicolors/jquery.minicolors.css', 'client');
api.addFiles('client/minicolors/jquery.minicolors.js', 'client');

@ -1,4 +1,33 @@
less = Npm.require('less')
crypto = Npm.require('crypto')
calculateClientHash = WebAppHashing.calculateClientHash
WebAppHashing.calculateClientHash = (manifest, includeFilter, runtimeConfigOverride) ->
css = RocketChat.theme.getCss()
WebAppInternals.staticFiles['/__cordova/theme.css'] = WebAppInternals.staticFiles['/theme.css'] =
cacheable: true
sourceMapUrl: undefined
type: 'css'
content: css
hash = crypto.createHash('sha1').update(css).digest('hex')
themeManifestItem = _.find manifest, (item) -> return item.path is 'app/theme.css'
if not themeManifestItem?
themeManifestItem = {}
manifest.push themeManifestItem
themeManifestItem.path = 'app/theme.css'
themeManifestItem.type = 'css'
themeManifestItem.cacheable = true
themeManifestItem.where = 'client'
themeManifestItem.url = "/theme.css?#{hash}"
themeManifestItem.size = css.length
themeManifestItem.hash = hash
calculateClientHash.call this, manifest, includeFilter, runtimeConfigOverride
RocketChat.theme = new class
variables: {}
@ -55,7 +84,7 @@ RocketChat.theme = new class
RocketChat.settings.updateById 'css', data.css
RocketChat.Notifications.notifyAll 'theme-updated'
process.emit('message', {refresh: 'client'})
addVariable: (type, name, value, isPublic=true) ->
@variables[name] =
@ -89,15 +118,3 @@ RocketChat.theme = new class
getCss: ->
return RocketChat.settings.get 'css'
WebApp.connectHandlers.use '/theme.css', (req, res, next) ->
css = RocketChat.theme.getCss()
res.setHeader 'content-type', 'text/css; charset=UTF-8'
res.setHeader 'Content-Disposition', 'inline'
res.setHeader 'Cache-Control', 'no-cache'
res.setHeader 'Pragma', 'no-cache'
res.setHeader 'Expires', '0'
res.end css

@ -1 +1,3 @@
v0.6.dev
v0.7.dev
This is an unsupported non-production development release.

@ -0,0 +1,14 @@
Meteor.methods
getRoomIdByNameOrId: (rid) ->
console.log '[methods] getRoomIdByNameOrId-> '.green, 'userId:', Meteor.userId(), 'arguments:', arguments
room = RocketChat.models.Rooms.findOneById rid
if not room?
room = RocketChat.models.Rooms.findOneByName rid
if room?
rid = room._id
return rid

@ -0,0 +1,52 @@
describe 'Spotify integration', () ->
describe 'Spotify id transformer', () ->
it 'should transform track id to link and add it to message urls', () ->
message = {'urls': [], 'msg': 'spotify:track:34AWo71Ya5gq7wpNnatwr7'}
output = RocketChat.Spotify.transform message
expect(output).toEqual {'urls':[{'url': 'https://open.spotify.com/track/34AWo71Ya5gq7wpNnatwr7', 'source':'spotify:track:34AWo71Ya5gq7wpNnatwr7'}], 'msg': 'spotify:track:34AWo71Ya5gq7wpNnatwr7'}
it 'should transform artist id to link and add it to message urls', () ->
message = {'urls': [], 'msg': 'spotify:artist:0OdUWJ0sBjDrqHygGUXeCF'}
output = RocketChat.Spotify.transform message
expect(output).toEqual {'urls':[{'url': 'https://open.spotify.com/artist/0OdUWJ0sBjDrqHygGUXeCF', 'source': 'spotify:artist:0OdUWJ0sBjDrqHygGUXeCF'}], 'msg': 'spotify:artist:0OdUWJ0sBjDrqHygGUXeCF'}
it 'should transform album id to link and add it to message urls', () ->
message = {'urls': [], 'msg': 'spotify:album:0sNOF9WDwhWunNAHPD3Baj'}
output = RocketChat.Spotify.transform message
expect(output).toEqual {'urls':[{'url': 'https://open.spotify.com/album/0sNOF9WDwhWunNAHPD3Baj', 'source': 'spotify:album:0sNOF9WDwhWunNAHPD3Baj'}], 'msg': 'spotify:album:0sNOF9WDwhWunNAHPD3Baj'}
it 'should transform user playlist id to link and add it to message urls', () ->
message = {'urls': [], 'msg': 'spotify:user:spotifybrazilian:playlist:4k7EZPI3uKMz4aRRrLVfen'}
output = RocketChat.Spotify.transform message
expect(output).toEqual {'urls':[{'url': 'https://open.spotify.com/user/spotifybrazilian/playlist/4k7EZPI3uKMz4aRRrLVfen', 'source': 'spotify:user:spotifybrazilian:playlist:4k7EZPI3uKMz4aRRrLVfen'}], 'msg': 'spotify:user:spotifybrazilian:playlist:4k7EZPI3uKMz4aRRrLVfen'}
it 'should transform id to link even if wrapped around text', () ->
message = {'urls': [], 'msg': 'a text before spotify:track:34AWo71Ya5gq7wpNnatwr7 a text after'}
output = RocketChat.Spotify.transform message
expect(output).toEqual {'urls':[{'url': 'https://open.spotify.com/track/34AWo71Ya5gq7wpNnatwr7', 'source':'spotify:track:34AWo71Ya5gq7wpNnatwr7'}], 'msg': 'a text before spotify:track:34AWo71Ya5gq7wpNnatwr7 a text after'}
it 'should transform id to link and add it to message urls without erasing previous urls', () ->
message = {'urls': [{'url': 'https://www.youtube.com/watch?v=_ze-sS61mCs'}], 'msg': 'https://www.youtube.com/watch?v=_ze-sS61mCs and spotify:track:34AWo71Ya5gq7wpNnatwr7'}
output = RocketChat.Spotify.transform message
expect(output).toEqual {'urls':[{'url': 'https://www.youtube.com/watch?v=_ze-sS61mCs'}, {'url': 'https://open.spotify.com/track/34AWo71Ya5gq7wpNnatwr7', 'source':'spotify:track:34AWo71Ya5gq7wpNnatwr7'}], 'msg': 'https://www.youtube.com/watch?v=_ze-sS61mCs and spotify:track:34AWo71Ya5gq7wpNnatwr7'}
it 'should not apply transformation on links inside inline literal', () ->
message = {'urls': [], 'msg': '`spotify:track:34AWo71Ya5gq7wpNnatwr7`'}
output = RocketChat.Spotify.transform message
expect(output).toEqual message
it 'should not apply transformation on links inside code block', () ->
message = {'urls': [], 'msg': '``` spotify:track:34AWo71Ya5gq7wpNnatwr7 ```'}
output = RocketChat.Spotify.transform message
expect(output).toEqual message
describe 'Spotify id autolinker', () ->
it 'should autolink spotify id', () ->
message = RocketChat.Spotify.transform {'urls': [], 'msg': 'spotify:track:34AWo71Ya5gq7wpNnatwr7', 'html': 'spotify:track:34AWo71Ya5gq7wpNnatwr7'}
output = RocketChat.Spotify.render message
expect(output.html).toEqual '<a href="https://open.spotify.com/track/34AWo71Ya5gq7wpNnatwr7" target="_blank">spotify:track:34AWo71Ya5gq7wpNnatwr7</a>'
it 'should autolink spotify id even if wrapped around text', () ->
message = RocketChat.Spotify.transform {'urls': [], 'msg': 'a text before spotify:track:34AWo71Ya5gq7wpNnatwr7 a text after', 'html': 'a text before spotify:track:34AWo71Ya5gq7wpNnatwr7 a text after'}
output = RocketChat.Spotify.render message
expect(output.html).toEqual 'a text before <a href="https://open.spotify.com/track/34AWo71Ya5gq7wpNnatwr7" target="_blank">spotify:track:34AWo71Ya5gq7wpNnatwr7</a> a text after'
Loading…
Cancel
Save