9912c92695
-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
1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
!function(e){function t(e,t,i,s,r){var n=0,a=t-e,h=Math.abs(a),l=i;return 0==s&&(l+=r),l>0&&h>.01&&h<6.282&&(n=parseFloat(l)/2/function(e){return Math.sin((e-(e-Math.PI)/8/Math.PI)/2)}(a)),n}function i(t,i,s){for(var r=0;r<this.series.length;r++)this.series[r].renderer.constructor==e.jqplot.PieRenderer&&this.series[r].highlightMouseOver&&(this.series[r].highlightMouseDown=!1)}function s(t){for(var i=0;i<this.series.length;i++)this.series[i].seriesColors=this.seriesColors,this.series[i].colorGenerator=e.jqplot.colorGenerator}function r(e,t,i){if(e.series[t].showSlice[i]){var s=e.series[t],r=e.plugins.pieRenderer.highlightCanvas;r._ctx.clearRect(0,0,r._ctx.canvas.width,r._ctx.canvas.height),s._highlightedPoint=i,e.plugins.pieRenderer.highlightedSeriesIndex=t,s.renderer.drawSlice.call(s,r._ctx,s._sliceAngles[i][0],s._sliceAngles[i][1],s.highlightColorGenerator.get(i),!1)}}function n(e){var t=e.plugins.pieRenderer.highlightCanvas;t._ctx.clearRect(0,0,t._ctx.canvas.width,t._ctx.canvas.height);for(var i=0;i<e.series.length;i++)e.series[i]._highlightedPoint=null;e.plugins.pieRenderer.highlightedSeriesIndex=null,e.target.trigger("jqplotDataUnhighlight")}function a(e,t,i,s,a){if(s){var h=[s.seriesIndex,s.pointIndex,s.data],l=jQuery.Event("jqplotDataMouseOver");if(l.pageX=e.pageX,l.pageY=e.pageY,a.target.trigger(l,h),a.series[h[0]].highlightMouseOver&&(h[0]!=a.plugins.pieRenderer.highlightedSeriesIndex||h[1]!=a.series[h[0]]._highlightedPoint)){var o=jQuery.Event("jqplotDataHighlight");o.which=e.which,o.pageX=e.pageX,o.pageY=e.pageY,a.target.trigger(o,h),r(a,h[0],h[1])}}else null==s&&n(a)}function h(e,t,i,s,a){if(s){var h=[s.seriesIndex,s.pointIndex,s.data];if(a.series[h[0]].highlightMouseDown&&(h[0]!=a.plugins.pieRenderer.highlightedSeriesIndex||h[1]!=a.series[h[0]]._highlightedPoint)){var l=jQuery.Event("jqplotDataHighlight");l.which=e.which,l.pageX=e.pageX,l.pageY=e.pageY,a.target.trigger(l,h),r(a,h[0],h[1])}}else null==s&&n(a)}function l(e,t,i,s,r){var a=r.plugins.pieRenderer.highlightedSeriesIndex;null!=a&&r.series[a].highlightMouseDown&&n(r)}function o(e,t,i,s,r){if(s){var n=[s.seriesIndex,s.pointIndex,s.data],a=jQuery.Event("jqplotDataClick");a.which=e.which,a.pageX=e.pageX,a.pageY=e.pageY,r.target.trigger(a,n)}}function d(e,t,i,s,r){if(s){var a=[s.seriesIndex,s.pointIndex,s.data],h=r.plugins.pieRenderer.highlightedSeriesIndex;null!=h&&r.series[h].highlightMouseDown&&n(r);var l=jQuery.Event("jqplotDataRightClick");l.which=e.which,l.pageX=e.pageX,l.pageY=e.pageY,r.target.trigger(l,a)}}function g(){this.plugins.pieRenderer&&this.plugins.pieRenderer.highlightCanvas&&(this.plugins.pieRenderer.highlightCanvas.resetCanvas(),this.plugins.pieRenderer.highlightCanvas=null),this.plugins.pieRenderer={highlightedSeriesIndex:null},this.plugins.pieRenderer.highlightCanvas=new e.jqplot.GenericCanvas;var t=e(this.targetId+" .jqplot-data-label");t.length?e(t[0]).before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-pieRenderer-highlight-canvas",this._plotDimensions,this)):this.eventCanvas._elem.before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-pieRenderer-highlight-canvas",this._plotDimensions,this));this.plugins.pieRenderer.highlightCanvas.setContext();this.eventCanvas._elem.bind("mouseleave",{plot:this},function(e){n(e.data.plot)})}e.jqplot.PieRenderer=function(){e.jqplot.LineRenderer.call(this)},e.jqplot.PieRenderer.prototype=new e.jqplot.LineRenderer,e.jqplot.PieRenderer.prototype.constructor=e.jqplot.PieRenderer,e.jqplot.PieRenderer.prototype.init=function(t,r){if(this.diameter=null,this.padding=20,this.sliceMargin=0,this.fill=!0,this.shadowOffset=2,this.shadowAlpha=.07,this.shadowDepth=5,this.highlightMouseOver=!0,this.highlightMouseDown=!1,this.highlightColors=[],this.dataLabels="percent",this.showDataLabels=!1,this.dataLabelFormatString=null,this.dataLabelThreshold=3,this.dataLabelPositionFactor=.52,this.dataLabelNudge=2,this.dataLabelCenterOn=!0,this.startAngle=0,this.tickRenderer=e.jqplot.PieTickRenderer,this.showSlice=[],this._drawData=!0,this._type="pie",t.highlightMouseDown&&null==t.highlightMouseOver&&(t.highlightMouseOver=!1),e.extend(!0,this,t),this.sliceMargin<0&&(this.sliceMargin=0),this._diameter=null,this._radius=null,this._sliceAngles=[],this._highlightedPoint=null,0==this.highlightColors.length)for(var n=0;n<this.seriesColors.length;n++){for(var p=e.jqplot.getColorComponents(this.seriesColors[n]),c=[p[0],p[1],p[2]],u=c[0]+c[1]+c[2],f=0;f<3;f++)c[f]=u>570?.8*c[f]:c[f]+.3*(255-c[f]),c[f]=parseInt(c[f],10);this.highlightColors.push("rgb("+c[0]+","+c[1]+","+c[2]+")")}this.highlightColorGenerator=new e.jqplot.ColorGenerator(this.highlightColors),r.postParseOptionsHooks.addOnce(s),r.postInitHooks.addOnce(i),r.eventListenerHooks.addOnce("jqplotMouseMove",a),r.eventListenerHooks.addOnce("jqplotMouseDown",h),r.eventListenerHooks.addOnce("jqplotMouseUp",l),r.eventListenerHooks.addOnce("jqplotClick",o),r.eventListenerHooks.addOnce("jqplotRightClick",d),r.postDrawHooks.addOnce(g)},e.jqplot.PieRenderer.prototype.setGridData=function(e){var t=[],i=[],s=(this.startAngle,Math.PI,0);this._drawData=!1;for(var r=0;r<this.data.length;r++)0!=this.data[r][1]&&(this._drawData=!0,void 0===this.showSlice[r]&&(this.showSlice[r]=!0)),t.push(this.data[r][1]),i.push([this.data[r][0]]),r>0&&(t[r]+=t[r-1]),s+=this.data[r][1];var n=2*Math.PI/t[t.length-1];for(r=0;r<t.length;r++)i[r][1]=t[r]*n,i[r][2]=this.data[r][1]/s;this.gridData=i},e.jqplot.PieRenderer.prototype.makeGridData=function(e,t){var i=[],s=[],r=0;this.startAngle,Math.PI;this._drawData=!1;for(var n=0;n<e.length;n++)0!=this.data[n][1]&&(this._drawData=!0),i.push(e[n][1]),s.push([e[n][0]]),n>0&&(i[n]+=i[n-1]),r+=e[n][1];var a=2*Math.PI/i[i.length-1];for(n=0;n<i.length;n++)s[n][1]=i[n]*a,s[n][2]=e[n][1]/r;return s},e.jqplot.PieRenderer.prototype.drawSlice=function(e,i,s,r,n){if(this._drawData){var a=this._radius,h=this.fill,l=this.lineWidth;this.sliceMargin;0==this.fill&&this.lineWidth,e.save(),e.translate(this._center[0],this._center[1]);var o=t(i,s,this.sliceMargin,this.fill,this.lineWidth),d=o*Math.cos((i+s)/2),g=o*Math.sin((i+s)/2);if(s-i<=Math.PI?a-=o:a+=o,e.translate(d,g),n){for(var p=0,c=this.shadowDepth;p<c;p++)e.save(),e.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI),this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI)),u(a);for(p=0,c=this.shadowDepth;p<c;p++)e.restore()}else u(a);e.restore()}function u(t){s>6.282+this.startAngle&&(s=6.282+this.startAngle,i>s&&(i=6.281+this.startAngle)),i>=s||(e.beginPath(),e.fillStyle=r,e.strokeStyle=r,e.lineWidth=l,e.arc(0,0,t,i,s,!1),e.lineTo(0,0),e.closePath(),h?e.fill():e.stroke())}},e.jqplot.PieRenderer.prototype.draw=function(i,s,r,n){var a,h=null!=r?r:{},l=0,o=0,d=1,g=new e.jqplot.ColorGenerator(this.seriesColors);if(r.legendInfo&&"insideGrid"==r.legendInfo.placement){var p=r.legendInfo;switch(p.location){case"nw":case"w":case"sw":l=p.width+p.xoffset;break;case"ne":case"e":case"se":l=p.width+p.xoffset,d=-1;break;case"n":o=p.height+p.yoffset;break;case"s":o=p.height+p.yoffset,d=-1}}null!=h.shadow?h.shadow:this.shadow,null!=h.fill?h.fill:this.fill;var c=parseInt(i.canvas.style.width),u=parseInt(i.canvas.style.height),f=c-l-2*this.padding,v=u-o-2*this.padding,j=Math.min(f,v);this._sliceAngles=[];var m;this.sliceMargin;0==this.fill&&this.lineWidth;for(var w,q,R,b=0,_=this.startAngle/180*Math.PI,M=0,P=s.length;M<P;M++)w=0==M?_:s[M-1][1]+_,q=s[M][1]+_,this._sliceAngles.push([w,q]),m=t(w,q,this.sliceMargin,this.fill,this.lineWidth),Math.abs(q-w)>Math.PI&&(b=Math.max(m,b));if(null!=this.diameter&&this.diameter>0?this._diameter=this.diameter-2*b:this._diameter=j-2*b,this._diameter<6)e.jqplot.log("Diameter of pie too small, not rendering.");else{this._radius=this._diameter/2;if(this._center=[(c-d*l)/2+d*l+b*Math.cos(_),(u-d*o)/2+d*o+b*Math.sin(_)],this.shadow)for(M=0,P=s.length;M<P;M++)R="rgba(0,0,0,"+this.shadowAlpha+")",this.renderer.drawSlice.call(this,i,this._sliceAngles[M][0],this._sliceAngles[M][1],R,!0);for(M=0;M<s.length;M++)if(a=g.next(),this.showSlice[M]&&(this.renderer.drawSlice.call(this,i,this._sliceAngles[M][0],this._sliceAngles[M][1],a,!1),this.showDataLabels&&100*s[M][2]>=this.dataLabelThreshold)){var C,x,L=(this._sliceAngles[M][0]+this._sliceAngles[M][1])/2;"label"==this.dataLabels?(C=this.dataLabelFormatString||"%s",x=e.jqplot.sprintf(C,s[M][0])):"value"==this.dataLabels?(C=this.dataLabelFormatString||"%d",x=e.jqplot.sprintf(C,this.data[M][1])):"percent"==this.dataLabels?(C=this.dataLabelFormatString||"%d%%",x=e.jqplot.sprintf(C,100*s[M][2])):this.dataLabels.constructor==Array&&(C=this.dataLabelFormatString||"%s",x=e.jqplot.sprintf(C,this.dataLabels[M]));var D=this._radius*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge,I=this._center[0]+Math.cos(L)*D+this.canvas._offsets.left,k=this._center[1]+Math.sin(L)*D+this.canvas._offsets.top,y=e('<div class="jqplot-pie-series jqplot-data-label" style="position:absolute;">'+x+"</div>").insertBefore(n.eventCanvas._elem);this.dataLabelCenterOn?(I-=y.width()/2,k-=y.height()/2):(I-=y.width()*Math.sin(L/2),k-=y.height()/2),I=Math.round(I),k=Math.round(k),y.css({left:I,top:k})}}},e.jqplot.PieAxisRenderer=function(){e.jqplot.LinearAxisRenderer.call(this)},e.jqplot.PieAxisRenderer.prototype=new e.jqplot.LinearAxisRenderer,e.jqplot.PieAxisRenderer.prototype.constructor=e.jqplot.PieAxisRenderer,e.jqplot.PieAxisRenderer.prototype.init=function(t){this.tickRenderer=e.jqplot.PieTickRenderer,e.extend(!0,this,t),this._dataBounds={min:0,max:100},this.min=0,this.max=100,this.showTicks=!1,this.ticks=[],this.showMark=!1,this.show=!1},e.jqplot.PieLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)},e.jqplot.PieLegendRenderer.prototype=new e.jqplot.TableLegendRenderer,e.jqplot.PieLegendRenderer.prototype.constructor=e.jqplot.PieLegendRenderer,e.jqplot.PieLegendRenderer.prototype.init=function(t){this.numberRows=null,this.numberColumns=null,this.width=null,e.extend(!0,this,t)},e.jqplot.PieLegendRenderer.prototype.draw=function(){if(this.show){var t=this._series;this._elem=e(document.createElement("table")),this._elem.addClass("jqplot-table-legend");var i={position:"absolute"};this.background&&(i.background=this.background),this.border&&(i.border=this.border),this.fontSize&&(i.fontSize=this.fontSize),this.fontFamily&&(i.fontFamily=this.fontFamily),this.textColor&&(i.textColor=this.textColor),null!=this.marginTop&&(i.marginTop=this.marginTop),null!=this.marginBottom&&(i.marginBottom=this.marginBottom),null!=this.marginLeft&&(i.marginLeft=this.marginLeft),null!=this.marginRight&&(i.marginRight=this.marginRight),this._elem.css(i);var s,r,n=t[0],a=new e.jqplot.ColorGenerator(n.seriesColors);if(n.show){var h,l,o,d,g,p,c,u,f,v=n.data;this.numberRows?(s=this.numberRows,r=this.numberColumns?this.numberColumns:Math.ceil(v.length/s)):this.numberColumns?(r=this.numberColumns,s=Math.ceil(v.length/this.numberColumns)):(s=v.length,r=1);var j,m,w=0;for(h=0;h<s;h++)for((o=e(document.createElement("tr"))).addClass("jqplot-table-legend"),o.appendTo(this._elem),l=0;l<r;l++)w<v.length&&(c="",this.labels[w]?p=this.labels[w]:"object"==typeof v[w][0]?(p=v[w][0][0].toString(),c=v[w][0][1].toString()):p=v[w][0].toString(),f=a.next(),u=h>0?this.rowSpacing:"0",(d=e(document.createElement("td"))).addClass("jqplot-table-legend jqplot-table-legend-swatch"),d.css({textAlign:"center",paddingTop:u}),(j=e(document.createElement("div"))).addClass("jqplot-table-legend-swatch-outline"),""!==c&&j.attr("title",c),(m=e(document.createElement("div"))).addClass("jqplot-table-legend-swatch"),m.css({backgroundColor:f,borderColor:f}),d.append(j.append(m)),(g=e(document.createElement("td"))).addClass("jqplot-table-legend jqplot-table-legend-label"),g.css("paddingTop",u),this.escapeHtml?g.text(p):g.html('<a title="'+c+'">'+p+"</a>"),d.appendTo(o),g.appendTo(o),!0),w++}}return this._elem},e.jqplot.PieRenderer.prototype.handleMove=function(e,t,i,s,a){if(s){var h=[s.seriesIndex,s.pointIndex,s.data];a.target.trigger("jqplotDataMouseOver",h),!a.series[h[0]].highlightMouseOver||h[0]==a.plugins.pieRenderer.highlightedSeriesIndex&&h[1]==a.series[h[0]]._highlightedPoint||(a.target.trigger("jqplotDataHighlight",h),r(a,h[0],h[1]))}else null==s&&n(a)},e.jqplot.preInitHooks.push(function(t,i,s){(s=s||{}).axesDefaults=s.axesDefaults||{},s.legend=s.legend||{},s.seriesDefaults=s.seriesDefaults||{};var r=!1;if(s.seriesDefaults.renderer==e.jqplot.PieRenderer)r=!0;else if(s.series)for(var n=0;n<s.series.length;n++)s.series[n].renderer==e.jqplot.PieRenderer&&(r=!0);r&&(s.axesDefaults.renderer=e.jqplot.PieAxisRenderer,s.legend.renderer=s.legend.renderer||e.jqplot.PieLegendRenderer,s.legend.preDraw=!0,s.seriesDefaults.pointLabels={show:!1})}),e.jqplot.PieTickRenderer=function(){e.jqplot.AxisTickRenderer.call(this)},e.jqplot.PieTickRenderer.prototype=new e.jqplot.AxisTickRenderer,e.jqplot.PieTickRenderer.prototype.constructor=e.jqplot.PieTickRenderer}(jQuery); |