# 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Êtes-vous sûr de vouloir supprimer ?
Attention, cette action est irréversible.
Êtes-vous sûr de vouloir supprimer ?
Attention, cette action est irréversible.