diff -r e40637c085b0 -r 172abe53cf6c integration/js/edition.js --- a/integration/js/edition.js Fri Jun 07 16:31:42 2013 +0200 +++ b/integration/js/edition.js Fri Jun 07 17:56:17 2013 +0200 @@ -36,7 +36,7 @@ $(document).on('mouseover', '.chapter-segment, .row-list-chapter' , function(){ if(!$(this).hasClass('shadow')) { var idChapter = $(this).attr('data-id'); - $('#row-list-chapter-'+idChapter+', #'+idChapter).addClass('shadow'); + $('#row-list-chapter-'+idChapter+', #'+idChapter+', #form-chapter-edit-'+idChapter).addClass('shadow'); } }); @@ -301,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(); @@ -362,7 +373,10 @@ var begin = myMedia.currentTime, end = organizeNewChapter(myMedia.currentTime); if(!end){ - alert('Les chapitres doivent durer au moins '+secMiniChapter+' secondes'); + $('#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 = { @@ -641,6 +655,7 @@ var videoWrap = $(tabContent).find('.annotation-video-content'); renderVideoInfo(videoWrap, viewType.content); labelModify.show(); + }else{ labelAdd.show(); }