make all new customizations configurable

pull/1095/head^2^2
Diego Sampaio 11 years ago
parent 6244f36912
commit 350754b818
  1. 11
      client/stylesheets/base.less
  2. 4
      client/stylesheets/utils/_chatops.less
  3. 1
      client/views/account/accountPreferences.coffee
  4. 17
      client/views/account/accountPreferences.html
  5. 4
      client/views/app/message.coffee
  6. 7
      client/views/app/room.coffee
  7. 9
      client/views/app/room.html
  8. 5
      i18n/en.i18n.json
  9. 5
      i18n/pt.i18n.json
  10. 3
      packages/rocketchat-chatops/i18n/en.i18n.json
  11. 5
      packages/rocketchat-chatops/server/settings.coffee
  12. 3
      packages/rocketchat-lib/settings/server/startup.coffee
  13. 3
      server/methods/saveUserPreferences.coffee

@ -2351,7 +2351,7 @@ a.github-fork {
.message {
font-size: 14px;
padding: 5px 20px 5px 70px;
padding: 18px 20px 4px 70px;
position: relative;
line-height: 20px;
min-height: 40px;
@ -2579,6 +2579,15 @@ a.github-fork {
}
}
.compact {
.message {
padding: 5px 20px 5px 70px;
.thumb .avatar {
margin-top: -15px;
}
}
}
.flex-tab-bar {
position: absolute;
width: 40px;

@ -2,10 +2,6 @@ li.chatops-message {
background-color: #f8f8f8;
}
.message .thumb .avatar {
margin-top: -15px !important;
}
.chatops-message div.body {
font-size: 12px;
font-weight: bold;

@ -39,6 +39,7 @@ Template.accountPreferences.onCreated ->
data.useEmojis = $('input[name=useEmojis]:checked').val()
data.convertAsciiEmoji = $('input[name=convertAsciiEmoji]:checked').val()
data.saveMobileBandwidth = $('input[name=saveMobileBandwidth]:checked').val()
data.compactView = $('input[name=compactView]:checked').val()
data.autoImageLoad = $('input[name=autoImageLoad]:checked').val()
Meteor.call 'saveUserPreferences', data, (error, results) ->

@ -17,11 +17,13 @@
<div>
{{#if desktopNotificationEnabled}}
<label>{{_ "Desktop_Notifications_Enabled"}}</label>
{{else}} {{#if desktopNotificationDisabled}}
<label>{{_ "Desktop_Notifications_Disabled"}}</label>
{{else}}
<label><button class="button enable-notifications"><i class="octicon octicon-comment"></i> <span>{{_ "Enable_Desktop_Notifications"}}</span></button></label>
{{/if}} {{/if}}
{{#if desktopNotificationDisabled}}
<label>{{_ "Desktop_Notifications_Disabled"}}</label>
{{else}}
<label><button class="button enable-notifications"><i class="octicon octicon-comment"></i> <span>{{_ "Enable_Desktop_Notifications"}}</span></button></label>
{{/if}}
{{/if}}
</div>
</div>
<div class="input-line double-col">
@ -52,6 +54,13 @@
<label><input type="radio" name="saveMobileBandwidth" value="0" checked="{{checked 'saveMobileBandwidth' false}}" /> {{_ "False"}}</label>
</div>
</div>
<div class="input-line double-col" id="compactView">
<label>{{_ "Compact_View"}}</label>
<div>
<label><input type="radio" name="compactView" value="1" checked="{{checked 'compactView' true}}" /> {{_ "True"}}</label>
<label><input type="radio" name="compactView" value="0" checked="{{checked 'compactView' false true}}" /> {{_ "False"}}</label>
</div>
</div>
</div>
</div>
<div class="section">

@ -105,8 +105,8 @@ Template.message.onViewRendered = (context) ->
ul = lastNode.parentElement
wrapper = ul.parentElement
if this.u?.username is not "hubot"
if context.urls?.length > 0 and Template.oembedBaseWidget? and RocketChat.settings.get 'API_Embed'
if context.urls?.length > 0 and Template.oembedBaseWidget? and RocketChat.settings.get 'API_Embed'
if context.u?.username not in RocketChat.settings.get('API_EmbedDisabledFor')?.split(',')
for item in context.urls
do (item) ->
urlNode = lastNode.querySelector('.body a[href="'+item.url+'"]')

@ -8,7 +8,7 @@ favoritesEnabled = ->
# @TODO bug com o botão para "rolar até o fim" (novas mensagens) quando uma mensagem com texto que gere rolagem horizontal
Template.room.helpers
showFormattingTips: ->
return RocketChat.Markdown or RocketChat.Highlight
return RocketChat.settings.get('Message_ShowFormattingTips') and (RocketChat.Markdown or RocketChat.Highlight)
showMarkdown: ->
return RocketChat.Markdown
showHighlight: ->
@ -188,7 +188,7 @@ Template.room.helpers
return !! ChatRoom.findOne { _id: @_id, t: 'c' }
canRecordAudio: ->
return navigator.getUserMedia? or navigator.webkitGetUserMedia?
return RocketChat.settings.get('Message_AudioRecorderEnabled') and (navigator.getUserMedia? or navigator.webkitGetUserMedia?)
roomManager: ->
room = ChatRoom.findOne(this._id, { reactive: false })
@ -217,6 +217,9 @@ Template.room.helpers
showToggleFavorite: ->
return true if isSubscribed(this._id) and favoritesEnabled()
compactView: ->
return 'compact' if Meteor.user()?.settings?.preferences?.compactView
Template.room.events
"touchstart .message": (e, t) ->
message = this._arguments[1]

@ -48,7 +48,7 @@
</div>
{{/if}}
{{/if}}
<div class="messages-box">
<div class="messages-box {{compactView}}">
<div class="ticks-bar"></div>
<div class="wrapper">
<ul aria-live="polite">
@ -86,9 +86,8 @@
<div class="input-message-container">
{{> messagePopupConfig getPupupConfig}}
<textarea dir="auto" name="msg" maxlength="{{maxMessageLength}}" class="input-message autogrow-short" placeholder="{{_ 'Message'}}"></textarea>
<!--<i class="icon-paper-plane" title="{{_ "Send_Message"}}" aria-label="{{_ "Send_Message"}}"></i>-->
</div>
<!--
{{#if canRecordAudio}}
<div class="mic">
<i class="icon-mic" aria-label="{{_ "Record"}}"></i>
@ -97,7 +96,6 @@
<i class="icon-stop" aria-label="{{_ "Stop_Recording"}}"></i>
</div>
{{/if}}
-->
</div>
<div class="users-typing">
{{#with usersTyping}}
@ -117,7 +115,7 @@
{{/if}}
{{/with}}
</div>
<!--
{{#if showFormattingTips}}
<div class="formatting-tips" aria-hidden="true" dir="auto">
{{#if showMarkdown}}
@ -135,7 +133,6 @@
</div>
{{/if}}
-->
<div class="editing-commands" aria-hidden="true" dir="auto">
<div class="editing-commands-cancel">{{_ 'Esc_to'}} <a href="">{{_ 'Cancel'}}</a></div>
<div class="editing-commands-save">{{_ 'Enter_to'}} <a href="">{{_ 'Save_changes'}}</a></div>

@ -45,6 +45,8 @@
"API" : "API",
"API_Analytics" : "Analytics",
"API_Embed" : "Embed",
"API_EmbedDisabledFor": "Disable Embed for Users",
"API_EmbedDisabledFor_Description": "Comma-separated usernames list",
"are_also_typing" : "are also typing",
"are_typing" : "are typing",
"Are_you_sure" : "Are you sure?",
@ -72,6 +74,7 @@
"close" : "close",
"coming_soon" : "coming soon",
"Commands" : "Commands",
"Compact_View": "Compact View",
"Confirm_password" : "Confirm your password",
"Contact" : "Contact",
"Conversation" : "Conversation",
@ -179,6 +182,7 @@
"Message_AllowDeleting" : "Allow Message Deleting",
"Message_AllowEditing" : "Allow Message Editing",
"Message_AllowEditing_BlockEditInMinutes" : "Block message editing after (in minutes - 0 to disable)",
"Message_AudioRecorderEnabled": "Audio Recorder Enabled",
"Message_deleting_not_allowed" : "Message deleting not allowed",
"Message_editing_not_allowed" : "Message editing not allowed",
"Message_editing_blocked" : "This message cannot be edited anymore",
@ -189,6 +193,7 @@
"Message_pinned" : "Message pinned",
"Message_ShowDeletedStatus" : "Show Deleted Status",
"Message_ShowEditedStatus" : "Show Edited Status",
"Message_ShowFormattingTips": "Show Formatting Tips",
"Messages": "Messages",
"Meta" : "Meta",
"Meta_fb_app_id" : "Facebook APP ID",

@ -44,6 +44,8 @@
"API" : "API",
"API_Analytics" : "Analytics",
"API_Embed" : "Embed",
"API_EmbedDisabledFor": "Desabilitar embed para os usuários",
"API_EmbedDisabledFor_Description": "Lista de nomes de usuário separados por vírgula",
"are_also_typing" : "também estão digitando",
"are_typing" : "estão digitando",
"Are_you_sure" : "Você tem certeza?",
@ -70,6 +72,7 @@
"Chat_Rooms" : "Salas de Chat",
"close" : "fechar",
"coming_soon" : "em breve",
"Compact_View": "Visão Compacta",
"Confirm_password" : "Confirmar a senha",
"Contact" : "Contato",
"Conversation" : "Conversa",
@ -172,6 +175,7 @@
"Message_AllowDeleting" : "Permitir Exclusão de Mensagem",
"Message_AllowEditing" : "Permitir Edição de Mensagem",
"Message_AllowEditing_BlockEditInMinutes" : "Bloquear edição de mensagens após (em minutos - 0 para desabilitar)",
"Message_AudioRecorderEnabled": "Gravação de Áudio Habilitada",
"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",
@ -182,6 +186,7 @@
"Message_pinned" : "Mensagem fixada",
"Message_ShowDeletedStatus" : "Mostrar Status Excluído",
"Message_ShowEditedStatus" : "Mostrar Status Editado",
"Message_ShowFormattingTips": "Exibir dicas de formatação",
"Messages": "Mensagens",
"Meta" : "Meta",
"Meta_fb_app_id" : "Facebook APP ID",

@ -1,4 +1,5 @@
{
"Chatops_Enabled" : "Enable Chatops",
"Chatops_Title": "Chatops panel"
"Chatops_Title": "Chatops panel",
"Chatops_Username": "Chatops username"
}

@ -1,3 +1,4 @@
Meteor.startup ->
RocketChat.settings.add 'Chatops_Enabled', false, { type: 'boolean', group: 'General', public: true, i18nLabel: "ChatOps Enabled" }
RocketChat.settings.add 'Chatops_Username', false, { type: 'string', group: 'General', public: true, i18nLabel: "ChatOps User Name" }
RocketChat.settings.addGroup 'Chatops'
RocketChat.settings.add 'Chatops_Enabled', false, { type: 'boolean', group: 'Chatops', public: true }
RocketChat.settings.add 'Chatops_Username', false, { type: 'string', group: 'Chatops', public: true }

@ -42,6 +42,7 @@ RocketChat.settings.add 'Disable_Favorite_Rooms', false, { type: 'boolean', grou
RocketChat.settings.addGroup 'API'
RocketChat.settings.add 'API_Analytics', '', { type: 'string', group: 'API', public: true }
RocketChat.settings.add 'API_Embed', true, { type: 'boolean', group: 'API', public: true }
RocketChat.settings.add 'API_EmbedDisabledFor', '', { type: 'string', group: 'API', public: true, i18nDescription: 'API_EmbedDisabledFor_Description' }
RocketChat.settings.addGroup 'SMTP'
RocketChat.settings.add 'SMTP_Host', '', { type: 'string', group: 'SMTP' }
@ -62,6 +63,8 @@ RocketChat.settings.add 'Message_ShowEditedStatus', true, { type: 'boolean', gro
RocketChat.settings.add 'Message_ShowDeletedStatus', false, { type: 'boolean', group: 'Message', public: true }
RocketChat.settings.add 'Message_KeepHistory', false, { type: 'boolean', group: 'Message', public: true }
RocketChat.settings.add 'Message_MaxAllowedSize', 5000, { type: 'int', group: 'Message', public: true }
RocketChat.settings.add 'Message_ShowFormattingTips', true, { type: 'boolean', group: 'Message', public: true }
RocketChat.settings.add 'Message_AudioRecorderEnabled', true, { type: 'boolean', group: 'Message', public: true }
RocketChat.settings.addGroup 'Meta'
RocketChat.settings.add 'Meta_language', '', { type: 'string', group: 'Meta' }

@ -20,6 +20,9 @@ Meteor.methods
if settings.saveMobileBandwidth?
preferences.saveMobileBandwidth = if settings.saveMobileBandwidth is "1" then true else false
if settings.compactView?
preferences.compactView = if settings.compactView is "1" then true else false
if settings.autoImageLoad?
preferences.autoImageLoad = if settings.autoImageLoad is "1" then true else false

Loading…
Cancel
Save