Skip to content

Commit

Permalink
Merge branch 'master' of github.com:RocketChat/Rocket.Chat
Browse files Browse the repository at this point in the history
# By Rodrigo Nascimento
# Via Rodrigo Nascimento
* 'master' of github.com:RocketChat/Rocket.Chat:
  Add MarkDown support
  Fix error when Accounts.validateLoginAttempt init with allowed false close #3 #4
  • Loading branch information
engelgabriel committed May 25, 2015
2 parents e09a3a1 + 6602571 commit f2aa215
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/stylesheets/utils/_reset.import.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ time, mark, audio, video {
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
// font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
Expand Down
9 changes: 9 additions & 0 deletions client/views/app/chatMessageDashboard.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ Template.chatMessageDashboard.helpers
# if $('#chat-window-' + this.rid + '.opened').length == 0
# return 'new'

preMD: Template 'preMD', ->
self = this
text = ""
if self.templateContentBlock
text = Blaze._toText(self.templateContentBlock, HTML.TEXTMODE.STRING)

text = text.replace(/#/g, '\\#')
return text

Template.chatMessageDashboard.events
'mousedown .edit-message': ->
self = this
Expand Down
2 changes: 1 addition & 1 deletion client/views/app/chatMessageDashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<textarea class="input-message-editing" contenteditable="true">{{{message}}}</textarea>
{{else}}
<p>
{{#emojione}}{{{message}}}{{/emojione}}
{{#emojione}}{{#markdown}}{{#preMD}}{{message}}{{/preMD}}{{/markdown}}{{/emojione}}
</p>
{{/if}}
{{/if}}
Expand Down
5 changes: 4 additions & 1 deletion server/lib/accounts.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ Accounts.onCreateUser (options, user) ->


Accounts.validateLoginAttempt (login) ->
if login.allowed is true and login.type is 'password'
if login.allowed isnt true
return login.allowed

if login.type is 'password'
validEmail = login.user.emails.filter (email) ->
return email.verified is true

Expand Down

0 comments on commit f2aa215

Please sign in to comment.