/* Cross-browser tooltip support for MediaWiki. Author:, March 2008 License: Quadruple licensed GFDL, GPL, LGPL and Creative Commons Attribution 3.0 (CC-BY-3.0) Choose whichever license of these you like best :-)
Based on ideas gleaned from prototype.js and prototip.js. http://www.prototypejs.org/ http://www.nickstakenburg.com/projects/prototip/ However, since prototype is pretty large, and prototip had some problems in my tests, this stand-alone version was written. Note: The fancy effects from scriptaculous have not been rebuilt. http://script.aculo.us/ See http://commons.wikimedia.org/wiki/MediaWiki_talk:Tooltips.js for more information including documentation and examples.
var is_IE = !!window.ActiveXObject;
var EvtHandler = // end EvtHandler
var Buttons = // end Button
var Tooltips =
var Tooltip = function // This is the Javascript way of creating a class. Methods are added below to Tooltip.prototype;// one such method is 'initialize', and that will be called when a new instance is created.// To create instances of this class, use var t = new Tooltip (...);
// Location constantsTooltip.MOUSE = 0; // Near the mouse pointerTooltip.TRACK = 1; // Move tooltip when mouse pointer movesTooltip.FIXED = 2; // Always use a fixed poition (anchor) relative to an element
// AnchorsTooltip.TOP_LEFT = 1;Tooltip.TOP_RIGHT = 2;Tooltip.BOTTOM_LEFT = 3;Tooltip.BOTTOM_RIGHT = 4;
// Activation constantsTooltip.NONE = -1; // You must show the tooltip explicitly in this case.Tooltip.HOVER = 1;Tooltip.FOCUS = 2; // always uses the FIXED positionTooltip.CLICK = 4;Tooltip.ALL_ACTIVATIONS = 7;
// Deactivation constants
Tooltip.MOUSE_LEAVE = 1; // Mouse leaves target, alternate target, and tooltipTooltip.LOSE_FOCUS = 2; // Focus changes away from targetTooltip.CLICK_ELEM = 4; // Target is clickedTooltip.CLICK_TIP = 8; // Makes only sense if not trackedTooltip.ESCAPE = 16;Tooltip.ALL_DEACTIVATIONS = 31;Tooltip.LEAVE = Tooltip.MOUSE_LEAVE | Tooltip.LOSE_FOCUS;
// On IE, use the mouseleave/mouseenter events, which fire only when the boundaries of the// element are left (but not when the element if left because the mouse moved over some// contained element)
Tooltip.mouse_in = (is_IE ? 'mouseenter' : 'mouseover');Tooltip.mouse_out = (is_IE ? 'mouseleave' : 'mouseout');
Tooltip.prototype = // end Tooltip