Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into develop

pull/1806/head
Marcelo Schmidt 10 years ago
commit ff44d4783a
  1. 4
      .sandstorm/sandstorm-pkgdef.capnp
  2. 6
      .travis.yml
  3. 248
      HISTORY.md
  4. 22
      client/routes/adminRouter.coffee
  5. 9
      client/routes/router.coffee
  6. 3
      client/startup/defaultRoomTypes.coffee
  7. 3
      packages/rocketchat-authorization/client/route.coffee
  8. 18
      packages/rocketchat-channel-settings/client/startup/tabBar.coffee
  9. 18
      packages/rocketchat-chatops/client/tabBar.coffee
  10. 7
      packages/rocketchat-integrations/client/route.coffee
  11. 31
      packages/rocketchat-lib/client/TabBar.coffee
  12. 35
      packages/rocketchat-lib/client/defaultTabBars.js
  13. 13
      packages/rocketchat-lib/client/lib/openRoom.coffee
  14. 2
      packages/rocketchat-lib/package.js
  15. 2
      packages/rocketchat-lib/rocketchat.info
  16. 6
      packages/rocketchat-mailer/client/router.coffee
  17. 11
      packages/rocketchat-mentions-flextab/client/tabBar.coffee
  18. 13
      packages/rocketchat-message-pin/client/tabBar.coffee
  19. 11
      packages/rocketchat-message-star/client/tabBar.coffee
  20. 29
      packages/rocketchat-ui-admin/admin/users/adminUsers.coffee
  21. 2
      packages/rocketchat-ui-admin/admin/users/adminUsers.html
  22. 29
      packages/rocketchat-ui-flextab/flex-tab/flexTabBar.coffee
  23. 2
      packages/rocketchat-ui-flextab/flex-tab/flexTabBar.html
  24. 2
      packages/rocketchat-ui/lib/accountBox.coffee
  25. 3
      packages/rocketchat-ui/views/app/privateHistory.coffee
  26. 4
      packages/rocketchat-ui/views/app/room.coffee
  27. 1
      server/startup/roomPublishes.coffee

@ -19,9 +19,9 @@ const pkgdef :Spk.PackageDefinition = (
appTitle = (defaultText = "Rocket.Chat"),
appVersion = 7, # Increment this for every release.
appVersion = 8, # Increment this for every release.
appMarketingVersion = (defaultText = "0.11.0"),
appMarketingVersion = (defaultText = "0.12.0"),
# Human-readable representation of appVersion. Should match the way you
# identify versions of your app in documentation and marketing.

@ -4,7 +4,7 @@ branches:
only:
- develop
- master
- /^v(\d+\.)?(\d+\.)?(\*|\d+)$/
- "/^v(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$/"
git:
depth: 1
node_js:
@ -31,7 +31,7 @@ deploy:
provider: releases
api_key:
secure: SLtbGv9vL6qC3rKGwKuXfUSFuRCeLsBFiRA1nBDWoyua7F3rLy8fBvhS3sXRDCqAF6hJgXQwZzX2pS1Lljwjjmwi/80Ns7VDtreX5QstHukFAxaJh2E0Lz5zQdSqAb61KdAipZmYfp2fgCr8T+xztE/mvtPD5R8CcIQIjJpl9rh+mrkkshkcaNOY4JQrqyrcTeCOeBQMXTZSkkbdJr4gb9++A2c61K0txfid9+VwqGm5MwvaT80JC5wLQkL8rS9OUcNJHFf90ELFZpRZnZnI2lsfmTBAxRKL994UZgzru3XNMhUTsJPh7OyVn/xSlyjLcvsn4dSon1PE9t3RkuxsbTxx/XY+gIkXSGl38jZlhextaJoV0gTFkEg33tF/aZ4+I+iZM8LYfRAoUuZU0fSzGnFtFZp4xptF2ECLKmI/3dmuE6iwr+G1xUer9g2Rq9fXXrHgUA164544IdY4aDisxd9U78U0K7WaPtbvphiVl4GbgVnfTEgNVdpXcQxUtcXPZMiBRz5+E+1fExmCfO6+7mZ/yzDrsFYoRdmuo1SMGRI4iqb5jl/PImZ9ukTqRmQdqd3WJp3zzPbIEJPwhMtS5LMxzBMSfugXwjEajkXybcH5CWQ7jo+ogNqcM/CcJ3q4ahYuLTN7VeZWZ8h5kwr9bPxPooZuhWw0WPRa+XUM22o=
file:
file:
- "$ROCKET_DEPLOY_DIR/rocket.chat-$ROCKET_BRANCH.tgz"
- "$ROCKET_DEPLOY_DIR/rocket.chat-$ROCKET_BRANCH.tgz.asc"
- "$ROCKET_DEPLOY_DIR/rocket.chat-$ROCKET_BRANCH.spk"
@ -42,4 +42,4 @@ after_deploy:
- ".travis/docker.sh"
env:
global:
secure: y9LYMUBDtiAUlIwJEvubBrYLVrjPsPg7ClY5HcFisdm7OwOzMqHcjTFX8Sj2tN/6IXNcZLqFOhHcwuSdM0uUbBIDooTVnwMVSIy6ExZFOaZNrvAf/Axf2k6p15iAmtPmVo7o+us5SRVRQvuP6GqdUPMYIYn71jHrrjUKQp3/hgRZBlpIn7dyPs5WuLVXZda5hVjIjJpSfK1RZDoGd/b7o8jywvFgSdvBiB+lX1VXCVisRJU9yS28CGIcpoxeQg9AFk4Uez6+8+b/koLp3imQddY9VjYyYx2D8fNxRcUujUHux24VG5MSzQRtJh9JwLlJ+pyAN1KUSvoam6R3MQGoKJg0AH3UxikmSQ4yGZwsSkPSqWbRCRgSVmNtq/YLuTJjQEUHmMCxXUb53HdJisAaxaQiOfg/IfqMVtUWeeIfSDDNEhO9WgpuNvf4fOltdwlL2N1YwubR/fGw8/W/to9jSu94FxJHw6c2V4KQOJqq1XA+KtwMMYak82NjfS2DIhcwyf4EaKagkg4HD3z5BYpuxQdeQnkQkvvkvkI26kV+jPkqUGRlejS7AXG4PrhcUUf/nBvvWjUFrLwvk+epkMP3D2k94r2XUl7apyrANTfyTVyOCc1ogUu9N2XC4ShF2uxu5hoNxk+hNTo1D7uSrFE7aM1GpDFRPOUjtpt2E0mqOoQ=
secure: lDiDmo2SGHx1v4G49wsCp8kvg84SFAsAvPuFd5ngba7j038GwgcIVfqgc+7Vgi007gUL86Z74B124mtV4rQjyXhgoSxyg482FDoOx1Hh4vKzcnW3xWI/Du0epyl3MVDijDh1Y34WTWLH7YST1ViDk4GKk+Nvwv+sydac3IwsRHLRtUnzAIwa9DigE+wA9vChBqPL2kAdGlnpkl8bWUhMB8MYtyQY9gR2jVxaTGBLIJKIy1mVEAg8MOVGEKZ7POQQ/yP29MfNd7GvGt8Gz+k09z4iMJrU4Plq4UCGPXM3QVSh6yG4CXXFkMsv8TwFBNrdmkxmUK33IP8XT4B15tUirbSNUvf0BQ1+WHdgHiv1omhmBnp4c3b+CI4Mzh7FBVmQYdkkucS/v7n+HJk25MRWdg43VXyxib/fkIS5vx4pTokbA/ftOvZOCA3fM5wc5McFalwefn9SEia0zDgKJM+aoxgB4wIACUJcjzI0hfclDUn7SzSTuXxaCYLM47EgKBN0I0D4GCITKKm8wlNwUnm6n+f3PqVykzKIYt08iFNI3SlVgTRMHGWYQlWR/HjYRkpq8wEdL21scTVz2652AP2/tbKqok26fFbphrgHxzhYG2xp2HOT3NMpCC0oprTaUFSWHru7bLAmbwBJL4VWwiVCN35rG9SU6X2Zq2StXbaM6B0=

@ -0,0 +1,248 @@
## v.NEXT
## v0.12.0, 2016-Jan-04
- Settings: unset section if none is given on update
- Hide registration and forgot password links when hidding login form
- Upload build artifacts to GitHub and sign tgz for docker images
- Add a setting to disable form-based login
- Button to test SMTP settings
- No need to reload server for SMTP settings to take effect
- Fix livechat trigger by url
- Increase the delay to render color fields
- Fix guest users default role
- Improved clean button color
- Support named color for message attachments
- Added request debug messages
- Trim integration messages
- Try to parse all request bodies as JSON
- New password reset screen
## v0.11.0, 2015-Dec-28
- Add role bot to users of integrations in scope bot
- Add route to cadastre new integrations via API
- Add "Jump to" and infinite scroll to message search results
- Add infinite scroll to files list
- Add livechat branding
- Add new color variables to the theme editor
- Adjust tgz filename in Dockerfile
- Allow bot call deleteOutgoingIntegration
- Allow creation of outgoing integrations from bots
- Allow searching for logged in user in userAutocomplete
- Always use a department if there is only one active
- Better message positioning
- Change /invite to use addUserToRoom instead joinRoom
- Create direct rooms correctly in incoming hook
- Only join user in public channels via integrations
- Fix ungroup of messages after join message
- Do not load all settings to process.env
- Enable triggers in messages to users
- Enable/disable livechat pre registration form pick a department at livechat pre registration
- Enforce data in body params
- Execute outgoing triggers
- Fix error on roomExit callback
- Fix livechat agent subscription creation
- Fix livechat triggers not triggering
- Fix preview of images in mobile
- Fix triggers with defined channels
- Fix update of permissions
- Get integration name from body
- If no channel in trigger listen all public channels
- Make sample data into array
- Move set of integration type to server side
- Re order settings
- Remove integration if trigger response is 410
- Remove unecessary logs
- Removed livechat duplicated route definition
- Rename integration api routes, add apis remove, info and sample
- Set user role in integration update too
- Tokenize message on message render to prevent re processing
- Turn channel and triggerWords optional in triggers
- Using branding image from main APP
## v0.10.2, 2015-Dec-22
- Fixes image preview bugs with filenames containing spaces
## v0.10.1, 2015-Dec-21
- Fix upload permissions introduced in raik:ufs 0.3.4
## v0.10.0, 2015-Dec-21
- Accept property *msg* as text in attachments
- Add "Room has been deleted" entry
- Add /kick command and button for kicking users from room
- Add an not-authorized exception instead of a console.log
- Add an option to show warning in a setting
- Add copy to clipboard button on installation
- Add examples of curl and json in integrations
- Add field to display the integration token
- Add hover background color for messages
- Add msg property as an alternative for text
- Add option to disable setting based in other setting and another impr…
- Add setting to turn on/off debug messages from methods and publishes
- Add some docs about Settings API
- Adding setting for protected uploads; updating jail:us to 0.3.3
- Adjust layout direction based on user's language
- Allow cascade methods in settings creation
- Allow emoji as avatar for webhooks/integrations
- Allow OEmbed to bypass file protection
- Allow pass an array of roles to user in Acctouns.createUser
- Allow to set messages as ungroupable
- Appearance settings
- Attachments: Concerning the mobile settings to save badwidth and fix …
- Bump version to 0.10.0
- Centralize message better
- Centralize messages
- Change order of loading variables
- Change the rate limit of method setAvatarFromService from 1m to 5s
- Changes to layout and added infinite scroll to mentions bar
- Check if file is empty before upload
- Closes #1691; Fiz a grouping error in messages from history
- Code cleanup
- Configure LGTM approvals
- Create method in settings to update options of one setting
- Detect file dimensions in uploads and set height of image in attachments
- Detect if system is runing GM or IM, add info to RocketChat.Info and …
- Disable ldap settings when ldap is disabled
- Explain the available docker images
- Fix a PT translation
- Fix avatar position on compact view
- Fix checking if message is command
- Fix crash when connection reset from LDAP server
- Fix deleting a message not deleting it's attachments
- Fix error "Cannot read property 'replace' of undefined"
- Fix guest permissions
- Fix language loading from cordova
- Fix merge mess =P
- Fix mute by setting mute on room instead of subscription
- Fix pin and star
- Fix some ldap problems and set reconnect to true
- Fix sort of settings
- Fix URL
- Fixed pin and star
- Fixed several english issues.
- Get next agent on queue
- Group message by time, default 5min
- Improve avatar resize function to use GM detection and allow change s…
- Improve error when closing window
- Improved triggers settings
- Initial trigger support
- Livechat appearance preview
- Livechat hooks
- Livechat manager fix and improvements
- Livechat sidenav active item
- Livechat widget preview
- LoadSurroundingMessages
- Mentions sidenav;
- Missing language entries
- More improvements in message grouping
- Mover rocketchat.info into rocketchat:lib
- Mute/Unmute commands and button
- New icon for unpin
- New MAINTERRS
- Pass role to user created via SAML integration
- Protecting uploaded files
- Removed all console.logs from publishes and methods
- Removed ES code
- Removed kadira package
- Removed logs
- Removed unused code
- Render a player for audio files
- Return the correct error for unauthorized upload access
- Revert "Allow OEmbed to bypass file protection"
- Saving livechat trigger config
- Set avatar resize enabled by default
- Setting only one, either emoji or avatar, but never both
- Show warning and allow admins to fix the Site URL
- Support calls from client / browsers
- Ui fix for livechat survey
- Undo wrongly commited file
- Unsubscribe e-mails from CSV
- Update aldeed:simple-schema to 1.5.1
- Update Ansible link to beginners friendly deployment guide
- Update jalik:ufs to 0.3.4
- Updated aldeed:simple-schema to 1.5.0
- Updated muted usernames on setUsername
- Use attachments to render preview of uploads and use relative paths
- Using flow-router group routes
## v0.9.0, 2015-Dec-14
- Fix broken image-link when og:image contains "&" (e.g. Google Maps)
- Error message when file upload media type it not accepted
- Added setting Accounts_LoginExpiration
- Fix 'create new' in private group list opening 'create channel' flex
- Moved RocketMailer to Mailer
- Move avatars on username change
- Livechat Survey
- Livechat popout support
- New integrations panel on the admin
- Many fixes on rtl.less
- Avatars for Unicode usernames
- Fix for mentioning RTL names
- Force file names to always be in LTR
- Add query operator for mailer
- Departments support
- Fixes issue #1619 persistent custom oauth.
- Add a new setting type "action" to call server methods
- Add lib clipboard.js
- Add new page container type, settings
- Add new role, manage-integrations
- Add settings/action to allow admins restart the server
- Allow arrays of keys in RocketChat.settings.onload
- Allow avatar and alias customization
- Allow packages to register files for theming
- Allow use Markdown to render a single stringn and register a helper
- Change layout of attachments
- Create a setting/action to test push notifications
- Create a user rocket.cat and set avatar on system initialization
- Do not alert admins about wrong url if accessing from cordova
- Encode url and token
- Implement package for message attachments
- Inform user to refresh page after extension install
- Pass success message to settings/actions
- Prepare code to reconfigure push plugin in runtime
- Prevent parse message urls if option parseUrls is false in message
- Prompt users to install extentions to enable screen sharing
- Shos if message is from bot and never render compact message version
- Fixed blockquote non-continous border
- Moved accountBox HTML to new separated template
## v0.8.0, 2015-Dec-8
- Fixed error: when allow change username was set to false, registration
- Improve message rendering removing MessageAction from render time
- Textarea theme fix for RTL
- Update the flex-nav hidden element for RTL
- Refresh the count of unread messages on scroll
- Reset correctly all counters of unread marks
- Force deletion and stop computations of templates when closing room
- Close rooms when more than 10 is open instead of closing rooms
- Reset avatar before uploading to prevent caching
- Create page to manage assets and change favicons
- Added option to disable "Forgot Password" link on login page
- New RocketChat.RateLimiter
- Favico.js update
- Better RTL support
- Remove custom oAuth record when removed from settings
- Improve Settings layout
- Collapse sub groups of settings
- Change translations in PT for False and True
- Added Secret URL
- Fix push notification for android
- Enable push bay default and improve settings organization
- Alert admin if configured url is different from current
- Translate section of settings
- Add "Meiryo UI" to font-family
- Fix livechat visitor can't chat after refresh
- Fix can't send msgs to new livechat rooms
- Clear iOS app badge on app startup
- Fix for image swipebox to show in RTL interface
## v0.1.0, 2015-May-19
- Initial public launch

@ -1,33 +1,27 @@
tabReset = ->
RocketChat.TabBar.reset()
FlowRouter.route '/admin/users',
name: 'admin-users'
triggersEnter: [tabReset]
triggersExit: [tabReset]
triggersExit: [ ->
Session.set 'adminSelectedUser'
]
action: ->
Session.set 'adminSelectedUser'
RocketChat.TabBar.showGroup 'adminusers'
BlazeLayout.render 'main', {center: 'adminUsers'}
FlowRouter.route '/admin/rooms',
name: 'admin-rooms'
triggersEnter: [tabReset]
triggersExit: [tabReset]
action: ->
RocketChat.TabBar.showGroup 'adminrooms'
BlazeLayout.render 'main', {center: 'adminRooms'}
FlowRouter.route '/admin/statistics',
name: 'admin-statistics'
triggersEnter: [tabReset]
triggersExit: [tabReset]
action: ->
RocketChat.TabBar.showGroup 'adminstatistics'
BlazeLayout.render 'main', {center: 'adminStatistics'}
FlowRouter.route '/admin/:group?',
name: 'admin'
triggersEnter: [tabReset]
triggersExit: [tabReset]
action: ->
RocketChat.TabBar.showGroup 'admin'
BlazeLayout.render 'main', {center: 'admin'}

@ -3,7 +3,6 @@ Blaze.registerHelper 'pathFor', (path, kw) ->
BlazeLayout.setRoot 'body'
FlowRouter.subscriptions = ->
Tracker.autorun =>
RoomManager.init()
@ -42,7 +41,7 @@ FlowRouter.route '/home',
name: 'home'
action: ->
RocketChat.TabBar.reset()
RocketChat.TabBar.showGroup 'home'
BlazeLayout.render 'main', {center: 'home'}
KonchatNotification.getDesktopPermission()
@ -51,18 +50,17 @@ FlowRouter.route '/changeavatar',
name: 'changeAvatar'
action: ->
RocketChat.TabBar.showGroup 'changeavatar'
BlazeLayout.render 'main', {center: 'avatarPrompt'}
FlowRouter.route '/account/:group?',
name: 'account'
action: (params) ->
RocketChat.TabBar.closeFlex()
RocketChat.TabBar.resetButtons()
unless params.group
params.group = 'Preferences'
params.group = _.capitalize params.group, true
RocketChat.TabBar.showGroup 'account'
BlazeLayout.render 'main', { center: "account#{params.group}" }
@ -74,6 +72,7 @@ FlowRouter.route '/history/private',
action: ->
Session.setDefault('historyFilter', '')
RocketChat.TabBar.showGroup 'private-history'
BlazeLayout.render 'main', {center: 'privateHistory'}

@ -11,6 +11,7 @@ RocketChat.roomTypes.add 'c', 10,
action: (params, queryParams) ->
Session.set 'showUserInfo'
openRoom 'c', params.name
RocketChat.TabBar.showGroup 'channel'
link: (sub) ->
return { name: sub.name }
permissions: [ 'view-c-room' ]
@ -24,6 +25,7 @@ RocketChat.roomTypes.add 'd', 20,
action: (params, queryParams) ->
Session.set 'showUserInfo', params.username
openRoom 'd', params.username
RocketChat.TabBar.showGroup 'directmessage'
link: (sub) ->
return { username: sub.name }
permissions: [ 'view-d-room' ]
@ -37,6 +39,7 @@ RocketChat.roomTypes.add 'p', 30,
action: (params, queryParams) ->
Session.set 'showUserInfo'
openRoom 'p', params.name
RocketChat.TabBar.showGroup 'privategroup'
link: (sub) ->
return { name: sub.name }
permissions: [ 'view-p-room' ]

@ -1,6 +1,7 @@
FlowRouter.route '/admin/permissions',
name: 'admin-permissions'
action: (params) ->
RocketChat.TabBar.showGroup 'admin-permissions'
BlazeLayout.render 'main',
center: 'pageContainer'
pageTitle: t('Permissions')
@ -9,6 +10,7 @@ FlowRouter.route '/admin/permissions',
FlowRouter.route '/admin/permissions/:name?/edit',
name: 'admin-permissions-edit'
action: (params) ->
RocketChat.TabBar.showGroup 'admin-permissions'
BlazeLayout.render 'main',
center: 'pageContainer'
pageTitle: t('Role_Editing')
@ -17,6 +19,7 @@ FlowRouter.route '/admin/permissions/:name?/edit',
FlowRouter.route '/admin/permissions/new',
name: 'admin-permissions-new'
action: (params) ->
RocketChat.TabBar.showGroup 'admin-permissions'
BlazeLayout.render 'main',
center: 'pageContainer'
pageTitle: t('Role_Editing')

@ -1,12 +1,8 @@
Meteor.startup ->
RocketChat.callbacks.add 'enter-room', (subscription) ->
RocketChat.TabBar.addButton
id: 'channel-settings'
i18nTitle: 'Room_Info'
icon: 'octicon octicon-info'
template: 'channelSettings'
order: 0
, RocketChat.callbacks.priority.MEDIUM, 'enter-room-tabbar-channel-settings'
RocketChat.TabBar.addButton
groups: ['channel', 'privategroup', 'directmessage']
id: 'channel-settings'
i18nTitle: 'Room_Info'
icon: 'octicon octicon-info'
template: 'channelSettings'
order: 0

@ -1,18 +1,9 @@
Meteor.startup ->
RocketChat.callbacks.add 'enter-room', ->
#if Meteor.user()?.services?.github?.id or Meteor.user()?.services?.gitlab?.id
# console.log 'Adding chatops to tabbar'
# RocketChat.TabBar.addButton
# id: 'chatops-button'
# i18nTitle: 'rocketchat-chatops:Chatops_Title'
# icon: 'icon-code'
# template: 'chatops'
# order: 4
Tracker.autorun ->
if RocketChat.settings.get('Chatops_Enabled')
console.log 'Adding chatops to tabbar'
RocketChat.TabBar.addButton
groups: ['channel', 'privategroup', 'directmessage']
id: 'chatops-button2'
i18nTitle: 'rocketchat-chatops:Chatops_Title'
icon: 'octicon octicon-hubot'
@ -21,10 +12,13 @@ Meteor.startup ->
console.log 'Adding chatops to tabbar'
RocketChat.TabBar.addButton
groups: ['channel', 'privategroup', 'directmessage']
id: 'chatops-button3'
i18nTitle: 'rocketchat-chatops:Chatops_Title'
icon: 'octicon octicon-inbox'
template: 'chatops_droneflight'
width: 675
order: 5
, RocketChat.callbacks.priority.MEDIUM, 'enter-room-tabbar-chatops'
else
RocketChat.TabBar.removeButton 'chatops-button2'
RocketChat.TabBar.removeButton 'chatops-button3'

@ -1,34 +1,35 @@
FlowRouter.route '/admin/integrations',
name: 'admin-integrations'
action: (params) ->
RocketChat.TabBar.showGroup 'admin-integrations'
BlazeLayout.render 'main',
center: 'pageSettingsContainer'
pageTitle: t('Integrations')
pageTemplate: 'integrations'
FlowRouter.route '/admin/integrations/new',
name: 'admin-integrations-new'
action: (params) ->
RocketChat.TabBar.showGroup 'admin-integrations'
BlazeLayout.render 'main',
center: 'pageSettingsContainer'
pageTitle: t('Integration_New')
pageTemplate: 'integrationsNew'
FlowRouter.route '/admin/integrations/incoming/:id?',
name: 'admin-integrations-incoming'
action: (params) ->
RocketChat.TabBar.showGroup 'admin-integrations'
BlazeLayout.render 'main',
center: 'pageSettingsContainer'
pageTitle: t('Integration_Incoming_WebHook')
pageTemplate: 'integrationsIncoming'
params: params
FlowRouter.route '/admin/integrations/outgoing/:id?',
name: 'admin-integrations-outgoing'
action: (params) ->
RocketChat.TabBar.showGroup 'admin-integrations'
BlazeLayout.render 'main',
center: 'pageSettingsContainer'
pageTitle: t('Integration_Outgoing_WebHook')

@ -4,11 +4,15 @@ RocketChat.TabBar = new class
buttons = new ReactiveVar {}
extraGroups = {}
animating = false
open = new ReactiveVar false
template = new ReactiveVar ''
data = new ReactiveVar {}
visibleGroup = new ReactiveVar ''
setTemplate = (t, callback) ->
return if animating is true
template.set t
@ -65,6 +69,12 @@ RocketChat.TabBar = new class
Tracker.nonreactive ->
btns = buttons.get()
btns[config.id] = config
if extraGroups[config.id]?
btns[config.id].groups ?= []
btns[config.id].groups = _.union btns[config.id].groups, extraGroups[config.id]
delete extraGroups[config.id]
buttons.set btns
removeButton = (id) ->
@ -93,6 +103,23 @@ RocketChat.TabBar = new class
resetButtons = ->
buttons.set {}
showGroup = (group) ->
visibleGroup.set group
getVisibleGroup = ->
visibleGroup.get()
addGroup = (id, groups) ->
Tracker.nonreactive ->
btns = buttons.get()
if btns[id]
btns[id].groups ?= []
btns[id].groups = _.union btns[id].groups, groups
buttons.set btns
else
extraGroups[id] ?= []
extraGroups[id] = _.union extraGroups[id], groups
setTemplate: setTemplate
setData: setData
getTemplate: getTemplate
@ -108,3 +135,7 @@ RocketChat.TabBar = new class
getButtons: getButtons
reset: reset
resetButtons: resetButtons
showGroup: showGroup
getVisibleGroup: getVisibleGroup
addGroup: addGroup

@ -0,0 +1,35 @@
RocketChat.TabBar.addButton({
groups: ['channel', 'privategroup', 'directmessage'],
id: 'message-search',
i18nTitle: 'Search',
icon: 'octicon octicon-search',
template: 'messageSearch',
order: 1
});
RocketChat.TabBar.addButton({
groups: ['directmessage'],
id: 'user-info',
i18nTitle: 'User_Info',
icon: 'octicon octicon-person',
template: 'membersList',
order: 2
});
RocketChat.TabBar.addButton({
groups: ['channel', 'privategroup'],
id: 'members-list',
i18nTitle: 'Members_List',
icon: 'octicon octicon-organization',
template: 'membersList',
order: 2
});
RocketChat.TabBar.addButton({
groups: ['channel', 'privategroup', 'directmessage'],
id: 'uploaded-files-list',
i18nTitle: 'Room_uploaded_file_list',
icon: 'octicon octicon-file-symlink-directory',
template: 'uploadedFilesList',
order: 3
});

@ -50,16 +50,9 @@ currentTracker = undefined
$('.message-form .input-message').focus()
, 100
RocketChat.TabBar.resetButtons()
RocketChat.TabBar.addButton({ id: 'message-search', i18nTitle: t('Search'), icon: 'octicon octicon-search', template: 'messageSearch', order: 1 })
if type is 'd'
RocketChat.TabBar.addButton({ id: 'members-list', i18nTitle: t('User_Info'), icon: 'octicon octicon-person', template: 'membersList', order: 2 })
else
RocketChat.TabBar.addButton({ id: 'members-list', i18nTitle: t('Members_List'), icon: 'octicon octicon-organization', template: 'membersList', order: 2 })
RocketChat.TabBar.addButton({ id: 'uploaded-files-list', i18nTitle: t('Room_uploaded_file_list'), icon: 'octicon octicon-file-symlink-directory', template: 'uploadedFilesList', order: 3 })
# update user's room subscription
if ChatSubscription.findOne({rid: room._id})?.open is false
sub = ChatSubscription.findOne({rid: room._id})
if sub?.open is false
Meteor.call 'openRoom', room._id
RocketChat.callbacks.run 'enter-room', ChatSubscription.findOne({rid: room._id})
RocketChat.callbacks.run 'enter-room', sub

@ -98,6 +98,8 @@ Package.onUse(function(api) {
api.addFiles('client/TabBar.coffee', 'client');
api.addFiles('client/MessageAction.coffee', 'client');
api.addFiles('client/defaultTabBars.js', 'client');
// VERSION
api.addFiles('rocketchat.info');

@ -1,3 +1,3 @@
{
"version": "0.11.0"
"version": "0.12.0"
}

@ -1,11 +1,7 @@
tabReset = ->
RocketChat.TabBar.reset()
FlowRouter.route '/mailer',
name: 'mailer'
triggersEnter: [tabReset]
triggersExit: [tabReset]
action: ->
RocketChat.TabBar.showGroup 'mailer'
BlazeLayout.render 'main', {center: 'mailer'}
FlowRouter.route '/mailer/unsubscribe/:_id/:createdAt',

@ -1,4 +1,9 @@
Meteor.startup ->
RocketChat.callbacks.add 'enter-room', ->
RocketChat.TabBar.addButton({ id: 'mentions', i18nTitle: 'Mentions', icon: 'icon-at', template: 'mentionsFlexTab', order: 3 })
, RocketChat.callbacks.priority.MEDIUM, 'enter-room-tabbar-mentions'
RocketChat.TabBar.addButton({
groups: ['channel', 'privategroup'],
id: 'mentions',
i18nTitle: 'Mentions',
icon: 'icon-at',
template: 'mentionsFlexTab',
order: 3
})

@ -1,5 +1,10 @@
Meteor.startup ->
RocketChat.callbacks.add 'enter-room', ->
if RocketChat.settings.get 'Message_AllowPinning'
RocketChat.TabBar.addButton({ id: 'pinned-messages', i18nTitle: 'Pinned_Messages', icon: 'icon-pin', template: 'pinnedMessages', order: 10 })
, RocketChat.callbacks.priority.MEDIUM, 'enter-room-tabbar-pin'
if RocketChat.settings.get 'Message_AllowPinning'
RocketChat.TabBar.addButton({
groups: ['channel', 'privategroup', 'directmessage'],
id: 'pinned-messages',
i18nTitle: 'Pinned_Messages',
icon: 'icon-pin',
template: 'pinnedMessages',
order: 10
})

@ -1,4 +1,9 @@
Meteor.startup ->
RocketChat.callbacks.add 'enter-room', ->
RocketChat.TabBar.addButton({ id: 'starred-messages', i18nTitle: 'Starred_Messages', icon: 'icon-star', template: 'starredMessages', order: 3 })
, RocketChat.callbacks.priority.MEDIUM, 'enter-room-tabbar-star'
RocketChat.TabBar.addButton({
groups: ['channel', 'privategroup', 'directmessage'],
id: 'starred-messages',
i18nTitle: 'Starred_Messages',
icon: 'icon-star',
template: 'starredMessages',
order: 3
})

@ -37,7 +37,23 @@ Template.adminUsers.onCreated ->
@filter = new ReactiveVar ''
@ready = new ReactiveVar true
RocketChat.TabBar.addButton({ id: 'invite-user', i18nTitle: t('Invite_Users'), icon: 'icon-plus', template: 'adminInviteUser', order: 1 })
RocketChat.TabBar.addButton({
groups: ['adminusers', 'adminusers-selected'],
id: 'invite-user',
i18nTitle: 'Invite_Users',
icon: 'icon-plus',
template: 'adminInviteUser',
order: 1
})
RocketChat.TabBar.addButton({
groups: ['adminusers-selected']
id: 'admin-user-info',
i18nTitle: 'User_Info',
icon: 'icon-user',
template: 'adminUserInfo',
order: 2
})
@autorun ->
filter = instance.filter.get()
@ -49,11 +65,10 @@ Template.adminUsers.onCreated ->
if Session.get 'adminSelectedUser'
channelSubscription = instance.subscribe 'userChannels', Session.get 'adminSelectedUser'
RocketChat.TabBar.setData Meteor.users.findOne Session.get 'adminSelectedUser'
RocketChat.TabBar.addButton({ id: 'user-info', i18nTitle: t('User_Info'), icon: 'icon-user', template: 'adminUserInfo', order: 2 })
# RocketChat.TabBar.addButton({ id: 'user-channel', i18nTitle: t('User_Channels'), icon: 'icon-hash', template: 'adminUserChannels', order: 3 })
RocketChat.TabBar.showGroup 'adminusers-selected'
else
RocketChat.TabBar.reset()
RocketChat.TabBar.addButton({ id: 'invite-user', i18nTitle: t('Invite_Users'), icon: 'icon-plus', template: 'adminInviteUser', order: 1 })
RocketChat.TabBar.showGroup 'adminusers'
@users = ->
filter = _.trim instance.filter?.get()
@ -89,8 +104,8 @@ Template.adminUsers.events
'click .user-info': (e) ->
e.preventDefault()
Session.set 'adminSelectedUser', $(e.currentTarget).data('id')
Session.set 'showUserInfo', Meteor.users.findOne($(e.currentTarget).data('id'))?.username or true
Session.set 'adminSelectedUser', @_id
Session.set 'showUserInfo', Meteor.users.findOne(@_id)?.username or true
RocketChat.TabBar.setTemplate 'adminUserInfo'
RocketChat.TabBar.openFlex()

@ -32,7 +32,7 @@
</thead>
<tbody>
{{#each users}}
<tr class="user-info" data-id="{{_id}}">
<tr class="user-info">
<td>
<div class="user-image status-{{status}}">
{{> avatar username=username}}

@ -2,26 +2,41 @@ Template.flexTabBar.helpers
active: ->
return 'active' if @template is RocketChat.TabBar.getTemplate() and RocketChat.TabBar.isFlexOpen()
buttons: ->
RocketChat.TabBar.getButtons()
return RocketChat.TabBar.getButtons()
title: ->
return t(@i18nTitle) or @title
visible: ->
if @groups.indexOf(RocketChat.TabBar.getVisibleGroup()) is -1
return 'hidden'
Template.flexTabBar.events
'click .tab-button': (e, t) ->
e.preventDefault()
if RocketChat.TabBar.isFlexOpen() and RocketChat.TabBar.getTemplate() is $(e.currentTarget).data('template')
if RocketChat.TabBar.isFlexOpen() and RocketChat.TabBar.getTemplate() is @template
RocketChat.TabBar.closeFlex()
$('.flex-tab').css('max-width', '')
else
width = $(e.currentTarget).data('width')
if width?
$('.flex-tab').css('max-width', "#{width}px")
if @width?
$('.flex-tab').css('max-width', "#{@width}px")
else
$('.flex-tab').css('max-width', '')
RocketChat.TabBar.setTemplate $(e.currentTarget).data('template'), ->
RocketChat.TabBar.setTemplate @template, ->
$('.flex-tab')?.find("input[type='text']:first")?.focus()
$('.flex-tab .content')?.scrollTop(0)
Template.flexTabBar.onCreated ->
# close flex if the visible group changed and the opened template is not in the new visible group
@autorun =>
visibleGroup = RocketChat.TabBar.getVisibleGroup()
Tracker.nonreactive =>
openedTemplate = RocketChat.TabBar.getTemplate()
exists = false
RocketChat.TabBar.getButtons().forEach (button) ->
if button.groups.indexOf(visibleGroup) isnt -1 and openedTemplate is button.template
exists = true
unless exists
RocketChat.TabBar.closeFlex()

@ -1,6 +1,6 @@
<template name="flexTabBar">
{{#each buttons}}
<div class="tab-button {{active}}" data-template="{{template}}" data-width="{{width}}" title="{{title}}">
<div class="tab-button {{active}} {{visible}}" title="{{title}}">
<i class="{{icon}}" aria-label="{{title}}" role="button" tabindex="0"></i>
</div>
{{/each}}

@ -63,6 +63,7 @@
name: newRoute.name
action: ->
Session.set 'openedRoom'
RocketChat.TabBar.showGroup newRoute.name
BlazeLayout.render 'main', routeConfig
triggersEnter: [ ->
if newRoute.sideNav?
@ -70,7 +71,6 @@
SideNav.openFlex()
]
setStatus: setStatus
toggle: toggle
open: open

@ -37,9 +37,6 @@ Template.privateHistory.helpers
when 'd'
return FlowRouter.path 'direct', { username: this.name }
Template.privateHistory.onRendered ->
RocketChat.TabBar.reset()
Template.privateHistory.events
'keydown #history-filter': (event) ->
if event.which is 13

@ -484,13 +484,9 @@ Template.room.onCreated ->
@autorun =>
@subscribe 'fullUserData', Session.get('showUserInfo'), 1
Template.room.onDestroyed ->
RocketChat.TabBar.resetButtons()
window.removeEventListener 'resize', this.onWindowResize
Template.room.onRendered ->
unless window.chatMessages
window.chatMessages = {}

@ -36,5 +36,6 @@ Meteor.startup ->
cl: 1
u: 1
usernames: 1
topic: 1
user = RocketChat.models.Users.findOneById this.userId, fields: username: 1
return RocketChat.models.Rooms.findByTypeContainigUsernames 'd', [user.username, identifier], options

Loading…
Cancel
Save