# HG changeset patch # User cavaliet # Date 1415120743 -3600 # Node ID 2cbb2d67319d7a757bcc504f423dbb693ef6502b # Parent 62e750c7ef85490f81dc84f768ba57a953b80d6a better polemic mdp config diff -r 62e750c7ef85 -r 2cbb2d67319d src/spel/static/spel/metadataplayer/Polemic.js --- a/src/spel/static/spel/metadataplayer/Polemic.js Tue Nov 04 15:03:00 2014 +0100 +++ b/src/spel/static/spel/metadataplayer/Polemic.js Tue Nov 04 18:05:43 2014 +0100 @@ -24,6 +24,7 @@ annotation_type : "tweet", defaultcolor : "#585858", foundcolor : "#fc00ff", + search_by_default: true, polemics : [ { "name" : "OK", @@ -87,9 +88,9 @@ }), polemicStacks : [] }; - + for (var _j = 0; _j < this.polemics.length; _j++) { - var _polemic = _res.annotations.searchByDescription(this.polemics[_j].keywords); + var _polemic = this.search_by_default ? _res.annotations.searchByDescription(this.polemics[_j].keywords) : _res.annotations.searchByTextFields(this.polemics[_j].keywords); _count += _polemic.length; _res.polemicStacks.push(_polemic); } @@ -148,11 +149,12 @@ }); // 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); - } + for (var _j = 0; _j < _this.polemics.length; _j++) { + if( IriSP.Model.regexpFromTextOrArray( _this.polemics[_j].keywords ).test( this.search_by_default ? _annotation.title : _annotation.getTagTexts()) ){ + colAr.push(_this.polemics[_j].color); + } } + // display annotation _annotation.on("select", function() { if (_this.tooltip) { diff -r 62e750c7ef85 -r 2cbb2d67319d src/spel/templates/spel_demonstrateur.html --- a/src/spel/templates/spel_demonstrateur.html Tue Nov 04 15:03:00 2014 +0100 +++ b/src/spel/templates/spel_demonstrateur.html Tue Nov 04 18:05:43 2014 +0100 @@ -9,7 +9,7 @@