diff -r 9144b17b390e -r fedc0d054b55 integration/js/edition.js --- a/integration/js/edition.js Tue Jun 11 10:43:19 2013 +0200 +++ b/integration/js/edition.js Tue Jun 11 15:46:43 2013 +0200 @@ -130,7 +130,7 @@ $(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'); + $('#tab-annotation-'+idAnnotation+', #annotation-timeline-'+idAnnotation+', #row-list-annotation-'+idAnnotation+', #item-current-annotation-'+idAnnotation).addClass('shadow'); } }); @@ -350,7 +350,7 @@ renderChapter(); loadFormChapter(chapter.id); disabledPreview(); - $('#chapter-title').focus(); + $('.chapter-title').focus(); } $('.chapter-widget').on('click', '.btn-cut-chapter', function(e){ @@ -392,8 +392,6 @@ } function renderChapter(){ - - var chapterSegmentWrap = $('.chapter-segments'), wChapterSegmentWrap = chapterSegmentWrap.width(), chapterList = $('.list-chapter-rows-wrap'); @@ -521,7 +519,6 @@ segment = getTemplate('#tpl-annotation-in-timeline'); segment = Mustache.render(segment, dataAnntim); - var isInTimeline = false; $.each(timeline.find('li'), function(a, b){ if(isInTimeline) return; @@ -716,11 +713,11 @@ currentAnnotation.content.images.move(oldIndex, newIndex); }, }); - var diaporama = $(tabContent).find('#diaporama-'+idAnnotation), + var slideshow = $(tabContent).find('#slideshow-'+idAnnotation), images = viewType.content.images; if(images.length){ $.each(images, function(k,v){ - addImageToDiaporama(diaporama, v); + addImageToSlideshow(slideshow, v); }); } break; @@ -844,17 +841,17 @@ }; currentAnnotation.content.images.push(image); - var listDiaporama = $('#diaporama-'+currentAnnotation.id); - addImageToDiaporama(listDiaporama, image); + var listSlideshow = $('#slideshow-'+currentAnnotation.id); + addImageToSlideshow(listSlideshow, image); $('.popup').modal('hide'); disabledPreview(); }); - function addImageToDiaporama(diaporama, dataView){ - var tplDiapo = getTemplate('#tpl-diaporama-row'); + function addImageToSlideshow(slideshow, dataView){ + var tplDiapo = getTemplate('#tpl-slideshow-row'); tplDiapo = Mustache.render(tplDiapo, dataView); - diaporama.append(tplDiapo); - disabledBtnSortable(diaporama); + slideshow.append(tplDiapo); + disabledBtnSortable(slideshow); }; //edit @@ -876,7 +873,7 @@ var newValue = $(this).val(), name = $(this).attr('name'), span = $('').html(newValue), - indexRow = $(this).parents('.row-image-diaporama').index(); + indexRow = $(this).parents('.row-image-slideshow').index(); $(this).replaceWith(span); currentAnnotation.content.images[indexRow][name] = newValue; disabledPreview(); @@ -894,9 +891,9 @@ //button up / down $(document).on('click', '.ui-sortable .btn-sort', function(e){ e.preventDefault(); - var row = $(this).parents('tr.row-image-diaporama'), + var row = $(this).parents('tr.row-image-slideshow'), oldIndex = row.index(), - listDiaporama = $(this).parents('.list-image-diaporama'); + listSlideshow = $(this).parents('.list-image-slideshow'); if($(this).hasClass('down')) row.insertAfter(row.next()); @@ -906,20 +903,20 @@ var newIndex = row.index(); currentAnnotation.content.images.move(oldIndex, newIndex); - disabledBtnSortable(listDiaporama); + disabledBtnSortable(listSlideshow); disabledPreview(); }); - function disabledBtnSortable(listDiaporama){ - listDiaporama.find('.btn-sort.disabled').removeClass('disabled'); - listDiaporama.find('tr.row-image-diaporama:first-child').find('.btn-sort.up').addClass('disabled'); - listDiaporama.find('tr.row-image-diaporama:last-child').find('.btn-sort.down').addClass('disabled'); + function disabledBtnSortable(listSlideshow){ + listSlideshow.find('.btn-sort.disabled').removeClass('disabled'); + listSlideshow.find('tr.row-image-slideshow:first-child').find('.btn-sort.up').addClass('disabled'); + listSlideshow.find('tr.row-image-slideshow:last-child').find('.btn-sort.down').addClass('disabled'); } //delete image on slideshow $('.tab-content').on('click','.btn-delete-image', function(e){ e.preventDefault(); - var rowImage = $(this).parents('tr.row-image-diaporama'), + var rowImage = $(this).parents('tr.row-image-slideshow'), index = rowImage.index(); rowImage.remove(); @@ -1007,7 +1004,7 @@ }); //duration - $('.tab-content').on('change keyup', '.config-diaporama input[name=duration]', function(){ + $('.tab-content').on('change keyup', '.config-slideshow input[name=duration]', function(){ var value = $(this).val(); if(!isNaN(value)){ disabledPreview(); @@ -1338,7 +1335,7 @@ });//ready -/* Utility */ +/* Utilitys */ Array.prototype.move = function (old_index, new_index) { if (new_index >= this.length) {