# HG changeset patch
# User cavaliet
# Date 1370860564 -7200
# Node ID cf1781603b083d817fd7b99a6e5b73e1b3bfd828
# Parent 1c163781996b40d983f1372a968bd06ede9cdd90
add integration modifs
diff -r 1c163781996b -r cf1781603b08 src/metadatacomposer/static/metadatacomposer/css/style.css
--- a/src/metadatacomposer/static/metadatacomposer/css/style.css Fri Jun 07 17:56:50 2013 +0200
+++ b/src/metadatacomposer/static/metadatacomposer/css/style.css Mon Jun 10 12:36:04 2013 +0200
@@ -49,7 +49,7 @@
.form-info-general-annotation{ }
.chapter-widget input, .form-info-general-annotation input, .form-info-general-annotation textarea{width: 196px; max-width: 196px; }
.chapter-widget textarea{width: 426px; max-width: 426px; min-width: 426px; height: 20px;-webkit-transition: height .3s ease;-moz-transition: height .3s ease;transition: height .3s ease;}
-.form-chapter-edit{}
+.label-left{text-align: left; padding-left: 10px;}
.chapter-widget-info table{margin: 0; padding-top: 40px; }
.chapter-widget table td{}
.chapter-widget textarea:focus{height: 100px;}
@@ -61,9 +61,9 @@
.list-chapter-wrap, .list-annotation-wrap, .section{background-color: #F5F5F5; border: 1px solid #E5E5E5;}
.list-chapter-wrap table, .list-annotation-wrap table{margin-bottom: 0;}
.list-chapter-wrap h4, .form-chapter-edit h4, .list-annotation-wrap h4, .title-section{padding: 10px; border-bottom: 1px solid; margin-bottom: 10px;}
-.add-annotation-wrap, form.form-info-general-annotation{padding: 10px 0;}
-form.form-info-general-annotation ul.tagit {margin-left: 0px;width: 195px;}
-form.form-info-general-annotation textarea{min-height:100px; height: 100px;min-width: 196px;}
+.add-annotation-wrap, .form-info-general-annotation{padding: 10px 0;}
+.form-info-general-annotation ul.tagit {margin-left: 0px;width: 195px;}
+.form-info-general-annotation textarea{min-height:100px; height: 100px;min-width: 196px;}
.add-annotation-wrap {margin-bottom: 20px; padding-top: 0;}
@@ -107,8 +107,9 @@
.annotation-display-view{display:none;text-align:center; line-height:200px;background-color: #fff;position: absolute; width: 200px; margin-left: -100px; height: 200px; margin-top: -100px; top: 50%; left: 50%;}
.list-current-annotations{position: absolute;bottom: 40px; left: 20px; margin: 0;}
.list-current-annotations li{list-style: none; margin-top: 4px;}
-.list-current-annotations a{text-align:center; line-height:20px; color:#FFF;display: inline-block; background-color: #589; width: 20px; height: 20px; }
-.list-current-annotations a:hover{text-decoration: none;}
+.list-current-annotations a{text-decoration: none;line-height:20px; color:#202020;display: inline-block; background-color: #589; height: 20px; padding: 0 4px; }
+.list-current-annotations a span{display: none;}
+.list-current-annotations a:hover span{display: inline-block;}
.annotation-audio-content textarea{max-width: 206px;}
.annotation-links-content .links-form:nth-child(n+2){border-top:1px solid; padding-top: 20px;}
@@ -126,6 +127,12 @@
.description-slideshow-row span{max-height: 100px; display: inline-block; overflow: auto;}
.description-slideshow-row textarea{width: 164px; max-width: 164px; height: 100px;}
.label-modify-video, .label-add-video{display: none;}
+
+.shadow {
+ background-color: #00FFFF !important;
+}
+.alert-message{display: none;}
+
/* Tangle */
.time-tangle {
color: #2c3e50; cursor: w-resize; position: relative;
diff -r 1c163781996b -r cf1781603b08 src/metadatacomposer/static/metadatacomposer/js/edition.js
--- a/src/metadatacomposer/static/metadatacomposer/js/edition.js Fri Jun 07 17:56:50 2013 +0200
+++ b/src/metadatacomposer/static/metadatacomposer/js/edition.js Mon Jun 10 12:36:04 2013 +0200
@@ -1,6 +1,7 @@
var myMedia = undefined,
currentChapter = undefined,
- currentAnnotation = undefined;
+ currentAnnotation = undefined,
+ secMiniChapter = 10;
$(function(){
@@ -24,7 +25,27 @@
}
});
-$('.timeline-annotations').on('click', '.annotation', function(e){
+//survol
+$(document).on('mouseover', '.timeline-annotations .annotation, #list-annotations-rows tr, .item-display-annotation' , function(){
+ if(!$(this).hasClass('shadow')) {
+ var idAnnotation = $(this).attr('data-id');
+ $('#annotation-timeline-'+idAnnotation+', #row-list-annotation-'+idAnnotation+', #item-current-annotation-'+idAnnotation).addClass('shadow');
+ }
+});
+
+$(document).on('mouseover', '.chapter-segment, .row-list-chapter' , function(){
+ if(!$(this).hasClass('shadow')) {
+ var idChapter = $(this).attr('data-id');
+ $('#row-list-chapter-'+idChapter+', #'+idChapter+', #form-chapter-edit-'+idChapter).addClass('shadow');
+ }
+});
+
+$(document).on('mouseout', '.shadow' , function(){
+ $('.shadow').removeClass('shadow');
+});
+
+
+$(document).on('click', '.annotation, .item-display-annotation', function(e){
e.preventDefault();
var idAnnotation = $(this).attr('data-id'),
annotation = _.find(annotations, function(c){ return c.id == idAnnotation; });
@@ -130,6 +151,7 @@
currentAnnotationsDisplay.push(v.id);
if(!$('#item-current-annotation-'+v.id).length){
var itemAnnotation = getTemplate('#tpl-item-annotation-display');
+ v.iconTab = getIcon(v.type);
itemAnnotation = Mustache.render(itemAnnotation, v);
$('.list-current-annotations').append(itemAnnotation)
}
@@ -157,6 +179,7 @@
//display annotation view
$('.list-current-annotations').on('click', 'a', function(e){
e.preventDefault();
+ /*
var annotationDisplayView = $('.annotation-display-view'),
idAnnotation = $(this).attr('data-id');
var annotation = _.find(annotations, function(c){ return c.id == idAnnotation; });
@@ -170,6 +193,7 @@
.text(annotation.type+' : '+annotation.title)
.show();
}
+ */
});
//########### modal
@@ -277,12 +301,23 @@
$(document).on('click', '.btn-delete-chapter', function(e){
e.preventDefault();
- if(chapters.length == 1){alert('Le projet doit contenir au moins un chapitre.'); return;}
+ if(chapters.length == 1){
+ $('#modal-alert .alert-message').hide();
+ $('#modal-alert #alert-chapter-number').show();
+ $('#modal-alert').modal('show');
+ return;
+ }
var idChapter = $(this).attr('data-chapter-id'),
btnDeleteModal = $("#modal-confirm #btn-delete-modal");
btnDeleteModal.attr('data-type-delete', 'chapter');
btnDeleteModal.attr('data-id', idChapter);
+ var titleMedia = $(this).attr('data-title'),
+ urlDelete = $(this).attr('href');
+ $("#modal-confirm #btn-delete-modal").attr('href', urlDelete).focus();
+ $("#modal-confirm .modal-body").find('.titleMedia').text(titleMedia);
+ $("#modal-confirm").modal('show');
+
});
$(document).on('click', '.btn-ok-chapter', function(e){
e.preventDefault();
@@ -335,11 +370,19 @@
$('.chapter-widget').on('click', '.btn-cut-chapter', function(e){
e.preventDefault();
-
+ var begin = myMedia.currentTime,
+ end = organizeNewChapter(myMedia.currentTime);
+ if(!end){
+ $('#modal-alert .alert-message').hide();
+ $('#modal-alert #alert-chapter-duration').show();
+ $('#modal-alert #alert-chapter-duration strong').text(secMiniChapter);
+ $('#modal-alert').modal('show');
+ return;
+ }
var dataChapter = {
title : 'New',
- begin : myMedia.currentTime,
- end : organizeNewChapter(myMedia.currentTime),
+ begin : begin,
+ end : end,
description : 'description',
keywords : ['tag1','tag2']
};
@@ -350,11 +393,12 @@
function organizeNewChapter(beginNew){
- var returnEnd;
+ var returnEnd = false;
$.each(chapters, function(k, v){
var begin = v.begin,
end = v.end;
- if(beginNew>=begin && beginNew<=end){
+
+ if(beginNew>=begin && beginNew<=end && end-beginNew>secMiniChapter*1000 && beginNew-begin>secMiniChapter*1000){
returnEnd = new IriSP.Model.Time(end);
v.setEnd(beginNew);
}
@@ -386,7 +430,9 @@
left : left,
width : width,
backgroundColor : v.color
- }).attr('id', v.id);
+ }).attr('id', v.id)
+ .attr('data-id', v.id)
+ .addClass('chapter-segment');
chapterSegmentWrap.append(segment);
@@ -516,6 +562,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).attr('title', value);
$('#annotation-timeline-'+ idAnnotation+' span').text(value);
}
});
@@ -608,6 +655,7 @@
var videoWrap = $(tabContent).find('.annotation-video-content');
renderVideoInfo(videoWrap, viewType.content);
labelModify.show();
+
}else{
labelAdd.show();
}
diff -r 1c163781996b -r cf1781603b08 src/metadatacomposer/static/metadatacomposer/js/tangle.js
--- a/src/metadatacomposer/static/metadatacomposer/js/tangle.js Fri Jun 07 17:56:50 2013 +0200
+++ b/src/metadatacomposer/static/metadatacomposer/js/tangle.js Mon Jun 10 12:36:04 2013 +0200
@@ -45,6 +45,7 @@
});
row.find('.begin').text(chapterData.begin);
+ console.log(chapterData.getDuration())
row.find('.duration').text(chapterData.getDuration());
row.find('.end').text(chapterData.end);
@@ -58,7 +59,8 @@
}
function updateChapterDuration(val, chapterBefore, chapterAfter){
- if (val<=chapterAfter.end && val>=chapterBefore.begin) {
+
+ if (val<=chapterAfter.end && val>=chapterBefore.begin && chapterAfter.end-val>secMiniChapter*1000 && val-chapterBefore.begin>secMiniChapter*1000) {
chapterAfter.setBegin(val);
chapterBefore.setEnd(val);
@@ -83,8 +85,10 @@
var chapterAfter = chapters[indexChapter+1],
chapterBefore = currentChapter;
+
+ updateChapterDuration(val, chapterBefore, chapterAfter);
+
- updateChapterDuration(val, chapterBefore, chapterAfter);
});
/*
$(".tangle-start")
diff -r 1c163781996b -r cf1781603b08 src/metadatacomposer/templates/metadatacomposer_edit.html
--- a/src/metadatacomposer/templates/metadatacomposer_edit.html Fri Jun 07 17:56:50 2013 +0200
+++ b/src/metadatacomposer/templates/metadatacomposer_edit.html Mon Jun 10 12:36:04 2013 +0200
@@ -85,6 +85,42 @@
+
Liste des chapitres
@@ -100,6 +136,27 @@
+
@@ -140,6 +197,36 @@
+
@@ -249,14 +336,13 @@
Vidéo
- Ajouter une vidéo
-
+ Ajouter une vidéo
+
-

+
@@ -311,8 +397,7 @@
Diaporama
Ajouter une image
-
+
@@ -343,7 +428,7 @@
- |
+ |
Titre annotation 1 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officiis aliquid non placeat consequuntur fugit minima. |
@@ -359,6 +444,40 @@
|
+
+ |
+ Titre annotation 2 |
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officiis aliquid non placeat consequuntur fugit minima. |
+
+
+ |
+
+
+ |
+ Titre annotation 3 |
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officiis aliquid non placeat consequuntur fugit minima. |
+
+
+ |
+
@@ -377,7 +496,7 @@
-