--- a/src/metadatacomposer/__init__.py Tue Jun 25 10:46:42 2013 +0200
+++ b/src/metadatacomposer/__init__.py Tue Jun 25 12:02:18 2013 +0200
@@ -1,4 +1,4 @@
-VERSION = (0, 1, 10, "final", 0)
+VERSION = (0, 1, 11, "final", 0)
def get_version():
--- a/src/metadatacomposer/static/metadatacomposer/js/edition.js Tue Jun 25 10:46:42 2013 +0200
+++ b/src/metadatacomposer/static/metadatacomposer/js/edition.js Tue Jun 25 12:02:18 2013 +0200
@@ -239,6 +239,7 @@
});
+
/* Chapter */
//edit
@@ -857,10 +858,12 @@
var tplDiapo = getTemplate('#tpl-slideshow-row');
dataView.limitLength = function(){
return function(text, render) {
- if(render(text).length > lengthStringDiapo){
- return render(text).substr(0,lengthStringDiapo) + '...';
+
+ var renderText = nl2br(render(text));
+ if(renderText.length > lengthStringDiapo){
+ return renderText.substr(0,lengthStringDiapo) + '...';
}else{
- return render(text);
+ return renderText;
}
}
}
@@ -879,10 +882,12 @@
html = currentAnnotation.content.images[index][name];
input.val(html);
$(this).find('span').replaceWith(input);
- input.focus().keypress(function(e){
- code = (e.keyCode ? e.keyCode : e.which);
- if (code == 13) $(this).blur();
- });
+ if(name == 'title'){
+ input.focus().keypress(function(e){
+ code = (e.keyCode ? e.keyCode : e.which);
+ if (code == 13) $(this).blur();
+ });
+ }
});
$(document).on('blur', '.title-slideshow-row input, .description-slideshow-row textarea', function(){
@@ -893,6 +898,7 @@
if(newValue.length>lengthStringDiapo){
newValue = newValue.substr(0,lengthStringDiapo) + '...';
}
+ newValue = nl2br(newValue, true)
var span = $('<span>').html(newValue);
$(this).replaceWith(span);
@@ -1347,6 +1353,11 @@
/* Utilitys */
+function nl2br (str) {
+ var breakTag = '<br />';
+ return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1'+ breakTag +'$2');
+}
+
Array.prototype.move = function (old_index, new_index) {
if (new_index >= this.length) {
var k = new_index - this.length;