--- a/integration/js/edition.js Fri Jun 07 11:32:20 2013 +0200
+++ b/integration/js/edition.js Fri Jun 07 12:41:45 2013 +0200
@@ -29,7 +29,11 @@
var idAnnotation = $(this).attr('data-id'),
annotation = _.find(annotations, function(c){ return c.id == idAnnotation; });
myMedia.setCurrentTime(annotation.begin);
- openTab(annotation.type, annotation);
+ if($('#tab-annotation-'+idAnnotation).length){
+ $('a[href=#tab-annotation-'+idAnnotation+']').tab('show');
+ }else{
+ openTab(annotation.type, annotation);
+ }
});
myProject.onLoad(function() {
@@ -86,10 +90,10 @@
url_transform: function(src) {
return [{
type: "video/mp4",
- src: src.replace(/\.[\d\w]+$/,'.mp4')
+ src: src.replace(/\.[\d\w]+$/,'.mp4').replace('rtmp://media.iri.centrepompidou.fr/ddc_player', 'http://media.iri.centrepompidou.fr')
}, {
type: "video/webm",
- src: src.replace(/\.[\d\w]+$/,'.webm')
+ src: src.replace(/\.[\d\w]+$/,'.webm').replace('rtmp://media.iri.centrepompidou.fr/ddc_player', 'http://media.iri.centrepompidou.fr')
}];
}
}
@@ -125,19 +129,8 @@
if(v.begin <= t && v.end >= t){
currentAnnotationsDisplay.push(v.id);
if(!$('#item-current-annotation-'+v.id).length){
- var itemAnnotation =
- $('<li>')
- .attr('id', 'item-current-annotation-'+v.id)
- .attr('data-id', v.id)
- .append(
- $('<a>')
- .css('backgroundColor', v.color)
- .attr('data-id', v.id)
- .attr('href', '#')
- .append(
- $('<i>').addClass('icon-'+getIcon(v.type))
- )
- );
+ var itemAnnotation = getTemplate('#tpl-item-annotation-display');
+ itemAnnotation = Mustache.render(itemAnnotation, v);
$('.list-current-annotations').append(itemAnnotation)
}
}
@@ -158,8 +151,8 @@
}
function showCurrentAnnotationInTimeline(idAnnotation){
- $('.timeline-annotations .annotation span').hide();
- $('#annotation-timeline-'+idAnnotation+' span').show();
+ $('.annotation').removeClass('editing');
+ $('#annotation-timeline-'+idAnnotation).addClass('editing');
}
//display annotation view
$('.list-current-annotations').on('click', 'a', function(e){
@@ -249,6 +242,7 @@
var idChapter = $(this).parents('form').attr('data-chapter-id');
$('.chapter-segments').find('#'+idChapter).text(value);
$('#row-list-chapter-'+idChapter).find('td:first').text(value);
+ $(this).parents('form').find('.btn-delete-chapter').attr('data-title', value);
}
});
@@ -280,7 +274,7 @@
return $('#templates').find(idTpl).html();
}
//supprimer
-$('.list-chapter-wrap').on('click', '.btn-delete-chapter', function(e){
+$(document).on('click', '.btn-delete-chapter', function(e){
e.preventDefault();
if(chapters.length == 1){alert('Le projet doit contenir au moins un chapitre.'); return;}
@@ -290,6 +284,10 @@
btnDeleteModal.attr('data-id', idChapter);
});
+$(document).on('click', '.btn-ok-chapter', function(e){
+ e.preventDefault();
+ $('.form-chapter-edit').remove();
+})
function deleteChapter(idChapter){
disabledPreview();
@@ -339,12 +337,12 @@
e.preventDefault();
var dataChapter = {
- title : 'New',
- begin : myMedia.currentTime,
- end : organizeNewChapter(myMedia.currentTime),
- description : 'description',
- keywords : ['tag1','tag2']
- };
+ title : 'New',
+ begin : myMedia.currentTime,
+ end : organizeNewChapter(myMedia.currentTime),
+ description : 'description',
+ keywords : ['tag1','tag2']
+ };
newChapter(dataChapter, true);
@@ -447,20 +445,13 @@
left : left,
width : width,
color : v.color,
- id : v.id
+ id : v.id,
+ title : v.title
},
segment = getTemplate('#tpl-annotation-in-timeline');
segment = Mustache.render(segment, dataAnntim);
- /*
- segment = $('<a>').css({
- left : left,
- width : width,
- backgroundColor : v.color
- }).addClass('annotation')
- .attr('data-id', v.id)
- .attr('id', 'annotation-timeline-'+v.id);
- */
+
var isInTimeline = false;
$.each(timeline.find('li'), function(a, b){
if(isInTimeline) return;
@@ -525,6 +516,7 @@
var idAnnotation = $(this).parents('form').attr('data-id');
$('#onglet-title-'+idAnnotation).text(value);
$(this).parents('form').find('.btn-delete-annotation').attr('data-title', value);
+ $('#annotation-timeline-'+ idAnnotation+' span').text(value);
}
});
@@ -564,6 +556,7 @@
var dataView;
if(_.isUndefined(data)){//nouveau
+
var currentTimePlusUnMin = 60 * 1000 + myMedia.currentTime,
endAnnotation = (currentTimePlusUnMin<myMedia.duration) ? currentTimePlusUnMin : myMedia.duration;
var dataAnnotation = {
@@ -635,6 +628,7 @@
break;
case 'slideshow':
+ console.log(currentAnnotation)
$(tabContent).find('.number-spin').val(dataView.content.slideduration/1000);
$(tabContent).find('.number-spin').spin(spinParam);
$(tabContent).find('.ui-sortable').sortable({
@@ -869,10 +863,10 @@
});
function addLinkRow(tbody, dataView){
- //head commun à tous
- var tplLinkRow = getTemplate('#tpl-links-row');
- var output = Mustache.render(tplLinkRow, dataView);
- tbody.append(output);
+ //head commun à tous
+ var tplLinkRow = getTemplate('#tpl-links-row');
+ var output = Mustache.render(tplLinkRow, dataView);
+ tbody.append(output);
}
$('.tab-content').on('keyup', '.links-rows input', function(e){
@@ -922,15 +916,15 @@
$('.btn-save-project').bind('click', function(e){
$('.btn-apercu-projet').removeClass('disabled');
- console.log(JSON.parse(myProject.serialize()));
-/*
+ console.log(myProject.serialize());
+
$.ajax({
type: "POST",
url: urlSaveProject,
data: myProject.serialize(),
contentType: "application/cinelab",
headers: {
- //"X-CSRFToken": options.csrf_token
+ "X-CSRFToken": tokenSaveProject
},
success: function(data, status, request){
console.log('data : ', data);
@@ -942,7 +936,7 @@
alert(gettext("Server error\nYour hashcut couldn't be published"));
}
});
-*/
+
});
@@ -1057,7 +1051,7 @@
content = {
mimetype : "application/x-ldt-text",
markup : "html",
- text : "azerty"
+ text : ""
};
break;
case 'links':