158 this._Popcorn.listen("IriSP.search", IriSP.wrap(this, function(searchString) { this.searchHandler(searchString); })); |
158 this._Popcorn.listen("IriSP.search", IriSP.wrap(this, function(searchString) { this.searchHandler(searchString); })); |
159 this._Popcorn.listen("IriSP.search.closed", IriSP.wrap(this, this.searchFieldClosedHandler)); |
159 this._Popcorn.listen("IriSP.search.closed", IriSP.wrap(this, this.searchFieldClosedHandler)); |
160 this._Popcorn.listen("IriSP.search.cleared", IriSP.wrap(this, this.searchFieldClearedHandler)); |
160 this._Popcorn.listen("IriSP.search.cleared", IriSP.wrap(this, this.searchFieldClearedHandler)); |
161 this.selector.mouseleave(IriSP.wrap(this, function() { self.TooltipWidget.hide.call(self.TooltipWidget); })); |
161 this.selector.mouseleave(IriSP.wrap(this, function() { self.TooltipWidget.hide.call(self.TooltipWidget); })); |
162 this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.sliderUpdater)); |
162 this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.sliderUpdater)); |
|
163 this._Popcorn.listen("IriSP.Mediafragment.showAnnotation", IriSP.wrap(this, this.showAnnotation)); |
163 |
164 |
164 for(var i = 0; i < json.annotations.length; i++) { |
165 for(var i = 0; i < json.annotations.length; i++) { |
165 var item = json.annotations[i]; |
166 var item = json.annotations[i]; |
166 var MyTime = Math.floor(item.begin/duration*lineSize); |
167 var MyTime = Math.floor(item.begin/duration*lineSize); |
167 var Myframe = Math.floor(MyTime/lineSize*frameLength); |
168 var Myframe = Math.floor(MyTime/lineSize*frameLength); |
310 var e = this.paper.rect(x, y, frameSize - margin, TweetHeight /* height */) |
311 var e = this.paper.rect(x, y, frameSize - margin, TweetHeight /* height */) |
311 .attr({stroke:"#00","stroke-width":0.1, fill: colors[j]}); |
312 .attr({stroke:"#00","stroke-width":0.1, fill: colors[j]}); |
312 |
313 |
313 addEheight += TweetHeight; |
314 addEheight += TweetHeight; |
314 |
315 |
|
316 /* stick a lot of things into e because that's the easiest way |
|
317 to do it */ |
315 e.color = colors[j]; |
318 e.color = colors[j]; |
316 e.time = frames[i].mytweetsID[k].timeframe; |
319 e.time = frames[i].mytweetsID[k].timeframe; |
317 e.title = frames[i].mytweetsID[k].title; |
320 e.title = frames[i].mytweetsID[k].title; |
318 e.id = frames[i].mytweetsID[k].cinecast_id; |
321 e.id = frames[i].mytweetsID[k].cinecast_id; |
319 |
322 var pos = IriSP.jQuery(e.node).offset(); |
|
323 e.x = pos.left; |
|
324 e.y = pos.top; |
320 this.svgElements[e.id] = e; |
325 this.svgElements[e.id] = e; |
321 |
326 |
322 IriSP.jQuery(e.node).mouseenter(function(element) { return function (event) { |
327 IriSP.jQuery(e.node).mouseenter(function(element) { return function (event) { |
323 // event.clientX and event.clientY are to raphael what event.pageX and pageY are to jquery. |
328 // event.clientX and event.clientY are to raphael what event.pageX and pageY are to jquery. |
324 self.TooltipWidget.show.call(self.TooltipWidget, element.title, element.attr("fill"), event.pageX - 106, event.pageY - 160); |
329 self.TooltipWidget.show.call(self.TooltipWidget, element.title, element.attr("fill"), event.pageX - 106, event.pageY - 160); |