Improved "see more" feature.
This commit is contained in:
parent
5a8ff3939c
commit
712a013c44
1 changed files with 19 additions and 16 deletions
|
@ -108,25 +108,28 @@ class ArticleViewItem extends App.Controller
|
||||||
return
|
return
|
||||||
|
|
||||||
# prepare html body
|
# prepare html body
|
||||||
signatureDetected = false
|
|
||||||
if @article.content_type is 'text/html'
|
if @article.content_type is 'text/html'
|
||||||
@article['html'] = @article.body
|
@article['html'] = @article.body
|
||||||
|
@article['html'] = App.Utils.signatureIdentify( @article['html'] )
|
||||||
else
|
else
|
||||||
|
|
||||||
# check if signature got detected in backend
|
# client signature detection
|
||||||
|
bodyHtml = App.Utils.text2html(@article.body)
|
||||||
|
@article['html'] = App.Utils.signatureIdentify(bodyHtml)
|
||||||
|
|
||||||
|
# if no signature detected or within frist 25 lines, check if signature got detected in backend
|
||||||
|
if @article['html'] is bodyHtml || (@article.preferences && @article.preferences.signature_detection < 25)
|
||||||
|
signatureDetected = false
|
||||||
body = @article.body
|
body = @article.body
|
||||||
if @article.preferences && @article.preferences.signature_detection
|
if @article.preferences && @article.preferences.signature_detection
|
||||||
signatureDetected = '########SIGNATURE########'
|
signatureDetected = '########SIGNATURE########'
|
||||||
body = body.split("\n")
|
body = body.split("\n")
|
||||||
body.splice(@article.preferences.signature_detection, 0, signatureDetected)
|
body.splice(@article.preferences.signature_detection, 0, signatureDetected)
|
||||||
body = body.join("\n")
|
body = body.join("\n")
|
||||||
|
if signatureDetected
|
||||||
body = App.Utils.textCleanup(body)
|
body = App.Utils.textCleanup(body)
|
||||||
@article['html'] = App.Utils.text2html(body)
|
@article['html'] = App.Utils.text2html(body)
|
||||||
|
|
||||||
if signatureDetected
|
|
||||||
@article['html'] = @article['html'].replace(signatureDetected, '<span class="js-signatureMarker"></span>')
|
@article['html'] = @article['html'].replace(signatureDetected, '<span class="js-signatureMarker"></span>')
|
||||||
else
|
|
||||||
@article['html'] = App.Utils.signatureIdentify( @article['html'] )
|
|
||||||
|
|
||||||
@html App.view('ticket_zoom/article_view')(
|
@html App.view('ticket_zoom/article_view')(
|
||||||
ticket: @ticket
|
ticket: @ticket
|
||||||
|
|
Loading…
Reference in a new issue