respect newlines for wall messages
This commit is contained in:
parent
76ffd11684
commit
bd6dfe7d44
2 changed files with 4 additions and 1 deletions
|
@ -41,6 +41,9 @@ window.linkify = (str) ->
|
||||||
exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig
|
exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig
|
||||||
return str.replace(exp,"<a href='$1'>$1</a>")
|
return str.replace(exp,"<a href='$1'>$1</a>")
|
||||||
|
|
||||||
|
window.simpleFormat = (str) ->
|
||||||
|
linkify(sanitize(str).replace(/\n/g, '<br />'))
|
||||||
|
|
||||||
window.startSpinner = ->
|
window.startSpinner = ->
|
||||||
$('.turbolink-spinner').fadeIn()
|
$('.turbolink-spinner').fadeIn()
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ class Wall
|
||||||
template = @noteTemplate()
|
template = @noteTemplate()
|
||||||
template = template.replace('{{author_name}}', note.author.name)
|
template = template.replace('{{author_name}}', note.author.name)
|
||||||
template = template.replace(/{{created_at}}/g, note.created_at)
|
template = template.replace(/{{created_at}}/g, note.created_at)
|
||||||
template = template.replace('{{text}}', linkify(sanitize(note.body)))
|
template = template.replace('{{text}}', simpleFormat(note.body))
|
||||||
|
|
||||||
if note.attachment
|
if note.attachment
|
||||||
file = '<i class="icon-paper-clip"/><a href="/files/note/' + note.id + '/' + note.attachment + '">' + note.attachment + '</a>'
|
file = '<i class="icon-paper-clip"/><a href="/files/note/' + note.id + '/' + note.attachment + '">' + note.attachment + '</a>'
|
||||||
|
|
Loading…
Reference in a new issue