ignore tweets. no-popcorn
authorhamidouk
Fri, 02 Dec 2011 15:41:53 +0100
branchno-popcorn
changeset 393 54947acf2770
parent 392 ef4e6b0fec17
child 394 89a79a2c6014
ignore tweets.
src/js/widgets/annotationsWidget.js
--- a/src/js/widgets/annotationsWidget.js	Fri Dec 02 15:41:39 2011 +0100
+++ b/src/js/widgets/annotationsWidget.js	Fri Dec 02 15:41:53 2011 +0100
@@ -43,7 +43,17 @@
 
   var annotationMarkup = IriSP.templToHTML(IriSP.annotationWidget_template);
 	this.selector.append(annotationMarkup);
+  var view;
 
+  if (typeof(this._serializer._data.views) !== "undefined" && this._serializer._data.views !== null)
+     view = this._serializer._data.views[0];
+
+  var view_type = "";
+
+  if(typeof(view) !== "undefined" && typeof(view.annotation_types) !== "undefined" && view.annotation_types.length > 1) {
+          view_type = view.annotation_types[0];
+  }
+ 
   var annotations = this._serializer._data.annotations;
   var i;
   
@@ -52,16 +62,17 @@
     var begin = Math.round((+ annotation.begin) / 1000);
     var end = Math.round((+ annotation.end) / 1000);
 
+    if (view_type != "" && typeof(annotation.meta) !== "undefined" && typeof(annotation.meta["id-ref"]) !== "undefined"
+          && annotation.meta["id-ref"] != view_type) {
+        continue;
+    }
+
+
     var conf = {start: begin, end: end, 
                 onStart: 
                        function(annotation) { 
                         return function() { 
-                          /* we need it because we have to restore
-                             the display after displaying the contents
-                             of a tweet.
-                          */
-                          _this._currentAnnotation = annotation;
-                          _this.displayAnnotation(annotation); 
+                            _this.displayAnnotation(annotation); 
                           
                         } }(annotation),
                 onEnd: