See http://drupal.org/node/122535#comment-209720

Footnotes could use hover tips module instead of title attribute. In fact, I was looking for something like this when creating it, but didn't look har enough I guess.

Nice task for someone the next time you have some extra hacking time to spare...

Comments

beginner’s picture

you mean this:
http://p4.sme-ccppd.org/beta.soundandmusiccomputing.org/node/598
(hover over the [1])

It's nice, but it works only with javascript on. The current tooltip solution is low key and works everywhere. A more elaborate solution could be adopted, but it would need to degrade well to that the tooltip like the current one would still work when there is no javascript. And the two solutions must 'cooperate' (i.e. not have the two tooltips appear at the same time).

hingo’s picture

Of course. I didn't look at the hover tips module yet, but that is something that of course we would expect from it.

(But good that you brought it up, in case someone reads this and starts doing something.)

hingo’s picture

Title: Add support for using hover tips module » Add support for using hover tips module... not?
Status: Active » Closed (won't fix)

I've now had a look at the hovertip module at http://drupal.org/project/hovertip

On a quick glance, it seems it depends on sending invalid html to the browser. The functionality is based on JavaScript that uses custom html element attributes:

This is an example of a <span hovertip=htdef>hovertip</span> (seen in a page that uses hovertip)

As such, I will not integrate this into Footnotes. (It should be noted, that there definitively is a way to implement the exact same hovertip functionality without relying on invalid html. Not to mention that the author even seems to be sloppy with remembering the quotes around attribute values in his own examples...)

wayland76’s picture

Just so I understand, would this be class="hovertip-htdef" or something?

hingo’s picture

Hi Wayland

The example link from hovertip project page http://drupal.org/project/hovertip leads to http://www.dave-cohen.com/node/1186

From there:

<p>The text shown in <span hovertip="italic">italics</span> are examples of <span hovertip="htdef">hovertips</span>.  Move your mouse over the <span hovertip=italic>italic</span> text to see what happens.
<div class=hovertip id=italic>
Text like this appears when you hover.
And disappears after you move your mouse away.
</p>

There are several problems with incorrect html here

  1. span element has "hovertip" as attribute name! You cannot invent your own attributes in html.
  2. There is a div tag inside a p tag, this is not allowed in html.
  3. A minor problem is that some of the attribute values lack quotes (I believe this is what you're asking). That is of course easily fixed by adding the quotes back.

When I had a brief look it seemed like the javascript code in hovertip depends on these erroneous uses of html, so one would have to make some changes to the code to get away from these problems. But it is certainly possible to do the same thing the right way, in case you are interested to try.

wayland76’s picture

I can see the answers to problems 2 and 3, but I'm afraid I don't see how to do problem 1 the right way :).

hingo’s picture

Wayland,

for #1, consider using <span class="hovertip"> and then searching for that from javascript. You should be able to get all the same results as now, but with valid html.

Then to get the italics (or whatever formatting you want), use css:

.hovertip {
  font-style: italic;
}

Btw, are you the author of Hovertip?

wayland76’s picture

No, I'm not, but hopefully I can help get the right information to the right places :).

Anonymous’s picture

Component: Footnotes.module » Footnotes

It appears that the hovertips module *can* be made to produce valid HTML (instead of that awful junk). See the comment titled "Can be valid" on http://www.dave-cohen.com/node/1186 . Why it does not do this by default I did not understand clearly.

If I do an integration that works and produces valid HTML, and provide a patch, would it get committed into the dev version? (Subject to code review and so forth.)

hingo’s picture

I'm open to including it, yes.