# HG changeset patch # User cavaliet # Date 1370534296 -7200 # Node ID 3d4b40a75ecd9ae0982b3d408d5ad7e9a3a4e255 # Parent 4b37ee07374d7efe5025a6c91dfbfb013caa580e enable post data diff -r 4b37ee07374d -r 3d4b40a75ecd src/metadatacomposer/static/metadatacomposer/css/style.css --- a/src/metadatacomposer/static/metadatacomposer/css/style.css Thu Jun 06 15:48:09 2013 +0200 +++ b/src/metadatacomposer/static/metadatacomposer/css/style.css Thu Jun 06 17:58:16 2013 +0200 @@ -44,16 +44,17 @@ .project-action a:last-child{margin-right: 20px;} .chapter-widget-info{margin-bottom: 20px;} .chapter-widget form{ margin: 0;} -.form-info-general-annotation{background-color: #ecf0f1;} +#list-annotations{ background-color: #fff;} +.form-info-general-annotation{ border-bottom: 1px solid #bdc3c7;} .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{} .chapter-widget-info table{margin: 0; padding-top: 40px; } .chapter-widget table td{} .chapter-widget textarea:focus{height: 100px;} -.chapitre-cut-wrap{position: relative; height: 50px; margin-bottom: 10px;} -.btn-cut-chapter{position: absolute;top: 20px;left: 11px; width: 40px;} -.indicateur-chapter, .indicateur-annotation{z-index:100; left:10px; width: 1px; height: 100%;background-color: #000; position: absolute;} +.chapitre-cut-wrap{position: relative; height: 70px; margin-bottom: 10px;} +.btn-cut-chapter{height:40px;position: absolute;top: 20px;left: 11px; width: 40px;} +.indicateur-chapter, .indicateur-annotation{z-index:999; left:10px; width: 1px; height: 100%;background-color: #000; position: absolute;} .chapter-segments {overflow:hidden; width: 100%; height: 20px; margin: 0; position: relative;} .chapter-segments li{position: absolute; top: 0; cursor:pointer; float: left; list-style: none; line-height: 20px; height: 20px; text-align: center; overflow: hidden;} .list-chapter-wrap, .list-annotation-wrap, .section{background-color: #F5F5F5; border: 1px solid #E5E5E5;} @@ -67,7 +68,7 @@ .slider-duration{width: 435px;display: inline-block; margin-bottom: 10px;} .btn-save-annotation{margin-right: 10px;} -.edit-annotation-diaporama{} +.tab-pane.active{background-color: #F5F5F5;} .edit-annotation-title{border-bottom: 1px solid #E5E5E5; margin-bottom: 20px;} .edit-annotation-title h3{display: inline-block;} .edit-annotation-title span{text-align: right; line-height: 60px;} @@ -90,8 +91,8 @@ .slider-duration.ui-slider.ui-slider-horizontal.ui-widget.ui-widget-content.ui-corner-all{ background: #202020;} .timeline-annotations-wrap{position: relative;background-color: #202020;} .timeline-annotations{width: 460px;height: auto; position: relative; margin: 0; padding-top: 4px;} -.timeline-annotations li{display: block; width: 460px;height: 10px; position: relative; padding-bottom: 4px;} -.timeline-annotations .annotation{ color:#000; text-align:center; font-size : 10px; overflow: hidden; line-height: 9px; width: 10px; height: 10px; background-color: #c0392b; position: absolute; top:0px;} +.timeline-annotations li{display: block; width: 460px;height: 12px; position: relative; padding-bottom: 4px;} +.timeline-annotations .annotation{ color:#000; text-align:center; font-size : 10px; overflow: hidden; line-height: 12px; width: 10px; height: 12px; background-color: #c0392b; position: absolute; top:0px;} ul.tagit{margin-left: 10px;-webkit-border-radius: 0px; -moz-border-radius: 0px; border-radius: 0px;} @@ -115,8 +116,10 @@ #templates{display: none;} .title-slideshow-row{word-wrap: break-word;width: 76px;} -.description-slideshow-row{word-wrap: break-word; width: 180px;} -.description-slideshow-row textarea{width: 164px; max-width: 164px; height: 164px;} +.title-slideshow-row input{width: 70px;} +.description-slideshow-row{word-wrap: break-word; width: 180px; } +.description-slideshow-row span{max-height: 100px; display: inline-block; overflow: auto;} +.description-slideshow-row textarea{width: 164px; max-width: 164px; height: 100px;} /* Tangle */ .time-tangle { color: #2c3e50; cursor: w-resize; position: relative; diff -r 4b37ee07374d -r 3d4b40a75ecd src/metadatacomposer/static/metadatacomposer/js/edition.js --- a/src/metadatacomposer/static/metadatacomposer/js/edition.js Thu Jun 06 15:48:09 2013 +0200 +++ b/src/metadatacomposer/static/metadatacomposer/js/edition.js Thu Jun 06 17:58:16 2013 +0200 @@ -1,8 +1,6 @@ var myMedia = undefined, currentChapter = undefined, - currentAnnotation = undefined, - chapters = [], - annotations = []; + currentAnnotation = undefined; $(function(){ @@ -38,35 +36,40 @@ myMedia = myProject.getCurrentMedia(); + var anntypes = myProject.getAnnotationTypes().searchByTitle("chapitrage"); + if (!anntypes.length) { + chapterAnnType = new IriSP.AnnotationType(false, myProject); + chapterAnnType.title = "chapitrage"; + } else { + chapterAnnType = anntypes[0]; + } + //load Chapitre -var _chapters = myProject.getAnnotationsByTypeTitle("chapitrage"); -if(_chapters.length){ - $.each(_chapters, function(k, v){ + + chapters = chapterAnnType.getAnnotations(); + $.each(chapters, function(k, v){ v.color = getRandomColor(); - chapters.push(v); - if((k+1) == _chapters.length){ - renderChapter(); - } }); -} + renderChapter(); //load Annotations -var _annotations = myProject.getAnnotationsByTypeTitle("annotations"); -if(_annotations.length){ - $.each(_annotations, function(k, v){ + var anntypes = myProject.getAnnotationTypes().searchByTitle("annotations"); + if (!anntypes.length) { + annotationsAnnType = new IriSP.AnnotationType(false, myProject); + annotationsAnnType.title = "annotations"; + } else { + annotationsAnnType = anntypes[0]; + } - v.color = getRandomColor(); + annotations = annotationsAnnType.getAnnotations(); + $.each(annotations, function(k, v){ var type = v.content.mimetype.split('-'); type = type[type.length-1] v.type = type; + v.color = getRandomColor(); + }); + renderAnnotation(); - annotations.push(v); - if((k+1) == _annotations.length){ - renderAnnotation(); - } - - }); -} IriSP.htmlPlayer( myMedia, @@ -79,10 +82,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') }]; } } @@ -102,6 +105,7 @@ }else{ btnCutChapter.css("left",pos); } + $('.info-time').text(t) //annotations view refreshAnnotationDisplay(t); @@ -151,7 +155,7 @@ function showCurrentAnnotationInTimeline(idAnnotation){ $('.timeline-annotations .annotation').empty(); - $('#annotation-timeline-'+idAnnotation).text('en cours'); + $('#annotation-timeline-'+idAnnotation).html(' '+textCurrentAnnotationEditT); } //display annotation view $('.list-current-annotations').on('click', 'a', function(e){ @@ -166,7 +170,7 @@ annotationDisplayView .attr('data-id', idAnnotation) .css('backgroundColor', annotation.color) - .text(annotation.type) + .text(annotation.type+' : '+annotation.title) .show(); } }); @@ -177,13 +181,6 @@ }); -//edition image - $('.popup').on('change', '#media-type-select', function(e){ - var typeImage = $(this).val(); - $('.input-image-url, .input-image-upload').hide(); - $('.input-image-'+typeImage).show(); - }); - //select on bibliotheque //confirmation suppression @@ -206,6 +203,7 @@ //--title-editor $(document).on('click', '.project-title-editor i, .project-title', function () { + disabledPreview(); var html = $('.project-title').html(); var input = $(''); input.val(html); @@ -238,6 +236,8 @@ }); $('.chapter-widget-info').on('keyup', 'input[name=title], textarea', function(e){ + disabledPreview(); + var name = $(this).attr('name'), value = $(this).val(); currentChapter[name] = value; @@ -252,6 +252,7 @@ function loadFormChapter(idChapter){ + disabledPreview(); currentChapter = _.find(chapters, function(c){ return c.id == idChapter; }); @@ -283,32 +284,12 @@ btnDeleteModal = $("#modal-confirm #btn-delete-modal"); btnDeleteModal.attr('data-type-delete', 'chapter'); btnDeleteModal.attr('data-id', idChapter); - // $("#modal-confirm #btn-delete-modal").attr('onclick', 'deleteChapter("'+idChapter+'")') -/* - var idChapter = $(this).attr('data-chapter-id'), - chapter = _.find(chapters, function(c){ return c.id == idChapter; }), - indexChapter = _.indexOf(chapters, chapter), - chapterModify; - if(indexChapter == 0){ - chapterModify = chapters[1]; - chapterModify.setBegin(0); - }else{ - chapterModify = chapters[indexChapter-1]; - //var newEnd = new IriSP.Model.Time(chapter.end) - chapterModify.setEnd(chapter.end); - } - chapters = _(chapters).reject(function(c) { return c.id == idChapter; }); - renderChapter(); - //si le formulaire est visible - if($('#form-chapter-edit-'+idChapter).length){ - $('#form-chapter-edit-'+idChapter).remove(); - } -*/ }); function deleteChapter(idChapter){ - $("#modal-confirm").modal('hide') + disabledPreview(); + $("#modal-confirm").modal('hide'); var chapter = _.find(chapters, function(c){ return c.id == idChapter; }), indexChapter = _.indexOf(chapters, chapter), chapterModify; @@ -337,6 +318,7 @@ chapter.setMedia(myMedia.id); chapter.setBegin(dataChapter.begin); chapter.setEnd(dataChapter.end); + chapter.setAnnotationType(chapterAnnType.id); chapter.title = dataChapter.title; chapter.description = dataChapter.description; chapter.keywords = dataChapter.keywords; @@ -378,6 +360,8 @@ } function renderChapter(){ + disabledPreview(); + var chapterSegmentWrap = $('.chapter-segments'), wChapterSegmentWrap = chapterSegmentWrap.width(), chapterList = $('.list-chapter-rows-wrap'); @@ -417,6 +401,7 @@ function newAnnotation(dataAnnotation){ var annotation = new IriSP.Model.Annotation(false, myProject); + annotation.setAnnotationType(annotationsAnnType.id); annotation.setMedia(myMedia.id); annotation.setBegin(dataAnnotation.begin); annotation.setEnd(dataAnnotation.end); @@ -433,6 +418,8 @@ } function renderAnnotation(){ + disabledPreview(); + var timeline = $('.timeline-annotations'), wTimeline = timeline.width(), annotationList = $('#list-annotations-rows'); @@ -499,7 +486,7 @@ //edit annotation $('#list-annotations').on('click', 'a.btn-edit-annotation', function(e){ e.preventDefault(); - + disabledPreview(); var idAnnotation = $(this).attr('data-id'); //si il est déjà ouvert if($('#tab-annotation-'+idAnnotation).length){ @@ -511,6 +498,7 @@ }); $('.tab-content').on('keyup', '.form-info-general-annotation input[name=title], .form-info-general-annotation textarea', function(e){ + disabledPreview(); var name = $(this).attr('name'), value = $(this).val(); currentAnnotation[name] = value; @@ -523,13 +511,7 @@ //delete annotation $(document).on('click','.btn-delete-annotation', function(e){ e.preventDefault(); - /* - var idAnnotation = $(this).attr('data-id'); - annotations = _(annotations).reject(function(c) { return c.id == idAnnotation; }); - closeTab(idAnnotation); - if(!$(this).hasAttr('data-no-render'))//si on ferme à partir de la tab renderAnnotation sera appelé 2 fois - renderAnnotation(); - */ + var idAnnotation = $(this).attr('data-id'), btnDeleteModal = $("#modal-confirm #btn-delete-modal"); btnDeleteModal.attr('data-type-delete', 'annotation'); @@ -537,6 +519,7 @@ }); function deleteAnnotation(idAnnotation){ + disabledPreview(); $("#modal-confirm").modal('hide'); annotations = _(annotations).reject(function(c) { return c.id == idAnnotation; }); closeTab(idAnnotation); @@ -557,7 +540,7 @@ }); function openTab(type, data){ - + var dataView; if(_.isUndefined(data)){//nouveau var currentTimePlusUnMin = 60 * 1000 + myMedia.currentTime, @@ -605,16 +588,10 @@ case 'audio': break; case 'video': - if(viewType.content.url != ""){ - var videoWrap = $(tabContent).find('.annotation-video-content'); renderVideoInfo(videoWrap, viewType.content); - } - - - break; case 'text': var cledit = $(tabContent).find('.wysiwyg').cleditor(wysiwygConfig)[0]; @@ -632,7 +609,7 @@ break; case 'slideshow': - + $(tabContent).find('.number-spin').val(dataView.content.slideduration/1000); $(tabContent).find('.number-spin').spin(spinParam); $(tabContent).find('.ui-sortable').sortable({ start: function (event, ui) { @@ -780,22 +757,12 @@ }; //edit title / description - $('.tab-content').on('click', '.title-slideshow-row', function(){ + $('.tab-content').on('click', '.title-slideshow-row, .description-slideshow-row, .video-title-edit, .video-description-edit', function(){ if($(this).find('input').length) return; - var html = $(this).find('span').html(); - var input = $('').addClass('input-mini').attr('name', 'title'); - 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(); - }); - }); - - $('.tab-content').on('click', '.description-slideshow-row', function(){ - if($(this).find('textarea').length) return; - var html = $(this).find('span').html(); - var input = $('