Javascript Tooltips - DarkTip

3 Night Elf Druid
0
08/28/2011 10:22 AMPosted by Kaelum
One thing that Rhileu forgot to mention is that when accessing the API from the user's client (browser), the request is counted against the user's daily limit and not those of the web host. The requests will come from the IP of the user that is making the request, not the server. So for those who were concerned about their daily limits, there is no need to be.


Yeah, that was one of the main reasons I started the project, btw. :-)
Reply Quote
87 Draenei Shaman
8095
If anyone wants to help me figure out what im doing wrong here. feel free.

gnb-guild.com/forum
inspect the <head> area with chrome or firebug. im getting odd errors no matter what i do. iv been trying to get this crap to work for hours.
Reply Quote
82 Human Death Knight
2425
08/28/2011 06:28 PMPosted by Morale
If anyone wants to help me figure out what im doing wrong here. feel free.

Looks like a few problems... I see that you're including css and js that the wdt code will do for you automatically... here's something similar to what I use:

<script type="text/javascript">
window.___WowDataTooltip_Config = {
'files': {
'jquery.js' : 'https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js',
'qtip2.js' : 'qtip2/jquery.qtip.min.js',
'qtip2.css' : 'qtip2/jquery.qtip.min.css',
'wdt.css' : 'wdt/WowDataTooltip.css'
},
'applyTo': {
'battlenet': true, // Set to false to disable automatic battle.net link tooltips
'explicit' : true // Set to false to disable explicit tooltips
},
'layout': {
'width': {
'realm' : 200, // Width of realm tooltips in pixels
'item' : 360, // Width of item tooltips in pixels
'character': 325, // Width of character tooltips in pixels
'guild' : 200 // Width of guild tooltips in pixels
}
},
'extras': {
'applyCssColorToCaller': false // Set to true to color the anchor element of any tooltip via css classes
}
};

</script>
<script type="text/javascript" src="wdt/WowDataTooltip.js"></script>


Note that I'm only explicitly including WowDataTooltip.js - I am, however, defining the paths to the other JS and CSS files in the script block above that... that should be all you need to do.
Reply Quote
87 Draenei Shaman
8095
wow... this works. THANKS!

i didnt have the config ontop.. that could have saved me a few hours.

say i wanted to link a guild name so it had a tool tip, on my forums. I cant do this because i have safe html only enabled on the forums, and the %20 (spaces) mess up the link. is there a way around this?
Edited by Morale on 8/28/2011 8:34 PM PDT
Reply Quote
85 Blood Elf Mage
2715
He actually did mention it :D

08/22/2011 03:15 PMPosted by Rhileu
These tooltips are purely javascript based, this means the user's browser will connect with Blizzard's new Community API and fetches the Data. This is especially nice, because every user will use his own IP to connect to the API.


It really is awesome.
Reply Quote
3 Night Elf Druid
0
Nice to see you got it working Morale. :-)

Also, I decided to switch over to Github yesterday. This should enable me to release builds faster and allows other Github users to contribute to the project very easily:

https://github.com/darkspotinthecorner/Wow-Data-Tooltip


News from the latest build:

- There is a new folder "wdt/locales/" that contains all non-"en_US" locales in seperate JS files.
- In the configuration you may specify what locales you want to load.
- The locale files are loaded async, just the way all the other files are, too.
- This way, you only need to include the locales you want, and save some bandwidth. ;-)
- Note that you may still create tooltips for locales you did not load. The tooltip will simply use the fallback locale "en_US" for all internal translations.


Happy tooltipping! :-P
Reply Quote
10 Tauren Hunter
20
Hey guys,

I'm pretty new to all this so not sure if this is obvious or not :)

Once the item api is fully released and functional will the tooltips be able to show an item with gems and enchants? If so how would this be done?

Thanks for the superb tooltips Rhileu and sorry I missed the thread on the EU forums (another EU poster here hehe)

Reply Quote
87 Draenei Shaman
8095
Does the script stop running after a period of time. iv been noticing that after a while it just.. stops showing tool tips.

also, any idea if theres a fix to my problem i posted up top?
Reply Quote
3 Night Elf Druid
0
Hey guys,

I'm pretty new to all this so not sure if this is obvious or not :)

Once the item api is fully released and functional will the tooltips be able to show an item with gems and enchants? If so how would this be done?

Thanks for the superb tooltips Rhileu and sorry I missed the thread on the EU forums (another EU poster here hehe)


Heh, you are welcome. Don't worry about the EU forums. There really isn't any kind of API related forum there, so it's really easy to miss. ;-)

Yes, I do plan to add Tooltips for items that are worn by characters. Since there won't be battle.net links for those, I suppose it would look like this:

<span data-wowdatatooltip="item:{region}.{realm}.{character}.{slot}({language})">Some text</span>

Does the script stop running after a period of time. iv been noticing that after a while it just.. stops showing tool tips.

also, any idea if theres a fix to my problem i posted up top?


No, the script should not stop running... ;-)
Do you have a link where I can reproduce that behavior?

About %20 in the Links: If your forum does not allow these in URLs then it's an issue related to your forum software. However, have you tried inserting regular whitespaces instead of %20?
Reply Quote
85 Goblin Mage
11120
Installed this on my new site this weekend. http://www.wowah.org/realm/azshara
Click on a faction then hover over someones name.
I'm still using Wowhead's JS for item tooltips.

IE8 (and maybe older) People. There's a JS error in Flexigrid that will give a "Stack overflow" error. I don't get this in IE9 though.

I'm still looking around for other jQuery Grid/table style systems. Flexigrid is nice but seems to be on the slow side.
Reply Quote
82 Human Death Knight
2425
I'm still looking around for other jQuery Grid/table style systems. Flexigrid is nice but seems to be on the slow side.


Check out Datatables.net - I've used that plugin on a handful of different sites... it's one of the very best jQuery plugins I've ever used.
Reply Quote
3 Night Elf Druid
0
New build is up on Github (see what i did there? :-P)

New "official" plugin repository: https://github.com/darkspotinthecorner/Wow-Data-Tooltip

Some of you asked for the possibility to inject custom template code without the need to modify the core files, that's in now.

Also in now: the ability to override the api call urls. This enables you to direct the tooltip data fetching routines to your own server side caching script, if you really want to... ^^

I started to populate the wiki on Github with info on how to use the config of the plugin: https://github.com/darkspotinthecorner/Wow-Data-Tooltip/wiki

Please let me know what you think! :-)
Reply Quote
87 Draenei Shaman
8095
Hey guys,

I'm pretty new to all this so not sure if this is obvious or not :)

Once the item api is fully released and functional will the tooltips be able to show an item with gems and enchants? If so how would this be done?

Thanks for the superb tooltips Rhileu and sorry I missed the thread on the EU forums (another EU poster here hehe)


Heh, you are welcome. Don't worry about the EU forums. There really isn't any kind of API related forum there, so it's really easy to miss. ;-)

Yes, I do plan to add Tooltips for items that are worn by characters. Since there won't be battle.net links for those, I suppose it would look like this:

<span data-wowdatatooltip="item:{region}.{realm}.{character}.{slot}({language})">Some text</span>

Does the script stop running after a period of time. iv been noticing that after a while it just.. stops showing tool tips.

also, any idea if theres a fix to my problem i posted up top?


No, the script should not stop running... ;-)
Do you have a link where I can reproduce that behavior?

About %20 in the Links: If your forum does not allow these in URLs then it's an issue related to your forum software. However, have you tried inserting regular whitespaces instead of %20?


To reproduce this, go to http://gnb-guild.com/forum and make an account. let me know when you do this and ill bump your access up to member so you can see the shout box. Im 100% sure its an issue with the shoutbox im using, so theres prolly nothing you can really do.

Also, adding in bland spaces in the URL breaks it, as in it stops reading the URL at the space. so..

http://us.battle.net/wow/en/guild/antonidas/Goliath National Bank/
The forums read this as..
http://us.battle.net/wow/en/guild/antonidas/Goliath
Reply Quote
3 Night Elf Druid
0
08/31/2011 07:04 PMPosted by Morale
To reproduce this, go to http://gnb-guild.com/forum and make an account. let me know when you do this and ill bump your access up to member so you can see the shout box.


Done, Username: "Rhil" :-)

Also, adding in bland spaces in the URL breaks it, as in it stops reading the URL at the space. so..

<a href="http://us.battle.net/wow/en/guild/antonidas/Goliath">http://us.battle.net/wow/en/guild/antonidas/Goliath</a> National Bank/
The forums read this as..
<a href="http://us.battle.net/wow/en/guild/antonidas/Goliath">http://us.battle.net/wow/en/guild/antonidas/Goliath</a>


Ah, so we're talking about implicit url to link conversion. Yep, in that case the params need to be escaped, or course. You would either need to adjust the filtering to allow for %20 (and other url-escaped sequences) or enter the urls explicitly.

/cheers :-)
Edited by Rhileu on 8/31/2011 11:46 PM PDT
Reply Quote
87 Draenei Shaman
8095
You should be able to view the shout box now. simply enter a URL into it, and wait a bit. After a few minutes it stops functioning. This only happens with the shout box, so it has to be a problem with the shout box itself.
Reply Quote
3 Night Elf Druid
0
09/01/2011 01:26 PMPosted by Morale
You should be able to view the shout box now. simply enter a URL into it, and wait a bit. After a few minutes it stops functioning. This only happens with the shout box, so it has to be a problem with the shout box itself.


I'm unable to reproduce the behavior, both in Chrome 10 (Mac) and Firefox 6 (Mac). However i stumbled across this one here:

https://github.com/Craga89/qTip2/issues/225
(qTip2 is the tooltip lib I'm using for my lib)

So this may be related to FF6 or to the current qTip2 build. I suppose it will be fixed soon.
Reply Quote
3 Night Elf Druid
0
Quick notification - I just committed a new build to Github:

Version: 1.3.4 (I'm also doing version numbering now)

IMPORTANT: You must change your config to the new "resource" format for included files if you update to this version:

<script type="text/javascript">
window.___WowDataTooltip_Config = {
'resources':{
'locales':'wdt/locales/', // WowDataTooltip locale dir
'jquery':'https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js', // The jQuery library
'qtip2':[
'qtip2/jquery.qtip.min.js', // qTip2 javascript lib
'qtip2/jquery.qtip.min.css' // qTip2 css styles
],
'extras':[
'wdt/WowDataTooltip.css' // WowDataTooltip css styles
]
}
};
</script>



  • Files to include async are now specified in a different way, CONFIG MUST BE UPDATED! /yell ^^

  • Advanced options now also allow to override data validation functions

  • Item Binds-To-Battlenet-Account is now in (dirty checking of quality==7)


Download here: https://github.com/darkspotinthecorner/Wow-Data-Tooltip/archives/master

Documentation of the new config options can be found in the wiki:
Here: https://github.com/darkspotinthecorner/Wow-Data-Tooltip/wiki/Config%3A-Basic
And here: https://github.com/darkspotinthecorner/Wow-Data-Tooltip/wiki/Config%3A-Advanced
Edited by Rhileu on 9/2/2011 5:53 AM PDT
Reply Quote
3 Night Elf Druid
0
Hi there, I've been busy rewriting the whole Tooltip library the last few days.

I decided to build it in a far more generic way and enable users to write modules that plug into the lib to generate individual tooltips.

The core is called "DarkTip" and I already wrote the modules that behave exactly like the Tooltips from WowDataTooltip.

The documentations is still missing / lagging behind, but if you want to dig into the code you can do so here: https://github.com/darkspotinthecorner/DarkTip

To get a basic idead of how the module system works you may look at "wow.js" and "wow.item.js" inside the "modules" subdirectory: https://github.com/darkspotinthecorner/DarkTip/tree/master/modules

I will update here as soon as a new feature is added and/or the documentation get's an update. ;-)
Reply Quote
3 Night Elf Druid
0
I've added a new module to DarkTip: Character PvP Tooltips.

This is another Tooltip using the Character Community API and the first one that has an overlapping implicit trigger...

Sounds confusing? Let me explain:

The implicit trigger for character tooltips is a html element with an href attribute pointing to:
http://{server}/wow/{language}/character/{realm}/{character}{/ or #}{whatever}

Now, the character pvp tooltip will operate on this implicit trigger:
http://{server}/wow/{language}/character/{realm}/{character}/pvp{whatever}

As you can see, any url that matches the character pvp tooltip trigger will also match the character trigger.

To prevent tooltips from overriding each other, Darktip will only apply the first found tooltip trigger and discard any following ones.

Triggers are registered in the reverse loading order. This is because you need to have the parent modules loaded in order to load the submodules, but the submodules are prone to register more specific triggers. Therefore the triggers are registered in reverse order, so the module registered last wins. :-)


You may see it in action here: http://darkspotinthecorner.github.com/DarkTip/
Or download the latest build here: https://github.com/darkspotinthecorner/DarkTip/archives/master

Have a nice one! :-)
Edited by Rhileu on 9/13/2011 6:24 AM PDT
Reply Quote
3 Night Elf Druid
0
Added "fr_FR" localization.

Also added some Youtube tooltips that connect to the Youtube API to display auto-starting flash videos if you hover over any direct youtube video link.

Of course this is super annoying and just a proof of concept. The module should not be loaded unless you really want it. :-P
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)

Reported!

[Close]