# HG changeset patch # User veltr # Date 1359393446 -3600 # Node ID 6a90c96f0b4c6a9427380180e10ebb6b6da9ae80 # Parent 458e9754d1cf1e3175d0f2b35bd7774e50597d66 Improvements on traces diff -r 458e9754d1cf -r 6a90c96f0b4c src/widgets/Polemic.js --- a/src/widgets/Polemic.js Fri Jan 25 18:47:43 2013 +0100 +++ b/src/widgets/Polemic.js Mon Jan 28 18:17:26 2013 +0100 @@ -113,7 +113,7 @@ function displayAnnotation(_elx, _ely, _pol, _col, _annotation) { var _html = Mustache.to_html( - '
', { id: _annotation.id, @@ -124,7 +124,8 @@ color: _col, width: (_this.element_width-1), height: _this.element_height, - title: _annotation.title + title: _annotation.title, + time: _annotation.begin.toString() }); var _el = IriSP.jQuery(_html); _el.mouseover(function() { diff -r 458e9754d1cf -r 6a90c96f0b4c src/widgets/Segments.js --- a/src/widgets/Segments.js Fri Jan 25 18:47:43 2013 +0100 +++ b/src/widgets/Segments.js Mon Jan 28 18:17:26 2013 +0100 @@ -22,7 +22,7 @@ + ''; IriSP.Widgets.Segments.prototype.annotationTemplate = - '' @@ -83,7 +83,9 @@ top: _top, height: _this.line_height - 1, id : _annotation.id, - media_id : _annotation.getMedia().id + media_id : _annotation.getMedia().id, + from: _annotation.begin.toString(), + to: _annotation.end.toString() }; var _html = Mustache.to_html(_this.annotationTemplate, _data), _el = IriSP.jQuery(_html); diff -r 458e9754d1cf -r 6a90c96f0b4c src/widgets/Trace.js --- a/src/widgets/Trace.js Fri Jan 25 18:47:43 2013 +0100 +++ b/src/widgets/Trace.js Mon Jan 28 18:17:26 2013 +0100 @@ -29,6 +29,10 @@ "play" : 0, "pause" : 0, "timeupdate" : 10000 + }, + _annlisteners = { + search: 0, + "search-cleared": 0 }; IriSP._(_medialisteners).each(function(_ms, _listener) { var _f = function(_arg) { @@ -39,6 +43,16 @@ } _this.media.on(_listener, _f); }); + var _annotations = this.source.getAnnotations(); + IriSP._(_annlisteners).each(function(_ms, _listener) { + var _f = function(_arg) { + _this.eventHandler(_listener, _arg); + } + if (_ms) { + _f = IriSP._.throttle(_f, _ms); + } + _annotations.on(_listener, _f); + }); if (!this.tracer) { @@ -51,6 +65,8 @@ } + + this.tracer.trace("TraceWidgetInit", {}); this.mouseLocation = ''; @@ -60,8 +76,6 @@ var _widget = _target.attr("widget-type") || _target.parents(".Ldt-Widget").attr("widget-type"), _data = { "type": _e.type, - "x": _e.clientX, - "y": _e.clientY, "widget": _widget }, _targetEl = _target[0],