Corrections
authorveltr
Wed, 09 Oct 2013 18:40:40 +0200
changeset 1017 b6e39f6fd24f
parent 1016 e1752b696a07
child 1018 de1e7cf6bfc4
Corrections
src/widgets/Arrow.js
src/widgets/Polemic.js
test/spel.htm
--- 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,
--- 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) {
--- 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)" ],