diff --git a/dist/fpsmeter.js b/dist/fpsmeter.js index 5735a53..b541ecf 100644 --- a/dist/fpsmeter.js +++ b/dist/fpsmeter.js @@ -1,6 +1,6 @@ /*! - * FPSMeter 0.3.1 - 9th May 2013 - * https://github.com/Darsain/fpsmeter + * fpsmeter 0.3.1 - 2nd Oct 2017 + * https://github.com/darsain/fpsmeter * * Licensed under the MIT license. * http://opensource.org/licenses/MIT @@ -47,11 +47,11 @@ if (value == null) { return String(value); } - if (typeof value === 'object' || typeof value === 'function') { - return Object.prototype.toString.call(value).match(/\s([a-z]+)/i)[1].toLowerCase() || 'object'; + return (value instanceof w.NodeList && 'nodelist') || + (value instanceof w.HTMLCollection && 'htmlcollection') || + Object.prototype.toString.call(value).match(/\s([a-z]+)/i)[1].toLowerCase(); } - return typeof value; } @@ -92,7 +92,11 @@ if (args[1].hasOwnProperty(key)) { switch (type(args[1][key])) { case 'object': - args[0][key] = extend({}, args[0][key], args[1][key]); + if (type(args[0][key]) === 'object') { + extend(args[0][key], args[1][key]); + } else { + args[0][key] = extend({}, args[1][key]); + } break; case 'array': @@ -441,7 +445,7 @@ // Update legend only when changed if (el.legend.fps !== showFps) { el.legend.fps = showFps; - el.legend[textProp] = showFps ? 'FPS' : 'ms'; + el.legend[textProp] = showFps ? o.labelFps : o.labelMs; } // Update counter with a nicely formated & readable number count = showFps ? self.fps : self.duration; @@ -692,8 +696,11 @@ heat: 0, // Allow themes to use coloring by FPS heat. 0 FPS = red, maxFps = green. // Graph - graph: 0, // Whether to show history graph. - history: 20 // How many history states to show in a graph. + graph: 0, // Whether to show history graph. + history: 20, // How many history states to show in a graph. + + labelFps: 'FPS', // The label to present when showing FPS.s + labelMs: 'ms' // The label to present when showing MSs. }; // Option names that trigger FPSMeter rebuild or reposition when modified diff --git a/dist/fpsmeter.min.js b/dist/fpsmeter.min.js index 481da37..e2a8925 100644 --- a/dist/fpsmeter.min.js +++ b/dist/fpsmeter.min.js @@ -1,15 +1,16 @@ -/*! FPSMeter 0.3.1 - 9th May 2013 | https://github.com/Darsain/fpsmeter */ -(function(m,j){function s(a,e){for(var g in e)try{a.style[g]=e[g]}catch(j){}return a}function H(a){return null==a?String(a):"object"===typeof a||"function"===typeof a?Object.prototype.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase()||"object":typeof a}function R(a,e){if("array"!==H(e))return-1;if(e.indexOf)return e.indexOf(a);for(var g=0,j=e.length;gd.interval?(x=M(k),m()):(x=setTimeout(k,d.interval),P=M(m))}function G(a){a=a||window.event;a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.returnValue= -!1,a.cancelBubble=!0);b.toggle()}function U(){d.toggleOn&&S(f.container,d.toggleOn,G,1);a.removeChild(f.container)}function V(){f.container&&U();h=D.theme[d.theme];y=h.compiledHeatmaps||[];if(!y.length&&h.heatmaps.length){for(p=0;p=m?m*(1+j):m+j-m*j;0===l?g="#000":(t=2*m-l,k=(l-t)/l,g*=6,n=Math.floor(g), -v=g-n,v*=l*k,0===n||6===n?(n=l,k=t+v,l=t):1===n?(n=l-v,k=l,l=t):2===n?(n=t,k=l,l=t+v):3===n?(n=t,k=l-v):4===n?(n=t+v,k=t):(n=l,k=t,l-=v),g="#"+N(n)+N(k)+N(l));b[e]=g}}h.compiledHeatmaps=y}f.container=s(document.createElement("div"),h.container);f.count=f.container.appendChild(s(document.createElement("div"),h.count));f.legend=f.container.appendChild(s(document.createElement("div"),h.legend));f.graph=d.graph?f.container.appendChild(s(document.createElement("div"),h.graph)):0;w.length=0;for(var q in f)f[q]&& -h[q].heatOn&&w.push({name:q,el:f[q]});u.length=0;if(f.graph){f.graph.style.width=d.history*h.column.width+(d.history-1)*h.column.spacing+"px";for(c=0;cc.interval?(x=M(L),V()):(x=setTimeout(L,c.interval),P=M(V))}function W(a){a= +a||window.event;a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.returnValue=!1,a.cancelBubble=!0);b.toggle()}function X(){c.toggleOn&&T(g.container,c.toggleOn,W,1);a.removeChild(g.container)}function Y(){g.container&&X();h=F.theme[c.theme];y=h.compiledHeatmaps||[];if(!y.length&&h.heatmaps.length){for(p=0;p=k?k*(1+l):k+l-k*l;0===m?e="#000":(r=2*k-m,t=(m-r)/m,e*=6,n=Math.floor(e),u=e-n,u*=m*t,0===n||6===n?(n=m,t=r+u,m=r):1===n?(n=m-u,t=m,m=r):2===n?(n=r,t=m,m=r+u):3===n?(n=r,t=m-u):4===n?(n=r+u,t=r):(n=m,t=r,m-=u),e="#"+N(n)+N(t)+N(m));b[f]=e}h.compiledHeatmaps=y}g.container=v(document.createElement("div"),h.container);g.count=g.container.appendChild(v(document.createElement("div"),h.count));g.legend=g.container.appendChild(v(document.createElement("div"),h.legend));g.graph=c.graph?g.container.appendChild(v(document.createElement("div"), +h.graph)):0;w.length=0;for(var q in g)g[q]&&h[q].heatOn&&w.push({name:q,el:g[q]});s.length=0;if(g.graph)for(g.graph.style.width=c.history*h.column.width+(c.history-1)*h.column.spacing+"px",d=0;d