# HG changeset patch # User cavaliet # Date 1383827741 -3600 # Node ID 418a12ee972f73ca145d2c17847f849ab166bcea # Parent 73ade123e5c183b07ff58c0c5996ebad21796843 modif mdp diff -r 73ade123e5c1 -r 418a12ee972f web/lib/metadataplayer/MultiSegments.js --- a/web/lib/metadataplayer/MultiSegments.js Wed Nov 06 19:21:12 2013 +0100 +++ b/web/lib/metadataplayer/MultiSegments.js Thu Nov 07 13:35:41 2013 +0100 @@ -6,7 +6,7 @@ IriSP.Widgets.MultiSegments.prototype.defaults = { annotation_show_arrow: true, - annotation_start_minimized: true, + annotation_start_minimized: false, annotation_show_annotation_type: true, show_all: false }; diff -r 73ade123e5c1 -r 418a12ee972f web/lib/metadataplayer/Polemic.js --- a/web/lib/metadataplayer/Polemic.js Wed Nov 06 19:21:12 2013 +0100 +++ b/web/lib/metadataplayer/Polemic.js Thu Nov 07 13:35:41 2013 +0100 @@ -67,13 +67,12 @@ this.$zone.append(this.$elapsed); + // we don't filter with null duration anymore var _slices = [], _slice_count = Math.floor( this.width / this.element_width ), _duration = this.source.getDuration(), _max = 0, - _list = this.getWidgetAnnotations().filter(function(_a) { - return !_a.getDuration().milliseconds; - }), + _list = this.getWidgetAnnotations(), _this = this; for (var _i = 0; _i < _slice_count; _i++) { @@ -147,13 +146,21 @@ ? _annotation.url : (document.location.href.replace(/#.*$/,'') + '#id=' + _annotation.id)) }); + // test if annotation has several colors. + var colAr = []; + for (var _j = 0; _j < _this.polemics.length; _j++) { + if( IriSP.Model.regexpFromTextOrArray( _this.polemics[_j].keywords ).test( _annotation.title ) ){ + colAr.push(_this.polemics[_j].color); + } + } + // display annotation _annotation.on("select", function() { if (_this.tooltip) { _this.tooltip.show( + Math.floor(_elx + (_this.element_width - 1) / 2), + _ely, _annotation.title, - _col + ( (colAr.length>1) ? colAr : _col ) ); } _this.$tweets.each(function() { diff -r 73ade123e5c1 -r 418a12ee972f web/lib/metadataplayer/Tooltip.js --- a/web/lib/metadataplayer/Tooltip.js Wed Nov 06 19:21:12 2013 +0100 +++ b/web/lib/metadataplayer/Tooltip.js Thu Nov 07 13:35:41 2013 +0100 @@ -41,7 +41,21 @@ IriSP.Widgets.Tooltip.prototype.show = function(x, y, text, color) { if (typeof color !== "undefined") { - this.$.find(".Ldt-Tooltip-Color").show().css("background-color", color); + // one color or array of colors + if (typeof color === "string") { + this.$.find(".Ldt-Tooltip-Color").html(""); + this.$.find(".Ldt-Tooltip-Color").show().css("background-color", color); + this.$.find(".Ldt-Tooltip-Color").show().css("height", ""); + } + else{ + var d = this.$.find(".Ldt-Tooltip-Color"); + d.html(""); + d.show(); + for(var i=0; i') + } + this.$.find(".Ldt-Tooltip-Color").css("height", (color.length * 10) + "px"); + } } else { this.$.find(".Ldt-Tooltip-Color").hide(); }