This Forum has been archived

Visit the new Forums
Forums: Index WoWWiki technical Tooltips overhaul

I've overhauled the hover tooltips to use jQuery, they are super-optimized now - performing the same functions in 1/10 the code length. Please let me know if you see any bugs. This means anyone who can edit the relevant "target page templates" can actually modify the layout of the tooltip. See my changes to the relevant templates if you have any questions about that. Also due to this, I have made it so now any user can create AJAX hover tooltips (non-AJAX tooltips could already be made with {{Quicktooltip}}) with any content (ok, there's probably some bug-inducing exceptions). Just use the following syntax on the calling page:

[[Example link|<span class="ajaxttlink">Link</span>]]

And on the target page just wrap whatever you want in:

<div class="tooltip-content">Example data</div>

Note that you can apply style="display:none;" to the target-page div (but you don't have to) and the JS will remove it when it puts it into the tooltip. Also note that multiple tooltips per target page seem to work, I haven't completely tested that "bonus feature" yet though.

A few things were removed:

  • The WoWWiki:Tooltips configuration page and retrieving cookie-based settings from there. The code to implement this was longer than the optimized tooltip generation code. Sorry. You can still customize it through JavaScript variables in your user JS. Ask me if you can't figure it out.
  • Along with that, granular control of what sort of tooltips are shown has been removed. With all the tooltips running through the same code it just doesn't make much sense anymore.
  • Category tooltips. The CategoryTree works pretty well now and I never used this feature, I don't know about anyone else. I can instruct you on how to implement this for yourself if you're going to miss this.
  • Code-handled caching. The browser does this pretty well anyway.
  • Really advanced error handling. I'm not sure the errors they covered even come up anymore but I'll be watching for them.
  • The loading tooltip. It's pretty fast, I'm not sure it needs it. Pretty sure I can implement it if anyone misses it.

Some quirks I've noticed:

  • Tooltip sizes aren't always consistent. It's not a huge deal to me - let me know if it messes up too bad though.
  • Tooltip moving/hide behavior isn't the same as before. As above, it's not huge, but probably could use a bit more tweaking.

Also the AJAX RC and the AJAX tables have been on jQuery for some time now, I haven't seen any bugs but here would be a good place to report those as well. Thanks. --PcjWoWWiki admin (TDrop me a line!C58,926 contributions and counting) 03:40, June 10, 2010 (UTC)

Nice work! Big thumbs up from me :) Kirkburn  talk  contr 18:31, June 10, 2010 (UTC)
Neat. Posted by: EGingell (T|C|F) Treader of Cenarion Circle 02:07, Jun 11, 2010 (UTC)

One more thing, since the code is now sub-4k in length I've moved it to MediaWiki:Common.js to further reduce page load time. --PcjWoWWiki admin (TDrop me a line!C58,926 contributions and counting) 01:12, June 12, 2010 (UTC)

Ability Template

The {{ability}} and {{item}} templates don't appear to be working right now. I don't know if it's because of this change or not (e.g. [Mend Pet], [Glyph of Mend Pet], etc.). Posted by: EGingell (T|C|F) Treader of Cenarion Circle 08:26, Jun 13, 2010 (UTC)

Sorry, fixed it. --PcjWoWWiki admin (TDrop me a line!C58,926 contributions and counting) 11:40, June 13, 2010 (UTC)

IE 8

Yeah, so it looks like since this change, on hovering over anything that would create a tooltip in IE8 I get an error that a script is unresponsive and to kill it. This is from several different computers (work and home) so I know it's not an internet/local issue or whatever. I figure I can't be the only one having this problem. I hope you guys test with IE and aren't just 'omg get Firefox!' people. --Windslice (talk) 16:22, June 14, 2010 (UTC)

    Posted by: EGingell (T|C|F) Treader of Cenarion Circle 01:51, Jun 15, 2010 (UTC)

    Those aren't directly related to my JavaScript (also incidentally I am not getting those errors). Rather, through my old error handling code, I was redirecting the errors from some of Wikia's script to code which only showed up for me, and now that's gone. I will see what I can do. --PcjWoWWiki admin (TDrop me a line!C58,926 contributions and counting) 02:08, June 15, 2010 (UTC)
    I'm not getting those errors. Not visibly anyway. What I'm getting is more like JavaScript going into a loop. Windslice (talk) 04:58, June 15, 2010 (UTC)
    My IE8 didn't crash. Perhaps it's an extension, a faulty install of IE8, or a specific tooltip? Posted by: EGingell (T|C|F) Treader of Cenarion Circle 07:12, Jun 15, 2010 (UTC)
    Yeah, IE8 is a bit slower than the others, not sure why since it's getting the same code... --PcjWoWWiki admin (TDrop me a line!C58,926 contributions and counting) 12:01, June 15, 2010 (UTC)
    OK, I patched in something that I hope is temporary. Let me know if you still have issues. --PcjWoWWiki admin (TDrop me a line!C58,926 contributions and counting) 02:02, June 16, 2010 (UTC)
    OK, removed the temporary patch and actually cleaned it up a bit. --PcjWoWWiki admin (TDrop me a line!C58,926 contributions and counting) 01:45, June 17, 2010 (UTC)

    Ad blocker interference detected!

    Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

    Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.