diff -r aa85db611fb7 -r 475e5fb0ea2b integration/js/editor.js --- a/integration/js/editor.js Wed Nov 28 15:46:05 2012 +0100 +++ b/integration/js/editor.js Wed Nov 28 17:21:26 2012 +0100 @@ -9,11 +9,6 @@ url_params: _({}).extend(options.filter), serializer: IriSP.serializers.content }), -/* project = directory.remoteSource({ - url: options.url, - serializer: IriSP.serializers.medialist - }), -*/ mashup = new IriSP.Model.Mashup(false, project), mediatemplate = _.template( '
  • ' @@ -655,6 +650,21 @@ return false; }); + $(".mashup-frise").click(function(evt) { + if (!mashup.duration.milliseconds) { + return; + } + var el = $(this), t = ( evt.pageX - el.offset().left ) * mashup.duration / el.width(), segment = mashup.getAnnotationAtTime(t); + if (segment) { + if (currentMedia === mashup) { + project.trigger("click-annotation", segment.annotation); + } else { + currentSegment = segment.annotation; + setMedia(currentSegment.getMedia()); + } + } + }); + /* Tangles */ var tangleMsPerPixel = 100, activeTangle, @@ -858,6 +868,8 @@ postproject.modified = new Date(); postproject.title = mashup.title; postproject.description = mashup.description; + var waitscreen = $('
    '); + waitscreen.appendTo('body'); $.ajax({ type: "POST", url: IriSP.endpoints.project, @@ -874,11 +886,10 @@ document.location.href = destination; }, error: function(jqXHR, textStatus, errorThrown){ - console.log(arguments); alert(IriSP.translate("Server error\nYour hashcut couldn't be published")); + waitscreen.remove(); } }); - //TODO: ADD WAITING SCREEN return false; });