diff -r 3a2f9993c6cb -r 57f1d252b8f9 integration/js/editor.js --- a/integration/js/editor.js Tue Jan 29 17:26:56 2013 +0100 +++ b/integration/js/editor.js Mon May 06 16:06:47 2013 +0200 @@ -1,5 +1,12 @@ IriSP.editor = function(options) { + window.shortenText = function(text, minlength, maxlength) { + var min = (typeof minlength === "undefined" ? 100 : minlength), + max = (typeof maxlength === "undefined" ? min + 20 : maxlength), + rx = new RegExp("(^.{" + min + "," + max + "})[\s].+$"); + return text.replace(/[\n\r\s]+/mg,' ').replace(rx,'$1…'); + } + /* Load Media List */ var directory = new IriSP.Model.Directory(), @@ -13,7 +20,7 @@ mediatemplate = _.template( '
<%= description %>
' + + '<%= shortenText(description) %>
' + '<%= gettext("Duration:") %> <%= duration.toString() %>
<%= annotation.description %>
<% if (annotation.keywords.length) { print("" + gettext("Tags:") + " " + annotation.keywords.join(", ") + "
"); } %>' + + '<%= shortenText(annotation.description) %>
<% if (annotation.keywords.length) { print("" + gettext("Tags:") + " " + annotation.keywords.join(", ") + "
"); } %>' + '<%= gettext("Clone segment") %>' + '<%= gettext("From:") %> <%= annotation.begin.toString() %> <%= gettext("to:") %> <%= annotation.end.toString() %> (<%= gettext("duration:") %> <%= annotation.getDuration().toString() %>)
' + '<%= description %>
<% if (tags) { print("" + gettext("Tags:") + " " + tags + "
"); } %>' + '<%= gettext("Clone segment") %>' - + '