# HG changeset patch # User cavaliet # Date 1371656987 -7200 # Node ID 3246a70209f0cc344baba7c8d7df9680d478d254 # Parent ac4dc3d6400b5d0922a1b9441340419c344ac27c update from integration and version number to 0.1.2 diff -r ac4dc3d6400b -r 3246a70209f0 src/metadatacomposer/__init__.py --- a/src/metadatacomposer/__init__.py Tue Jun 18 15:51:39 2013 +0200 +++ b/src/metadatacomposer/__init__.py Wed Jun 19 17:49:47 2013 +0200 @@ -1,4 +1,4 @@ -VERSION = (0, 1, 1, "final", 0) +VERSION = (0, 1, 2, "final", 0) def get_version(): diff -r ac4dc3d6400b -r 3246a70209f0 src/metadatacomposer/static/metadatacomposer/css/style.css --- a/src/metadatacomposer/static/metadatacomposer/css/style.css Tue Jun 18 15:51:39 2013 +0200 +++ b/src/metadatacomposer/static/metadatacomposer/css/style.css Wed Jun 19 17:49:47 2013 +0200 @@ -116,11 +116,11 @@ a.open-tab{text-shadow:none;} a.open-tab:hover{background-color: #E6E6E6;} -.open-tab.video{background-color: #BE4477;} -.open-tab.text{background-color:#5E90CB;} -.open-tab.slideshow{background-color:#F69058;} -.open-tab.audio{background-color:#63BE6C;} -.open-tab.links{background-color:#8985BB;} +.open-tab.video i{color: #BE4477;} +.open-tab.text i{color:#5E90CB;} +.open-tab.slideshow i{color:#F69058;} +.open-tab.audio i{color:#63BE6C;} +.open-tab.links i{color:#8985BB;} .input-image-url, .annotation span, .annotation i, diff -r ac4dc3d6400b -r 3246a70209f0 src/metadatacomposer/static/metadatacomposer/css/styles_player.css --- a/src/metadatacomposer/static/metadatacomposer/css/styles_player.css Tue Jun 18 15:51:39 2013 +0200 +++ b/src/metadatacomposer/static/metadatacomposer/css/styles_player.css Wed Jun 19 17:49:47 2013 +0200 @@ -696,7 +696,7 @@ } .chip-title { - position: absolute; top: 1px; left: 3px; font-size: 10px; line-height: 13px; height: 13px; + position: absolute; top: 0; left: 3px; font-size: 10px; line-height: 13px; height: 13px; font-weight: 700; display: block; width: 0; overflow: hidden; -webkit-transition: width 0.5s; @@ -746,7 +746,7 @@ .found .chip-circle { background: #ffffff; - border: 2px solid; left: -6px; top: 16px; width: 9px; height: 9px; + border: 2px solid; left: -6px; top: 14px; width: 9px; height: 9px; } .left-hiding-block, .right-hiding-block { diff -r ac4dc3d6400b -r 3246a70209f0 src/metadatacomposer/static/metadatacomposer/js/edition.js --- a/src/metadatacomposer/static/metadatacomposer/js/edition.js Tue Jun 18 15:51:39 2013 +0200 +++ b/src/metadatacomposer/static/metadatacomposer/js/edition.js Wed Jun 19 17:49:47 2013 +0200 @@ -4,7 +4,8 @@ currentChapter = undefined, currentAnnotation = undefined, currentSlider = undefined, - secMiniChapter = 10; + secMiniChapter = 10, + lengthStringDiapo = 40; /* Colors */ var annotationsColors = { @@ -220,7 +221,7 @@ $(document).on('click', '.project-title-editor i, .project-title', function () { - var html = $('.project-title').html(); + var html = myProject.title; var input = $(''); input.val(html); $('.project-title').replaceWith(input); @@ -448,7 +449,7 @@ myProject.getAnnotations().push(annotation); annotations.push(annotation); disabledPreview(); - + refreshAnnotationDisplay(myMedia.getCurrentTime()); return annotation; } @@ -486,7 +487,7 @@ case 'slideshow': content = { mimetype : "application/x-ldt-slideshow", - slideduration : 1000, + slideduration : 3000, autostart : false, images : [] }; @@ -606,6 +607,7 @@ closeTab(idAnnotation); renderAnnotation(); disabledPreview(); + refreshAnnotationDisplay(myMedia.getCurrentTime()); } /* Tab */ @@ -701,7 +703,7 @@ break; case 'slideshow': - console.log(currentAnnotation) + $(tabContent).find('.number-spin').val(dataView.content.slideduration/1000); $(tabContent).find('.number-spin').spin(spinParam); $(tabContent).find('.ui-sortable').sortable({ @@ -853,18 +855,28 @@ function addImageToSlideshow(slideshow, dataView){ var tplDiapo = getTemplate('#tpl-slideshow-row'); + dataView.limitLength = function(){ + return function(text, render) { + if(render(text).length > lengthStringDiapo){ + return render(text).substr(0,lengthStringDiapo) + '...'; + }else{ + return render(text); + } + } + } tplDiapo = Mustache.render(tplDiapo, dataView); slideshow.append(tplDiapo); disabledBtnSortable(slideshow); }; //edit - $('.tab-content').on('click', '.title-slideshow-row, .description-slideshow-row, .video-title-edit, .video-description-edit', function(){ + $('.tab-content').on('click', '.title-slideshow-row, .description-slideshow-row', function(){ if($(this).find('input').length) return; - var html = $(this).find('span').html(), + var index = $(this).parents('.row-image-slideshow').index(), inputType = $(this).attr('data-input'), name = $(this).attr('data-name'), - input = $('<'+inputType+'>').attr('name', name); + input = $('<'+inputType+'>').attr('name', name), + html = currentAnnotation.content.images[index][name]; input.val(html); $(this).find('span').replaceWith(input); input.focus().keypress(function(e){ @@ -876,19 +888,14 @@ $(document).on('blur', '.title-slideshow-row input, .description-slideshow-row textarea', function(){ var newValue = $(this).val(), name = $(this).attr('name'), - span = $('').html(newValue), indexRow = $(this).parents('.row-image-slideshow').index(); - $(this).replaceWith(span); currentAnnotation.content.images[indexRow][name] = newValue; - disabledPreview(); - }); - - $(document).on('blur', '.video-title-edit input, .video-description-edit textarea', function(){ - var newValue = $(this).val(), - name = $(this).attr('name'), - span = $('').html(newValue); + if(newValue.length>lengthStringDiapo){ + newValue = newValue.substr(0,lengthStringDiapo) + '...'; + } + var span = $('').html(newValue); $(this).replaceWith(span); - currentAnnotation.content[name] = newValue; + disabledPreview(); }); diff -r ac4dc3d6400b -r 3246a70209f0 src/metadatacomposer/static/metadatacomposer/js/player.js --- a/src/metadatacomposer/static/metadatacomposer/js/player.js Tue Jun 18 15:51:39 2013 +0200 +++ b/src/metadatacomposer/static/metadatacomposer/js/player.js Wed Jun 19 17:49:47 2013 +0200 @@ -295,6 +295,7 @@ slideInterval, playing = false, loaded = false, + currentSlideLoaded = false, slides = annotationinfo.annotation.content.images; var showCurrentImage = function() { @@ -347,11 +348,16 @@ if (loaded) { return; } + if (!currentSlideLoaded) { + if (!!slides[currentslide].image && !!slides[currentslide].image.height) { + currentSlideLoaded = true; + showCurrentImage(); + } + } loaded = slides.reduce(function(mem, slide) { return (mem && !!slide.image && !!slide.image.height); }, true); if (loaded) { - showCurrentImage(); if (annotationinfo.annotation.autostart && slides.length > 1) { togglePlay(); } diff -r ac4dc3d6400b -r 3246a70209f0 src/metadatacomposer/templates/metadatacomposer_edit.html --- a/src/metadatacomposer/templates/metadatacomposer_edit.html Tue Jun 18 15:51:39 2013 +0200 +++ b/src/metadatacomposer/templates/metadatacomposer_edit.html Wed Jun 19 17:49:47 2013 +0200 @@ -399,10 +399,10 @@ {% templatetag openvariable %}title{% templatetag closevariable %} - {% templatetag openvariable %}title{% templatetag closevariable %} + {% templatetag openvariable %}#limitLength{% templatetag closevariable %}{% templatetag openvariable %}title{% templatetag closevariable %}{% templatetag openvariable %}/limitLength{% templatetag closevariable %} - {% templatetag openvariable %}description{% templatetag closevariable %} + {% templatetag openvariable %}#limitLength{% templatetag closevariable %}{% templatetag openvariable %}description{% templatetag closevariable %}{% templatetag openvariable %}/limitLength{% templatetag closevariable %}