1/* tooltipsy by Brian Cray 2 * Lincensed under GPL2 - http://www.gnu.org/licenses/gpl-2.0.html 3 * Option quick reference: 4 * - alignTo: "element" or "cursor" (Defaults to "element") 5 * - offset: Tooltipsy distance from element or mouse cursor, dependent on alignTo setting. Set as array [x, y] (Defaults to [0, -1]) 6 * - content: HTML or text content of tooltip. Defaults to "" (empty string), which pulls content from target element's title attribute 7 * - show: function(event, tooltip) to show the tooltip. Defaults to a show(100) effect 8 * - hide: function(event, tooltip) to hide the tooltip. Defaults to a fadeOut(100) effect 9 * - delay: A delay in milliseconds before showing a tooltip. Set to 0 for no delay. Defaults to 200 10 * - css: object containing CSS properties and values. Defaults to {} to use stylesheet for styles 11 * - className: DOM class for styling tooltips with CSS. Defaults to "tooltipsy" 12 * - showEvent: Set a custom event to bind the show function. Defaults to mouseenter 13 * - hideEvent: Set a custom event to bind the show function. Defaults to mouseleave 14 * Method quick reference: 15 * - $('element').data('tooltipsy').show(): Force the tooltip to show 16 * - $('element').data('tooltipsy').hide(): Force the tooltip to hide 17 * - $('element').data('tooltipsy').destroy(): Remove tooltip from DOM 18 * More information visit http://tooltipsy.com/ 19 */ 20 21 22;(function(a){a.tooltipsy=function(c,b){this.options=b;this.$el=a(c);this.title=this.$el.attr("title")||"";this.$el.attr("title","");this.random=parseInt(Math.random()*10000);this.ready=false;this.shown=false;this.width=0;this.height=0;this.delaytimer=null;this.$el.data("tooltipsy",this);this.init()};a.tooltipsy.prototype={init:function(){var e=this,d,b=e.$el,c=b[0];e.settings=d=a.extend({},e.defaults,e.options);d.delay=+d.delay;if(typeof d.content==="function"){e.readify()}if(d.showEvent===d.hideEvent&&d.showEvent==="click"){b.toggle(function(f){if(d.showEvent==="click"&&c.tagName=="A"){f.preventDefault()}if(d.delay>0){e.delaytimer=window.setTimeout(function(){e.show(f)},d.delay)}else{e.show(f)}},function(f){if(d.showEvent==="click"&&c.tagName=="A"){f.preventDefault()}window.clearTimeout(e.delaytimer);e.delaytimer=null;e.hide(f)})}else{b.bind(d.showEvent,function(f){if(d.showEvent==="click"&&c.tagName=="A"){f.preventDefault()}e.delaytimer=window.setTimeout(function(){e.show(f)},d.delay||0)}).bind(d.hideEvent,function(f){if(d.showEvent==="click"&&c.tagName=="A"){f.preventDefault()}window.clearTimeout(e.delaytimer);e.delaytimer=null;e.hide(f)})}},show:function(i){if(this.ready===false){this.readify()}var b=this,f=b.settings,h=b.$tipsy,k=b.$el,d=k[0],g=b.offset(d);if(b.shown===false){if((function(m){var l=0,e;for(e in m){if(m.hasOwnProperty(e)){l++}}return l})(f.css)>0){b.$tip.css(f.css)}b.width=h.outerWidth();b.height=h.outerHeight()}if(f.alignTo==="cursor"&&i){var j=[i.clientX+f.offset[0],i.clientY+f.offset[1]];if(j[0]+b.width>a(window).width()){var c={top:j[1]+"px",right:j[0]+"px",left:"auto"}}else{var c={top:j[1]+"px",left:j[0]+"px",right:"auto"}}}else{var j=[(function(){if(f.offset[0]<0){return g.left-Math.abs(f.offset[0])-b.width}else{if(f.offset[0]===0){return g.left-((b.width-k.outerWidth())/2)}else{return g.left+k.outerWidth()+f.offset[0]}}})(),(function(){if(f.offset[1]<0){return g.top-Math.abs(f.offset[1])-b.height}else{if(f.offset[1]===0){return g.top-((b.height-b.$el.outerHeight())/2)}else{return g.top+b.$el.outerHeight()+f.offset[1]}}})()]}h.css({top:j[1]+"px",left:j[0]+"px"});b.settings.show(i,h.stop(true,true))},hide:function(c){var b=this;if(b.ready===false){return}if(c&&c.relatedTarget===b.$tip[0]){b.$tip.bind("mouseleave",function(d){if(d.relatedTarget===b.$el[0]){return}b.settings.hide(d,b.$tipsy.stop(true,true))});return}b.settings.hide(c,b.$tipsy.stop(true,true))},readify:function(){this.ready=true;this.$tipsy=a('<div id="tooltipsy'+this.random+'" style="position:fixed;z-index:2147483647;display:none">').appendTo("body");this.$tip=a('<div class="'+this.settings.className+'">').appendTo(this.$tipsy);this.$tip.data("rootel",this.$el);var c=this.$el;var b=this.$tip;this.$tip.html(this.settings.content!=""?(typeof this.settings.content=="string"?this.settings.content:this.settings.content(c,b)):this.title)},offset:function(b){return this.$el[0].getBoundingClientRect()},destroy:function(){this.$tipsy.remove();a.removeData(this.$el,"tooltipsy")},defaults:{alignTo:"element",offset:[0,-1],content:"",show:function(c,b){b.fadeIn(100)},hide:function(c,b){b.fadeOut(100)},css:{}
22,className:"tooltipsy",delay:200,showEvent:"mouseenter",hideEvent:"mouseleave"}};a.fn.tooltipsy=function(b){return this.each(function(){new a.tooltipsy(this,b)})}})(jQuery); 23 24$(function () { 25 $('.tooltip_top').tooltipsy({ 26 className: 'tooltip_custom_top', 27 offset: [0, -10], 28 show: function (e, $el) { 29 $el.fadeIn(100); 30 }, 31 hide: function (e, $el) { 32 $el.fadeOut(200); 33 } 34 }); 35 $('.tooltip_bottom').tooltipsy({ 36 className: 'tooltip_custom_bottom', 37 offset: [0, 10], 38 show: function (e, $el) { 39 $el.fadeIn(100); 40 }, 41 hide: function (e, $el) { 42 $el.fadeOut(200); 43 } 44 }); 45 $('.tooltip_left').tooltipsy({ 46 className: 'tooltip_custom_left', 47 offset: [-10, 0], 48 show: function (e, $el) { 49 $el.fadeIn(100); 50 }, 51 hide: function (e, $el) { 52 $el.fadeOut(200); 53 } 54 }); 55 $('.tooltip_right').tooltipsy({ 56 className: 'tooltip_custom_right', 57 offset: [10, 0], 58 show: function (e, $el) { 59 $el.fadeIn(100); 60 }, 61 hide: function (e, $el) { 62 $el.fadeOut(200); 63 } 64 }); 65});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.