# HG changeset patch # User cavaliet # Date 1369820389 -7200 # Node ID ba0de15418d1d2f5a54900e465930f5fe18b7335 # Parent 3725e93a29875838461df28345beced2fcf3a551 enhance modal warning diff -r 3725e93a2987 -r ba0de15418d1 src/metadatacomposer/static/metadatacomposer/css/style.css --- a/src/metadatacomposer/static/metadatacomposer/css/style.css Tue May 28 18:51:57 2013 +0200 +++ b/src/metadatacomposer/static/metadatacomposer/css/style.css Wed May 29 11:39:49 2013 +0200 @@ -22,7 +22,7 @@ .tab-behavior{text-align: center;} .tab-behavior li{display: inline-block; float: none;} td ul{margin-bottom: 0;} -.bibliotheque-image .span2:nth-child(4n+1){clear: left;} +.bibliotheque-image .span2:nth-child(4n+1), .bibliotheque-video .span2:nth-child(4n+1){clear: left;} .modal.popup{width: 970px; margin-left: -485px; height: 80%;} .popup .modal-body{max-height: none; background-color: #fff; height: 80%;} .previsualisation img{max-height: 400px;} @@ -39,7 +39,7 @@ .project-action a:last-child{margin-right: 20px;} .chapter-widget-info{margin-bottom: 20px;} .chapter-widget form{ margin: 0;} -.chapter-widget input, .form-info-general-annotation input, .form-info-general-annotation textarea{width: 196px; max-width: 196px; } +.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; } @@ -95,11 +95,14 @@ .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;} -.annotation-son-content textarea{max-width: 206px;} +.annotation-audio-content textarea{max-width: 206px;} + +.annotation-links-content .links-form:nth-child(n+2){border-top:1px solid; padding-top: 20px;} + /* Tangle */ .time-tangle { - color: #2c3e50; cursor: w-resize; position: relative; - border-bottom: 1px dashed #2c3e50; + color: #2c3e50; cursor: w-resize; position: relative; + border-bottom: 1px dashed #2c3e50; } .time-tangle:hover, .time-tangle.active { @@ -107,8 +110,8 @@ } .time-tangle:hover:after, .time-tangle.active:after { - position: absolute; - display: inline-block; + position: absolute; + display: inline-block; color: #2c3e50; top: 18px; left: 50%; width: 160px; margin-left: -80px; font-size: 10px; text-align: center; content: "glisser pour modifier"; diff -r 3725e93a2987 -r ba0de15418d1 src/metadatacomposer/static/metadatacomposer/js/common.js --- a/src/metadatacomposer/static/metadatacomposer/js/common.js Tue May 28 18:51:57 2013 +0200 +++ b/src/metadatacomposer/static/metadatacomposer/js/common.js Wed May 29 11:39:49 2013 +0200 @@ -42,10 +42,12 @@ $(document).on('click','.btn-delete', function(e){ e.preventDefault(); var titleMedia = $(this).attr('data-title'), - textModal = $('

Êtes-vous sûr de vouloir supprimer '+titleMedia+' ?

'), urlDelete = $(this).attr('href'); + console.log("coucou"); + console.log(titleMedia); + console.log($("#modal-confirm .modal-body").find('.titleMedia')); $("#modal-confirm #btn-delete-modal").attr('href', urlDelete).focus(); - $("#modal-confirm .modal-body").empty().append(textModal); + $("#modal-confirm .modal-body").find('.titleMedia').text(titleMedia); $("#modal-confirm").modal('show'); }); diff -r 3725e93a2987 -r ba0de15418d1 src/metadatacomposer/static/metadatacomposer/js/edition.js --- a/src/metadatacomposer/static/metadatacomposer/js/edition.js Tue May 28 18:51:57 2013 +0200 +++ b/src/metadatacomposer/static/metadatacomposer/js/edition.js Wed May 29 11:39:49 2013 +0200 @@ -7,7 +7,6 @@ $(function(){ var global = { - diaporama : null, idAnnotation : null, colorsIndex : 0, colors : @@ -18,15 +17,39 @@ }; + + myProject.onLoad(function() { + + + +//load Annotations +myProject.getAnnotationsByTypeTitle("annotations"); + + $(".project-title").text(myProject.title); myMedia = myProject.getCurrentMedia(); - + +//load Chapitre +var _chapters = myProject.getAnnotationsByTypeTitle("chapitrage"); +if(_chapters.length){ + $.each(_chapters, function(k, v){ + var render = false; + if((k+1) == _chapters.length){ + render = true; + } + newChapter(v, render); + }); +} + + + + //chargement des chapitres et annotations existants - loadInitChapters(); - loadInitAnnotation() + // loadInitChapters(); + loadInitAnnotation(); IriSP.htmlPlayer( myMedia, @@ -35,7 +58,16 @@ width: 460, height: 345, controls: true, - autostart: true + autostart: true, + url_transform: function(src) { + return [{ + type: "video/mp4", + src: src.replace(/\.[\d\w]+$/,'.mp4') + }, { + type: "video/webm", + src: src.replace(/\.[\d\w]+$/,'.webm') + }]; + } } ); @@ -115,12 +147,9 @@ //########### modal $(document).on('click', 'a.open-modal', function(e){ - var diaporama = $(this).attr('data-diaporama'), - idAnnotation = $(this).attr('data-id'); + var idAnnotation = $(this).attr('data-id'); - if(diaporama !== undefined){ - global.diaporama = diaporama; - } + if(idAnnotation !== undefined){ global.idAnnotation = idAnnotation; } @@ -133,27 +162,23 @@ $('.input-image-'+typeImage).show(); }); -//bibliotheque +//select on bibliotheque + //video $('.popup').on('click', '.bibliotheque-video a', function(e){ e.preventDefault(); + + var url = $(this).attr('href'); + currentAnnotation.content.url = url; + $('.popup').modal('hide'); $.get('template.html', function(templates){ var videoWrap = $('#tab-'+global.idAnnotation).find('.annotation-video-content'), tplVideo = $(templates).filter('#tpl-video-row').html(); - console.log(videoWrap) videoWrap.empty().append(tplVideo); }); }); - //image - $('.popup').on('click', '.bibliotheque-image a', function(e){ - e.preventDefault(); - var listDiaporama = $('#'+global.diaporama); - addImageToDiaporama(listDiaporama); - $('.popup').modal('hide'); - }); - //confirmation suppression @@ -265,7 +290,7 @@ }); //nouveau chapitre - function newChapter(dataChapter){ + function newChapter(dataChapter, render){ var chapter = new IriSP.Model.Annotation(false, myProject); chapter.setMedia(myMedia.id); chapter.setBegin(dataChapter.begin); @@ -276,7 +301,7 @@ chapter.color = global.colors[(global.colorsIndex diaporama (spin) + +//annotation slideshow +$('.tab-content').on('click', '.btn-autostart', function(){ + var autostart = $(this).attr('data-autostart'); + if(autostart == "true"){ autostart = true;} + else {autostart = false;} + currentAnnotation.content.autostart = autostart; +}); +$('.tab-content').on('change keyup', '.config-diaporama input[name=duration]', function(){ + var value = $(this).val(); + if(!isNaN(value)){ + currentAnnotation.content.duration = value; + } +}); + //################ config - //tagit function onTagItChange(e, ui) { var tagitType = $(this).attr('data-type'), @@ -691,11 +816,11 @@ docType: '', bodyStyle: "margin:0; font-family: 'Helvetica Neue',​Helvetica,​Arial,​sans-serif;", updateTextArea : function(text){ - + currentAnnotation.content.text = text; return text; }, updateFrame: function(text){ - + currentAnnotation.content.text = text; return text; } }; @@ -736,9 +861,9 @@ function getContentAnnotationByType(type){ var content; switch(type){ - case 'sound': + case 'audio': content = { - mimetype : "application/x-ldt-sound", + mimetype : "application/x-ldt-audio", url : "", embedcode : "" }; @@ -754,13 +879,12 @@ content = { mimetype : "application/x-ldt-text", markup : "html", - text : "" + text : "azerty" }; break; case 'links': content = { mimetype : "application/x-ldt-links", - markup : "html", links : [] }; break; @@ -778,7 +902,7 @@ //test -a = $(".wysiwyg").cleditor(wysiwygConfig); +//a = $(".wysiwyg").cleditor(wysiwygConfig); $('.number-spin').spin(spinParam); @@ -794,4 +918,13 @@ $(".tag-it").tagit(); +$('.log-annotations').bind('click', function(e){ + e.preventDefault(); + console.log(annotations.length + ' annotations', annotations); +}); + +$('.log-chapters').bind('click', function(e){ + e.preventDefault(); + console.log(chapters.length + ' chapitres',chapters); +}); });//ready \ No newline at end of file diff -r 3725e93a2987 -r ba0de15418d1 src/metadatacomposer/static/metadatacomposer/js/ldt-serializer.js --- a/src/metadatacomposer/static/metadatacomposer/js/ldt-serializer.js Tue May 28 18:51:57 2013 +0200 +++ b/src/metadatacomposer/static/metadatacomposer/js/ldt-serializer.js Wed May 29 11:39:49 2013 +0200 @@ -131,6 +131,7 @@ } _res.color = '#' + _c; } + _res.content = _data.content; _res.setMedia(_data.media); _res.setAnnotationType(_data.meta["id-ref"]); _res.setTags(IriSP._(_data.tags).pluck("id-ref")); @@ -153,14 +154,22 @@ id : _data.id, begin : _data.begin.milliseconds, end : _data.end.milliseconds, - content : { - title : _data.title || "", - description : _data.description || "", - audio : _data.audio, - img: { - src: _data.thumbnail + content : IriSP._.defaults( + {}, + { + title : _data.title, + description : _data.description, + audio : _data.audio, + img: { + src: _data.thumbnail + } + }, + _data.content, + { + title: "", + description: "" } - }, + ), color: _color, media : _data.media.id, meta : { @@ -177,6 +186,7 @@ } }) } + _res.content.title = _data.title || _res.content.title || ""; _dest.annotations.push(_res); } }, diff -r 3725e93a2987 -r ba0de15418d1 src/metadatacomposer/templates/metadatacomposer_project_list.html --- a/src/metadatacomposer/templates/metadatacomposer_project_list.html Tue May 28 18:51:57 2013 +0200 +++ b/src/metadatacomposer/templates/metadatacomposer_project_list.html Wed May 29 11:39:49 2013 +0200 @@ -90,7 +90,9 @@

Confirmation de la suppression

- + - + - +