Commit 315cf6c6 authored by Jehan Tremback's avatar Jehan Tremback

completed truncation

parent dea0ee9f
......@@ -377,11 +377,17 @@ class Hypothesis extends Annotator
.classed('hyp-excerpt', true)
.append('blockquote')
excerpts.exit().remove()
excerpts
.select('blockquote').html (d) =>
d.message.annotation.quote
.replace(/\u00a0/g, ' ') # replace  
.substring(0, 180).split(" ").slice(0, -1).join(" ") + "...<a id='clickForMore'>more</a>" # truncate
chars = 180
x = d.message.annotation.quote.replace(/\u00a0/g, ' ') # replace &nbsp;
if x.length >= chars
x.substring(0, chars).split(" ").slice(0, -1)
.join(" ") + "...<a id='clickForMore'>more</a>" # truncate
else
x
$('#clickForMore').click =>
excerpts
......
......@@ -295,6 +295,7 @@ label {
float: right;
display: block;
text-decoration: underline;
cursor: pointer;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment