src/widgets/Polemic.js
changeset 987 7b65bf78873a
parent 986 f9d51dd4a3fe
child 990 6a90c96f0b4c
equal deleted inserted replaced
986:f9d51dd4a3fe 987:7b65bf78873a
    17     }
    17     }
    18 }
    18 }
    19 IriSP.Widgets.Polemic.prototype.defaults = {
    19 IriSP.Widgets.Polemic.prototype.defaults = {
    20     element_width : 5,
    20     element_width : 5,
    21     element_height : 5,
    21     element_height : 5,
    22     max_elements : 15,
    22     max_elements: 20,
    23     annotation_type : "tweet",
    23     annotation_type : "tweet",
    24     defaultcolor : "#585858",
    24     defaultcolor : "#585858",
    25     foundcolor : "#fc00ff",
    25     foundcolor : "#fc00ff",
    26     polemics : [
    26     polemics : [
    27         {
    27         {
   135                     _annotation.trigger("click");
   135                     _annotation.trigger("click");
   136                 });
   136                 });
   137                 _annotation.on("select", function() {
   137                 _annotation.on("select", function() {
   138                     if (_this.tooltip) {
   138                     if (_this.tooltip) {
   139                         _this.tooltip.show(
   139                         _this.tooltip.show(
   140                             Math.floor(_elx + (_this.element_width - 1) / 2),
   140                             + Math.floor(_elx + (_this.element_width - 1) / 2),
   141                             _ely,
   141                             + _ely,
   142                             _annotation.title,
   142                             _annotation.title,
   143                             _col
   143                             _col
   144                         );
   144                         );
   145                     }
   145                     }
   146                     _this.$tweets.each(function() {
   146                     _this.$tweets.each(function() {
   270                 var _el = IriSP.jQuery(this),
   270                 var _el = IriSP.jQuery(this),
   271                     _nums = _el.attr("annotation-counts").split(","),
   271                     _nums = _el.attr("annotation-counts").split(","),
   272                     _html = '<p>' + _this.l10n.from_ + _el.attr("begin-time") + _this.l10n._to_ + _el.attr("end-time") + '</p>';
   272                     _html = '<p>' + _this.l10n.from_ + _el.attr("begin-time") + _this.l10n._to_ + _el.attr("end-time") + '</p>';
   273                 for (var _i = 0; _i <= _this.polemics.length; _i++) {
   273                 for (var _i = 0; _i <= _this.polemics.length; _i++) {
   274                     var _color = _i ? _this.polemics[_i - 1].color : _this.defaultcolor;
   274                     var _color = _i ? _this.polemics[_i - 1].color : _this.defaultcolor;
   275                     _html += '<div class="Ldt-Tooltip-Color" style="background: ' + _color + '"></div><p>' + _nums[_i] + _this.l10n._annotations + '</p>'
   275                     _html += '<div class="Ldt-Tooltip-AltColor" style="background: ' + _color + '"></div><p>' + _nums[_i] + _this.l10n._annotations + '</p>'
   276                 }
   276                 }
   277                 if (_this.tooltip) {
   277                 if (_this.tooltip) {
   278                     _this.tooltip.show(_el.attr("pos-x"), _el.attr("pos-y"), _html);
   278                     _this.tooltip.show(+ _el.attr("pos-x"), + _el.attr("pos-y"), _html);
   279                 }
   279                 }
   280             })
   280             })
   281             .mouseout(function() {
   281             .mouseout(function() {
   282                 if (_this.tooltip) {
   282                 if (_this.tooltip) {
   283                     _this.tooltip.hide();
   283                     _this.tooltip.hide();