# HG changeset patch # User cavaliet # Date 1383827884 -3600 # Node ID 95fbb10db87e285d51809b44a10122949f89d5d0 # Parent 1d75a98a57b8f915e20f5c5531083f87074c9382 v1.51.11 : enhance mdp diff -r 1d75a98a57b8 -r 95fbb10db87e src/ldt/ldt/__init__.py --- a/src/ldt/ldt/__init__.py Thu Oct 31 17:03:25 2013 +0100 +++ b/src/ldt/ldt/__init__.py Thu Nov 07 13:38:04 2013 +0100 @@ -1,6 +1,6 @@ __all__ = ["VERSION", "get_version", "__version__"] -VERSION = (1, 51, 10, "final", 0) +VERSION = (1, 51, 11, "final", 0) def get_version(): diff -r 1d75a98a57b8 -r 95fbb10db87e src/ldt/ldt/static/ldt/metadataplayer/MultiSegments.js --- a/src/ldt/ldt/static/ldt/metadataplayer/MultiSegments.js Thu Oct 31 17:03:25 2013 +0100 +++ b/src/ldt/ldt/static/ldt/metadataplayer/MultiSegments.js Thu Nov 07 13:38:04 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 1d75a98a57b8 -r 95fbb10db87e src/ldt/ldt/static/ldt/metadataplayer/Polemic.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Polemic.js Thu Oct 31 17:03:25 2013 +0100 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Polemic.js Thu Nov 07 13:38:04 2013 +0100 @@ -146,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 1d75a98a57b8 -r 95fbb10db87e src/ldt/ldt/static/ldt/metadataplayer/Tooltip.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Tooltip.js Thu Oct 31 17:03:25 2013 +0100 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Tooltip.js Thu Nov 07 13:38:04 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(); }