chimericdream / worldofpannotia.com

1 stars 0 forks source link

Add "item_type_tooltip" Jekyll tag #40

Open chimericdream opened 9 years ago

chimericdream commented 9 years ago

Useful for skills, feats, weapon/armor abilities, etc.

Bootply example

Example:

This:

{% magic_weapon_ability_tooltip keen %}

Produces this:

<a tabindex="0" role="button" data-toggle="popover" data-trigger="focus" data-placement="bottom" data-content-html="keen-popover-235125">Dismissible popover</a>
<span id="keen-popover-235125" style="display:none;">+1 bonus<br><br>This ability doubles the threat range of a weapon. Only piercing or slashing weapons can be keen. (If you roll this property randomly for an inappropriate weapon, reroll.) This benefit doesn't stack with any other effect that expands the threat range of a weapon (such as the <a href="keen-edge-link"><em>Keen Edge</em></a> spell or the <a href="improved-critical-link">Improved Critical</a> feat).<br><br><a href="keen-link">View full description</a></span>

This will require something like this in the header:

$(function () {
  $('[data-toggle="popover"]').popover({
    html: true,
    content: function() {
      var id = $(this).attr('data-content-html');
      return $('#' + id).html();
    }
  });
});