diff -r b6b48e73d440 -r eb7e39c732c6 web/res/metadataplayer/Polemic.js --- a/web/res/metadataplayer/Polemic.js Tue Jul 24 18:01:16 2012 +0200 +++ b/web/res/metadataplayer/Polemic.js Wed Jul 25 18:03:07 2012 +0200 @@ -25,18 +25,22 @@ foundcolor : "#fc00ff", polemics : [ { + "name" : "OK", "keywords" : [ "++" ], "color" : "#1D973D" }, { + "name" : "KO", "keywords" : [ "--" ], "color" : "#CE0A15" }, { + "name" : "REF", "keywords" : [ "==", "http://" ], "color" : "#C5A62D" }, { + "name" : "Q", "keywords" : [ "?" ], "color" : "#036AAE" } @@ -144,12 +148,14 @@ var _x = 0, _html = ''; - function displayElement(_x, _y, _color, _id, _title) { + function displayElement(_x, _y, _color, _id, _title, _polemic) { _html += Mustache.to_html( - '
', { id: _id, + media_id: _this.source.currentMedia.id, + polemic: _polemic, title: _title, posx: Math.floor(_x + (_this.element_width - 1) / 2), left: _x, @@ -164,13 +170,14 @@ var _y = _this.height; _slice.annotations.forEach(function(_annotation) { _y -= _this.element_height; - displayElement(_x, _y, _this.defaultcolor, _annotation.id, _annotation.title); + displayElement(_x, _y, _this.defaultcolor, _annotation.id, _annotation.title, "none"); }); IriSP._(_slice.polemicStacks).forEach(function(_annotations, _j) { - var _color = _this.polemics[_j].color; + var _color = _this.polemics[_j].color, + _polemic = _this.polemics[_j].name; _annotations.forEach(function(_annotation) { _y -= _this.element_height; - displayElement(_x, _y, _color, _annotation.id, _annotation.title); + displayElement(_x, _y, _color, _annotation.id, _annotation.title, _polemic); }); }); _x += _this.element_width; @@ -215,13 +222,15 @@ _html = '', _scale = this.max_elements * this.element_height / _max; - function displayStackElement(_x, _y, _h, _color, _nums, _begin, _end) { + function displayStackElement(_x, _y, _h, _color, _nums, _begin, _end, _polemic) { _html += Mustache.to_html( - '
', { nums: _nums, posx: Math.floor(_x + (_this.element_width - 1) / 2), + media_id: _this.source.currentMedia.id, + polemic: _polemic, left: _x, top: _y, color: _color, @@ -240,14 +249,15 @@ if (_slice.annotations.length) { var _h = Math.ceil(_scale * _slice.annotations.length); _y -= _h; - displayStackElement(_x, _y, _h, _this.defaultcolor, _nums, _slice.begin, _slice.end); + displayStackElement(_x, _y, _h, _this.defaultcolor, _nums, _slice.begin, _slice.end, "none"); } IriSP._(_slice.polemicStacks).forEach(function(_annotations, _j) { if (_annotations.length) { var _color = _this.polemics[_j].color, + _polemic = _this.polemics[_j].name, _h = Math.ceil(_scale * _annotations.length); _y -= _h; - displayStackElement(_x, _y, _h, _color, _nums, _slice.begin, _slice.end); + displayStackElement(_x, _y, _h, _color, _nums, _slice.begin, _slice.end, _polemic); } }); _x += _this.element_width;