# HG changeset patch # User veltr # Date 1381336840 -7200 # Node ID b6e39f6fd24f84a3d8b4a3d3a406de839846b1a3 # Parent e1752b696a079343cac7d52b981a6d44821008ca Corrections diff -r e1752b696a07 -r b6e39f6fd24f src/widgets/Arrow.js --- a/src/widgets/Arrow.js Tue Oct 01 16:57:57 2013 +0200 +++ b/src/widgets/Arrow.js Wed Oct 09 18:40:40 2013 +0200 @@ -25,7 +25,6 @@ overflow: "hidden" }); this.paper = new Raphael(this.container, this.width, 1+this.height ); - window.myArrow = this; this.svgArrow = this.paper.path('M0,' + this.height + 'L' + this.width + ',' + this.height); this.svgArrow.attr({ stroke: this.stroke_color, diff -r e1752b696a07 -r b6e39f6fd24f src/widgets/Polemic.js --- a/src/widgets/Polemic.js Tue Oct 01 16:57:57 2013 +0200 +++ b/src/widgets/Polemic.js Wed Oct 09 18:40:40 2013 +0200 @@ -22,6 +22,7 @@ element_height : 5, max_elements: 20, annotation_type : "tweet", + only_allow_zero_duration_annotations: true, defaultcolor : "#585858", foundcolor : "#fc00ff", polemics : [ @@ -71,10 +72,14 @@ _slice_count = Math.floor( this.width / this.element_width ), _duration = this.source.getDuration(), _max = 0, - _list = this.getWidgetAnnotations().filter(function(_a) { + _this = this, + _list = this.getWidgetAnnotations(); + + if (this.only_allow_zero_duration_annotations) { + _list = _list.filter(function(_a) { return !_a.getDuration().milliseconds; - }), - _this = this; + }); + } for (var _i = 0; _i < _slice_count; _i++) { var _begin = new IriSP.Model.Time( _i * _duration / _slice_count ), @@ -140,12 +145,12 @@ return false; }); IriSP.attachDndData(_el, { - title: _annotation.title, - description: _annotation.description, - image: _annotation.thumbnail, - uri: (typeof _annotation.url !== "undefined" - ? _annotation.url - : (document.location.href.replace(/#.*$/,'') + '#id=' + _annotation.id)) + title: _annotation.title, + description: _annotation.description, + image: _annotation.thumbnail, + uri: (typeof _annotation.url !== "undefined" + ? _annotation.url + : (document.location.href.replace(/#.*$/,'') + '#id=' + _annotation.id)) }); _annotation.on("select", function() { if (_this.tooltip) { diff -r e1752b696a07 -r b6e39f6fd24f test/spel.htm --- a/test/spel.htm Tue Oct 01 16:57:57 2013 +0200 +++ b/test/spel.htm Wed Oct 09 18:40:40 2013 +0200 @@ -21,7 +21,7 @@ IriSP.libFiles.defaultDir = "libs/"; IriSP.widgetsDir = "metadataplayer"; var _metadata = { - url: "json/test-vecsys-filage-celestins.json", + url: "json/cinelab1.json", format: 'spel' }; var _config = { @@ -55,6 +55,7 @@ { type: "Polemic", annotation_type: "interpretation", + only_allow_zero_duration_annotations: false, polemics: [ { keywords: [ "performance d'un(e) comédien(ne)" ],