PageSourceSearch

https://cdn.plixi.com/landing/js/tooltip.js

js plixi.com collected 2026-09-24 09:16:57 UTC 4,793 bytes, 1 lines download raw bytes

1if(typeof App=="undefined"){App={}}App.tooltip=function(options){var ttip=KYB.clone(this.tooltip,false,true);_.extend(ttip,{el:null,wrap:null,cssClass:null,content:"",alwaysFresh:false,visible:false,mouseFix:false,onShow:null,onHide:null,onClick:null,byHover:true,byClick:false,hideByClick:false,condition:false,delay:150,delayHide:150,position:false,sendStat:false},options);ttip.init();App.tooltipAll.push(ttip);return ttip};App.tooltipAll=[];App.tooltip.init=function(){if(this.visible){this.show()}var T=this;var el=this.el;if(this.byClick){this.eventClick=this.show.bind(this);el.addEventListener("click",this.eventClick,true)}else if(this.byHover){this.eventMouseenter=this.show.bind(this);el.addEventListener("mouseenter",this.eventMouseenter)}if(!this.visible&&!this.hideByClick){this.eventMouseleave=this.hide.bind(this);el.addEventListener("mouseleave",this.eventMouseleave)}if(this.mouseFix){this.eventMousemove=this.align.bind(this);el.addEventListener("mousemove",this.eventMousemove)}el.classList.add("hype-ttip-el")};App.tooltip.destroy=function(){_.each(App.tooltipAll,function(ttip){ttip.remove()})};App.tooltip.remove=function(){var T=this;if(this.$ttip){this.$ttip.remove();this.$ttip=false}if(!this.el){return false}if(this.eventMouseenter){this.el.removeEventListener("mouseenter",this.eventMouseenter)}if(this.eventClick){this.el.removeEventListener("click",this.eventClick,true)}if(this.eventMouseleave){this.el.removeEventListener("mouseleave",this.eventMouseleave)}if(this.eventMousemove){this.el.removeEventListener("mousemove",this.eventMousemove)}};App.tooltip.render=function(){if(!this.$ttip){this.$ttip=document.createElement("div");this.$ttip.setAttribute("class","hfTooltip"+(this.mouseFix?" hfTooltipMouseFix":"")+(this.cssClass?" "+this.cssClass:""));this.$ttip.setAttribute("onclick","event.stopPropagation();");if(this.onClick){this.$ttip.addEventListener("click",this.onClick)}this.$content=document.createElement("div");this.$content.classList.add("hfTooltipContent");this.s=this.$ttip.style;var T=this;this.$ttip.appendChild(this.$content);var source=document.createElement("div");source.classList.add("hfTooltipSource");this.$ttip.appendChild(source);if(!this.visible&&!this.hideByClick){this.$ttip.addEventListener("mouseenter",function(){T.isHover=true});this.$ttip.addEventListener("mouseleave",function(){T.isHover=false;T.hide()})}if(this.wrap){this.wrap.appendChild(this.$ttip)}else{document.body.appendChild(this.$ttip)}}if(_.isFunction(this.content)){this.renderedContent=this.content(this)}else{this.renderedContent=this.content;this.$content.innerHTML=this.renderedContent}this.isRender=true};App.tooltip.show=function(e){if(e){e.stopPropagation()}var T=this;if(T.isShow){return false}if(this.condition&&!this.condition()){return false}if(!this.isRender||this.alwaysFresh){this.render()}if(!this.renderedContent){return false}if(this.hideTimeout){clearTimeout(this.hideTimeout);this.hideTimeout=false}if(!T.isShow){var show=function(){T.$ttip.classList.add("hfTooltipShow");if(T.onShow){T.onShow(T)}if(T.sendStat){if(T.sendStatT){clearTimeout(T.sendStatT);T.sendStatT=false}T.sendStatT=setTimeout(function(){KYB.tracker.trackEvent("View Tooltip",{type:T.el.dataset.statid})},2e3)}T.align(e);if(T.hideByClick){window.addEventListener("click",function(e){if(e.target){T.hide();window.removeEventListener("click",arguments.callee)}})}};if(this.delay){this.showTimeout=setTimeout(function(){show()},this.delay)}else{show()}}this.isShow=true};App.tooltip.hide=function(e,fast){if(!this.isShow){return false}var T=this;setTimeout(function(){if(!T.$ttip){return false}if(T.showTimeout){clearTimeout(T.showTimeout);T.showTimeout=false}var hide=function(){if(!T.isHover||fast){if(T.$ttip){T.$ttip.classList.remove("hfTooltipShow")}T.isShow=false;if(T.onHide){T.onHide(T)}if(T.sendStat){if(T.sendStatT){clearTimeout(T.sendStatT);T.sendStatT=false}}}};if(T.delayHide&&!fast){T.hideTimeout=setTimeout(function(){hide()},T.delayHide)}else{hide()}})};App.tooltip.align=function(e){var el=this.el;var ttip=this.$ttip;var offset=el.getBoundingClientRect();var scrollTop=window.scrollY||window.pageYOffset;var scrollLeft=window.scrollX||window.pageXOffset;var top=offset.top+scrollTop;var height=offset.height;var width=offset.width;var ttipHeight=ttip.clientHeight;var ttipWidth=ttip.clientWidth;var left=offset.left+width/2-ttipWidth/2+scrollLeft;var headerHeight=64;var l=left;var t=top;if(offset.top-headerHeight<ttipHeight){t+=height;ttip.classList.add("hfTooltipBottom")}else{ttip.classList.remove("hfTooltipBottom")}if(this.position=="right"||left<0){ttip.classList.add("hfTooltipRight")}else if(this.position=="left"||left+ttipWidth>window.innerWidth){ttip.classList.add("hfTooltipLeft")}this.s.left=Math.round(l)+"px";this.s.top=Math.round(t)+"px"};

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.