Files @ 441df63ee7cc
Branch filter:

Location: Copyleft/guide/js/tex4ht-footnote-hack.js

bkuhn
Hack tex4ht's overlib stuff to use jQuery tooltip

tex4ht supports "overlib" for footnote popups. The hack is pretty
straightforward; it dumps a Javascript area into a .js file that can
then be used by overlib to popup stuff.

This hack is to use that output to make the same thing work with jQuery
UI's tooltip widget.

Note that we run with overlib support first, then *without* it in the
Makefile setup. This is to force the needed .js file to be generated,
but make sure the HTML doesn't try to load overlib (which is default).

(This should be adapted as a patch to upstream tex4ht ultimately.)

Also included herein are improvements to the Makefile to build the HTML
output.
//  Released as CC0: http://creativecommons.org/publicdomain/zero/1.0/
//   by Bradley M. Kuhn <bkuhn@ebb.org>

$(function() {
$( ".footnote-mark" ).tooltip({
    items: "a",
    hide: { duration: 5000 },
    position: {
        my: "center bottom-20",
        at: "center left",
        using: function( position, feedback ) {
            $( this ).css( position );
            $( "<div>" )
                .addClass( "arrow" )
                .addClass( feedback.vertical )
                .addClass( feedback.horizontal )
                .appendTo( this );
        }
    },
    content: function() {
        var element = $( this );
        if ( element.is( 'a' ) ) {
            var footnoteVal = element.attr( "href" );
            return tex4ht[footnoteVal.substring(footnoteVal.search("#") + 1)];
        }
    }});
});
// $(function() {
// $( document ).tooltip({
// content: function() {
//     var element = $( this );
//     return "HI";
// }});});