Spells/Tooltips

* implemented 'know'-parameter (modifies tooltips based on known spells)
  * displayed on spell detail page
  * usale as urlParam (&know=<spellId>) or rel-attribute (rel="know=<spellId>)
This commit is contained in:
Sarjuuk
2015-07-18 12:58:01 +02:00
parent 111e53aaef
commit 3e7a34a2ea
3 changed files with 170 additions and 119 deletions

View File

@@ -1489,7 +1489,7 @@ $WH.g_setTooltipLevel = function(tooltip, level) {
$WH.g_setTooltipSpells = function(tooltip, spells, spellData, position) {
var
known = {},
regex = '<!--sp([0-9]+):[01]-->.+?<!--sp\\1-->',
regex = '<!--sp([0-9]+):[01]-->.*?<!--sp\\1-->',
effects;
if (spells == null) {
@@ -1521,7 +1521,7 @@ $WH.g_setTooltipSpells = function(tooltip, spells, spellData, position) {
}
var effect = spellData[spellId][position[spellId]][known[spellId]];
effect = $WH.g_setTooltipSpells(effect, spells, spellData, position);
effect = $WH.g_setTooltipSpells(effect.toString(), spells, spellData, position);
tooltip = tooltip.replace(effects[i], '<!--sp' + spellId + ':' + known[spellId] + '-->' + effect + '<!--sp' + spellId + '-->');
}