src/js/widgets/annotationsWidget.js
branchpopcorn-port
changeset 538 b778b2f93ef4
parent 493 f7333cdf5320
child 541 f7667a1dde8e
--- a/src/js/widgets/annotationsWidget.js	Wed Dec 28 11:38:30 2011 +0100
+++ b/src/js/widgets/annotationsWidget.js	Wed Dec 28 12:03:29 2011 +0100
@@ -54,17 +54,9 @@
 
   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 legal_ids = this._serializer.getNonTweetIds();
+  
   var annotations = this._serializer._data.annotations;
   var i;
   
@@ -73,8 +65,8 @@
     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) {
+    if (typeof(annotation.meta) !== "undefined" && typeof(annotation.meta["id-ref"]) !== "undefined"
+          && !IriSP.underscore.include(legal_ids, annotation.meta["id-ref"])) {
         continue;
     }