Files
purple-explorer/public/js/jqplot.highlighter.min.js
T
joeuhren 9912c92695 Script updates + directory structure cleanup
-Updated JQuery to v3.5.1
-Updated Bootstrap to v4.5.3
-Updated DataTables to v1.10.22
-Updated FontAwesome to v5.15.1
-Updated Chart.js to v2.9.4
-Updated flag-icon-css to v3.5.0
-All scripts now load minified
-Removed unused/unnecessary scripts (moment.js and some jqPlot plugins)
-Scripts that are not used on every page are now only loaded on pages where they are needed (jqPlot, Chart.js and flag-icon-css)
-Default website language to English
-Enable unicode support
-Removed unused images
-public directory cleanup (images directory renamed to img, javascript directory renamed to js, stylesheets directory renamed to css, themes directory moved from /public/themes to /public/css/themes, removed vendor directory and moved the important contents to the new img, css and js directories)
-Reward.pug rewritten to support Chart.js v2.9.4
-Updated README Features section
2020-12-17 20:01:50 -07:00

1 line
6.9 KiB
JavaScript

!function(t){t.jqplot.eventListenerHooks.push(["jqplotMouseMove",function(t,i,e,o,l){var h=l.plugins.highlighter,n=l.plugins.cursor;if(h.show)if(null==o&&h.isHighlighting){var a=jQuery.Event("jqplotHighlighterUnhighlight");l.target.trigger(a);var g=h.highlightCanvas._ctx;g.clearRect(0,0,g.canvas.width,g.canvas.height),h.fadeTooltip?h._tooltipElem.fadeOut(h.tooltipFadeSpeed):h._tooltipElem.hide(),h.bringSeriesToFront&&l.restorePreviousSeriesOrder(),h.isHighlighting=!1,h.currentNeighbor=null,g=null}else if(null!=o&&l.series[o.seriesIndex].showHighlight&&!h.isHighlighting){var a=jQuery.Event("jqplotHighlighterHighlight");a.which=t.which,a.pageX=t.pageX,a.pageY=t.pageY;var p=[o.seriesIndex,o.pointIndex,o.data,l];l.target.trigger(a,p),h.isHighlighting=!0,h.currentNeighbor=o,h.showMarker&&s(l,o),!l.series[o.seriesIndex].show||!h.showTooltip||n&&n._zoom.started||r(l,l.series[o.seriesIndex],o),h.bringSeriesToFront&&l.moveSeriesToFront(o.seriesIndex)}else if(null!=o&&h.isHighlighting&&h.currentNeighbor!=o&&l.series[o.seriesIndex].showHighlight){var g=h.highlightCanvas._ctx;g.clearRect(0,0,g.canvas.width,g.canvas.height),h.isHighlighting=!0,h.currentNeighbor=o,h.showMarker&&s(l,o),!l.series[o.seriesIndex].show||!h.showTooltip||n&&n._zoom.started||r(l,l.series[o.seriesIndex],o),h.bringSeriesToFront&&l.moveSeriesToFront(o.seriesIndex)}}]),t.jqplot.Highlighter=function(i){this.show=t.jqplot.config.enablePlugins,this.markerRenderer=new t.jqplot.MarkerRenderer({shadow:!1}),this.showMarker=!0,this.lineWidthAdjust=2.5,this.sizeAdjust=5,this.showTooltip=!0,this.tooltipLocation="nw",this.fadeTooltip=!0,this.tooltipFadeSpeed="fast",this.tooltipOffset=2,this.tooltipAxes="both",this.tooltipSeparator=", ",this.tooltipContentEditor=null,this.useAxesFormatters=!0,this.tooltipFormatString="%.5P",this.formatString=null,this.yvalues=1,this.bringSeriesToFront=!1,this._tooltipElem,this.isHighlighting=!1,this.currentNeighbor=null,t.extend(!0,this,i)};var i=["nw","n","ne","e","se","s","sw","w"],e={nw:0,n:1,ne:2,e:3,se:4,s:5,sw:6,w:7},o=["se","s","sw","w","nw","n","ne","e"];function s(i,e){var o=i.plugins.highlighter,s=i.series[e.seriesIndex],r=s.markerRenderer,l=o.markerRenderer;l.style=r.style,l.lineWidth=r.lineWidth+o.lineWidthAdjust,l.size=r.size+o.sizeAdjust;var h=t.jqplot.getColorComponents(r.color),n=[h[0],h[1],h[2]],a=h[3]>=.6?.6*h[3]:h[3]*(2-h[3]);l.color="rgba("+n[0]+","+n[1]+","+n[2]+","+a+")",l.init(),l.draw(s.gridData[e.pointIndex][0],s.gridData[e.pointIndex][1],o.highlightCanvas._ctx)}function r(s,r,l){var h=s.plugins.highlighter,n=h._tooltipElem,a=r.highlighter||{},g=t.extend(!0,{},h,a);if(g.useAxesFormatters){for(var p=r._xaxis._ticks[0].formatter,d=r._yaxis._ticks[0].formatter,f=r._xaxis._ticks[0].formatString,u=r._yaxis._ticks[0].formatString,c=p(f,l.data[0]),m=[],j=1;j<g.yvalues+1;j++)m.push(d(u,l.data[j]));if("string"==typeof g.formatString)switch(g.tooltipAxes){case"both":case"xy":m.unshift(c),m.unshift(g.formatString),v=t.jqplot.sprintf.apply(t.jqplot.sprintf,m);break;case"yx":m.push(c),m.unshift(g.formatString),v=t.jqplot.sprintf.apply(t.jqplot.sprintf,m);break;case"x":v=t.jqplot.sprintf.apply(t.jqplot.sprintf,[g.formatString,c]);break;case"y":m.unshift(g.formatString),v=t.jqplot.sprintf.apply(t.jqplot.sprintf,m);break;default:m.unshift(c),m.unshift(g.formatString),v=t.jqplot.sprintf.apply(t.jqplot.sprintf,m)}else switch(g.tooltipAxes){case"both":case"xy":v=c;for(j=0;j<m.length;j++)v+=g.tooltipSeparator+m[j];break;case"yx":v="";for(j=0;j<m.length;j++)v+=m[j]+g.tooltipSeparator;v+=c;break;case"x":v=c;break;case"y":v=m.join(g.tooltipSeparator);break;default:v=c;for(j=0;j<m.length;j++)v+=g.tooltipSeparator+m[j]}}else{var v;"string"==typeof g.formatString?v=t.jqplot.sprintf.apply(t.jqplot.sprintf,[g.formatString].concat(l.data)):"both"==g.tooltipAxes||"xy"==g.tooltipAxes?v=t.jqplot.sprintf(g.tooltipFormatString,l.data[0])+g.tooltipSeparator+t.jqplot.sprintf(g.tooltipFormatString,l.data[1]):"yx"==g.tooltipAxes?v=t.jqplot.sprintf(g.tooltipFormatString,l.data[1])+g.tooltipSeparator+t.jqplot.sprintf(g.tooltipFormatString,l.data[0]):"x"==g.tooltipAxes?v=t.jqplot.sprintf(g.tooltipFormatString,l.data[0]):"y"==g.tooltipAxes&&(v=t.jqplot.sprintf(g.tooltipFormatString,l.data[1]))}t.isFunction(g.tooltipContentEditor)&&(v=g.tooltipContentEditor(v,l.seriesIndex,l.pointIndex,s)),n.html(v);var x=l.gridData[0],_=l.gridData[1],w=0;1==r.markerRenderer.show&&(w=(r.markerRenderer.size+g.sizeAdjust)/2);var q=i;switch(r.fillToZero&&r.fill&&l.data[1]<0&&(q=o),q[e[g.tooltipLocation]]){case"nw":var S=x+s._gridPadding.left-n.outerWidth(!0)-g.tooltipOffset-.707*w,b=_+s._gridPadding.top-g.tooltipOffset-n.outerHeight(!0)-.707*w;break;case"n":S=x+s._gridPadding.left-n.outerWidth(!0)/2,b=_+s._gridPadding.top-g.tooltipOffset-n.outerHeight(!0)-w;break;case"ne":S=x+s._gridPadding.left+g.tooltipOffset+.707*w,b=_+s._gridPadding.top-g.tooltipOffset-n.outerHeight(!0)-.707*w;break;case"e":S=x+s._gridPadding.left+g.tooltipOffset+w,b=_+s._gridPadding.top-n.outerHeight(!0)/2;break;case"se":S=x+s._gridPadding.left+g.tooltipOffset+.707*w,b=_+s._gridPadding.top+g.tooltipOffset+.707*w;break;case"s":S=x+s._gridPadding.left-n.outerWidth(!0)/2,b=_+s._gridPadding.top+g.tooltipOffset+w;break;case"sw":S=x+s._gridPadding.left-n.outerWidth(!0)-g.tooltipOffset-.707*w,b=_+s._gridPadding.top+g.tooltipOffset+.707*w;break;case"w":S=x+s._gridPadding.left-n.outerWidth(!0)-g.tooltipOffset-w,b=_+s._gridPadding.top-n.outerHeight(!0)/2;break;default:S=x+s._gridPadding.left-n.outerWidth(!0)-g.tooltipOffset-.707*w,b=_+s._gridPadding.top-g.tooltipOffset-n.outerHeight(!0)-.707*w}n.css("left",S),n.css("top",b),g.fadeTooltip?n.stop(!0,!0).fadeIn(g.tooltipFadeSpeed):n.show(),n=null}t.jqplot.Highlighter.init=function(i,e,o){var s=o||{};this.plugins.highlighter=new t.jqplot.Highlighter(s.highlighter)},t.jqplot.Highlighter.parseOptions=function(t,i){this.showHighlight=!0},t.jqplot.Highlighter.postPlotDraw=function(){this.plugins.highlighter&&this.plugins.highlighter.highlightCanvas&&(this.plugins.highlighter.highlightCanvas.resetCanvas(),this.plugins.highlighter.highlightCanvas=null),this.plugins.highlighter&&this.plugins.highlighter._tooltipElem&&(this.plugins.highlighter._tooltipElem.emptyForce(),this.plugins.highlighter._tooltipElem=null),this.plugins.highlighter.highlightCanvas=new t.jqplot.GenericCanvas,this.eventCanvas._elem.before(this.plugins.highlighter.highlightCanvas.createElement(this._gridPadding,"jqplot-highlight-canvas",this._plotDimensions,this)),this.plugins.highlighter.highlightCanvas.setContext();var i=document.createElement("div");this.plugins.highlighter._tooltipElem=t(i),i=null,this.plugins.highlighter._tooltipElem.addClass("jqplot-highlighter-tooltip"),this.plugins.highlighter._tooltipElem.css({position:"absolute",display:"none"}),this.eventCanvas._elem.before(this.plugins.highlighter._tooltipElem)},t.jqplot.preInitHooks.push(t.jqplot.Highlighter.init),t.jqplot.preParseSeriesOptionsHooks.push(t.jqplot.Highlighter.parseOptions),t.jqplot.postDrawHooks.push(t.jqplot.Highlighter.postPlotDraw)}(jQuery);