src/js/widgets/segmentsWidget.js
branchpopcorn-port
changeset 148 5e877acd85ca
parent 139 ba2b3c15bd47
child 152 5950ab2855a8
--- a/src/js/widgets/segmentsWidget.js	Wed Oct 26 11:32:21 2011 +0200
+++ b/src/js/widgets/segmentsWidget.js	Wed Oct 26 12:40:24 2011 +0200
@@ -6,6 +6,7 @@
 
 IriSP.SegmentsWidget.prototype.draw = function() {
 
+  var self = this;
   var annotations = this._serializer._data.annotations;
   
   var i = 0;
@@ -62,9 +63,15 @@
                 };
     this._Popcorn = this._Popcorn.code(conf);
   }
+  
+  this._Popcorn.listen("IriSP.search", function(searchWord) { self.searchHandler.call(self, searchWord); });
 };
 
 IriSP.SegmentsWidget.prototype.clickHandler = function(annotation) {
   var begin = Math.round((+ annotation.begin) / 1000);
   this._Popcorn.currentTime(begin)
 };
+
+IriSP.SegmentsWidget.prototype.searchHandler = function(searchWord) {
+  console.log("received" + searchWord);
+};