Skip to content
Snippets Groups Projects
Commit 56ea88cd authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files
parents ef6ddffb ee8f84ad
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ class @ChatMessages
init: (node) ->
this.editing = {}
this.messageMaxSize = RocketChat.settings.get('Message_MaxAllowedSize')
this.wrapper = $(node).find(".wrapper")
this.input = $(node).find(".input-message").get(0)
this.bindEvents()
......@@ -65,7 +66,8 @@ class @ChatMessages
this.editing.saved = this.input.value
send: (rid, input) ->
if _.trim(input.value) isnt ''
if _.trim(input.value) isnt '' and not this.isMessageTooLong(input)
console.error 'sending', input.value
KonchatNotification.removeRoomNotification(rid)
msg = input.value
input.value = ''
......@@ -185,3 +187,6 @@ class @ChatMessages
# ctrl (command) + shift + k -> clear room messages
else if k is 75 and ((navigator?.platform?.indexOf('Mac') isnt -1 and event.metaKey and event.shiftKey) or (navigator?.platform?.indexOf('Mac') is -1 and event.ctrlKey and event.shiftKey))
RoomHistoryManager.clear rid
isMessageTooLong: (input) ->
input?.value.length > this.messageMaxSize
\ No newline at end of file
......@@ -296,7 +296,6 @@ body {
color: @primary-font-color;
height: 100%;
width: 100%;
// min-width: 768px;
-webkit-font-smoothing: antialiased;
line-height: 1rem;
padding: 0;
......@@ -1646,37 +1645,29 @@ a.github-fork {
// MAIN CONTENT + MAIN PAGES //
.main-content {
position: relative;
margin-left: @rooms-box-width;
margin-top: 0;
height: 100%;
.calc(width,
~'100% - ' @rooms-box-width);
.transition(width .25s cubic-bezier(.5,
0,
.1,
1));
position: fixed;
top: 0;
bottom: 0;
left: @rooms-box-width;
right: 0;
width: auto;
height: auto;
.transition(width .25s cubic-bezier(.5, 0, .1, 1));
&.flex-opened {
.calc(width,
~'100% - ' @rooms-box-width + @flex-tab-width);
margin-right: 420px;
right: @flex-tab-width;
.flex-tab {
.transform(translateX(0));
}
}
&.layout1 {
.calc(width,
~'100% - ' @rooms-box-width + @flex-tab-webrtc-width);
margin-right: 420px;
right: @flex-tab-webrtc-width;
.flex-tab {
max-width: @flex-tab-webrtc-width;
.transform(translateX(0));
}
}
&.layout2 {
.calc(width,
~'100% - ' @rooms-box-width + @flex-tab-webrtc-2-width);
margin-right: 420px;
right: @flex-tab-webrtc-2-width;
.flex-tab {
max-width: @flex-tab-webrtc-2-width;
.transform(translateX(0));
......@@ -1980,12 +1971,6 @@ a.github-fork {
}
}
.room-container {
position: absolute;
width: 100%;
height: 100%;
}
.messages-box {
position: relative;
margin: 60px 20px 0px 0px;
......@@ -3241,8 +3226,7 @@ a.github-fork {
@media all and(max-width: 1100px) {
#rocket-chat {
.flex-opened {
.calc(width,
~'100% - ' @rooms-box-width);
right: 0;
}
}
}
......@@ -3259,8 +3243,7 @@ a.github-fork {
.transition(transform .3s ease-out);
}
.main-content {
margin-left: 0;
width: 100%;
left: 0;
.transition(transform .3s ease-out);
}
.fixed-title h2 {
......
......@@ -266,6 +266,8 @@ Template.room.helpers
noRtcLayout: ->
return (!Session.get('rtcLayoutmode') || (Session.get('rtcLayoutmode') == 0) ? true: false);
maxMessageLength: ->
return RocketChat.settings.get('Message_MaxAllowedSize')
Template.room.events
......
......@@ -47,7 +47,7 @@
<form class="message-form" method="post" action="/">
<div>
{{> messagePopupConfig getPupupConfig}}
<textarea dir="auto" name="msg" class="input-message"></textarea>
<textarea dir="auto" name="msg" maxlength="{{maxMessageLength}}" class="input-message"></textarea>
<i class="icon-paper-plane" title="{{_ "Send_Message"}}"></i>
</div>
<div class="users-typing">
......
......@@ -22,6 +22,7 @@ Meteor.startup ->
RocketChat.settings.add 'Message_ShowEditedStatus', '', { type: 'string', group: 'Message' }
RocketChat.settings.add 'Message_ShowDeletedStatus', '', { type: 'string', group: 'Message' }
RocketChat.settings.add 'Message_KeepStatusHistory', '', { type: 'string', group: 'Message' }
RocketChat.settings.add 'Message_MaxAllowedSize', 500, { type: 'int', group: 'Message', public: true }
RocketChat.settings.addGroup 'Meta'
RocketChat.settings.add 'Meta:language', '', { type: 'string', group: 'Meta' }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment