summaryrefslogtreecommitdiff
path: root/html/includes/js/adapters
diff options
context:
space:
mode:
authorrandommonk <randommonk@gmail.com>2018-01-04 22:52:54 +0000
committerrandommonk <randommonk@gmail.com>2018-01-04 23:06:03 +0000
commitdfc4e20b8e9ca57340e24143539498fb82527697 (patch)
tree50cdec1c1e650e6ca8f0d055b401b2c893e43124 /html/includes/js/adapters
parent66b162b5f01c996fd8a5cd4e570e31f8483cdffa (diff)
Bumped version to 4.3. Added jpgraph stats developed by killerEye
Diffstat (limited to 'html/includes/js/adapters')
-rw-r--r--html/includes/js/adapters/standalone-framework.js18
-rw-r--r--html/includes/js/adapters/standalone-framework.src.js603
2 files changed, 621 insertions, 0 deletions
diff --git a/html/includes/js/adapters/standalone-framework.js b/html/includes/js/adapters/standalone-framework.js
new file mode 100644
index 0000000..d41dde7
--- /dev/null
+++ b/html/includes/js/adapters/standalone-framework.js
@@ -0,0 +1,18 @@
+/*
+ Highcharts JS v4.0.4 (2014-09-02)
+
+ Standalone Highcharts Framework
+
+ License: MIT License
+*/
+var HighchartsAdapter=function(){function p(c){function b(b,a,d){b.removeEventListener(a,d,!1)}function d(b,a,d){d=b.HCProxiedMethods[d.toString()];b.detachEvent("on"+a,d)}function a(a,c){var f=a.HCEvents,i,g,k,j;if(a.removeEventListener)i=b;else if(a.attachEvent)i=d;else return;c?(g={},g[c]=!0):g=f;for(j in g)if(f[j])for(k=f[j].length;k--;)i(a,j,f[j][k])}c.HCExtended||Highcharts.extend(c,{HCExtended:!0,HCEvents:{},bind:function(b,a){var d=this,c=this.HCEvents,g;if(d.addEventListener)d.addEventListener(b,
+a,!1);else if(d.attachEvent){g=function(b){b.target=b.srcElement||window;a.call(d,b)};if(!d.HCProxiedMethods)d.HCProxiedMethods={};d.HCProxiedMethods[a.toString()]=g;d.attachEvent("on"+b,g)}c[b]===s&&(c[b]=[]);c[b].push(a)},unbind:function(c,h){var f,i;c?(f=this.HCEvents[c]||[],h?(i=HighchartsAdapter.inArray(h,f),i>-1&&(f.splice(i,1),this.HCEvents[c]=f),this.removeEventListener?b(this,c,h):this.attachEvent&&d(this,c,h)):(a(this,c),this.HCEvents[c]=[])):(a(this),this.HCEvents={})},trigger:function(b,
+a){var d=this.HCEvents[b]||[],c=d.length,g,k,j;k=function(){a.defaultPrevented=!0};for(g=0;g<c;g++){j=d[g];if(a.stopped)break;a.preventDefault=k;a.target=this;if(!a.type)a.type=b;j.call(this,a)===!1&&a.preventDefault()}}});return c}var s,l=document,q=[],m=[],r,n={},o;Math.easeInOutSine=function(c,b,d,a){return-d/2*(Math.cos(Math.PI*c/a)-1)+b};return{init:function(c){if(!l.defaultView)this._getStyle=function(b,d){var a;return b.style[d]?b.style[d]:(d==="opacity"&&(d="filter"),a=b.currentStyle[d.replace(/\-(\w)/g,
+function(b,a){return a.toUpperCase()})],d==="filter"&&(a=a.replace(/alpha\(opacity=([0-9]+)\)/,function(b,a){return a/100})),a===""?1:a)},this.adapterRun=function(b,d){var a={width:"clientWidth",height:"clientHeight"}[d];if(a)return b.style.zoom=1,b[a]-2*parseInt(HighchartsAdapter._getStyle(b,"padding"),10)};if(!Array.prototype.forEach)this.each=function(b,d){for(var a=0,c=b.length;a<c;a++)if(d.call(b[a],b[a],a,b)===!1)return a};if(!Array.prototype.indexOf)this.inArray=function(b,d){var a,c=0;if(d)for(a=
+d.length;c<a;c++)if(d[c]===b)return c;return-1};if(!Array.prototype.filter)this.grep=function(b,d){for(var a=[],c=0,h=b.length;c<h;c++)d(b[c],c)&&a.push(b[c]);return a};o=function(b,c,a){this.options=c;this.elem=b;this.prop=a};o.prototype={update:function(){var b;b=this.paths;var d=this.elem,a=d.element;if(n[this.prop])n[this.prop](this);else b&&a?d.attr("d",c.step(b[0],b[1],this.now,this.toD)):d.attr?a&&d.attr(this.prop,this.now):(b={},b[this.prop]=this.now+this.unit,Highcharts.css(d,b));this.options.step&&
+this.options.step.call(this.elem,this.now,this)},custom:function(b,c,a){var e=this,h=function(a){return e.step(a)},f;this.startTime=+new Date;this.start=b;this.end=c;this.unit=a;this.now=this.start;this.pos=this.state=0;h.elem=this.elem;h()&&m.push(h)===1&&(r=setInterval(function(){for(f=0;f<m.length;f++)m[f]()||m.splice(f--,1);m.length||clearInterval(r)},13))},step:function(b){var c=+new Date,a;a=this.options;var e=this.elem,h;if(e.stopAnimation||e.attr&&!e.element)a=!1;else if(b||c>=a.duration+
+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();b=this.options.curAnim[this.prop]=!0;for(h in a.curAnim)a.curAnim[h]!==!0&&(b=!1);b&&a.complete&&a.complete.call(e);a=!1}else e=c-this.startTime,this.state=e/a.duration,this.pos=a.easing(e,0,1,a.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update(),a=!0;return a}};this.animate=function(b,d,a){var e,h="",f,i,g;b.stopAnimation=!1;if(typeof a!=="object"||a===null)e=arguments,a={duration:e[2],easing:e[3],complete:e[4]};
+if(typeof a.duration!=="number")a.duration=400;a.easing=Math[a.easing]||Math.easeInOutSine;a.curAnim=Highcharts.extend({},d);for(g in d)i=new o(b,a,g),f=null,g==="d"?(i.paths=c.init(b,b.d,d.d),i.toD=d.d,e=0,f=1):b.attr?e=b.attr(g):(e=parseFloat(HighchartsAdapter._getStyle(b,g))||0,g!=="opacity"&&(h="px")),f||(f=d[g]),i.custom(e,f,h)}},_getStyle:function(c,b){return window.getComputedStyle(c,void 0).getPropertyValue(b)},addAnimSetter:function(c,b){n[c]=b},getScript:function(c,b){var d=l.getElementsByTagName("head")[0],
+a=l.createElement("script");a.type="text/javascript";a.src=c;a.onload=b;d.appendChild(a)},inArray:function(c,b){return b.indexOf?b.indexOf(c):q.indexOf.call(b,c)},adapterRun:function(c,b){return parseInt(HighchartsAdapter._getStyle(c,b),10)},grep:function(c,b){return q.filter.call(c,b)},map:function(c,b){for(var d=[],a=0,e=c.length;a<e;a++)d[a]=b.call(c[a],c[a],a,c);return d},offset:function(c){var b=document.documentElement,c=c.getBoundingClientRect();return{top:c.top+(window.pageYOffset||b.scrollTop)-
+(b.clientTop||0),left:c.left+(window.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}},addEvent:function(c,b,d){p(c).bind(b,d)},removeEvent:function(c,b,d){p(c).unbind(b,d)},fireEvent:function(c,b,d,a){var e;l.createEvent&&(c.dispatchEvent||c.fireEvent)?(e=l.createEvent("Events"),e.initEvent(b,!0,!0),e.target=c,Highcharts.extend(e,d),c.dispatchEvent?c.dispatchEvent(e):c.fireEvent(b,e)):c.HCExtended===!0&&(d=d||{},c.trigger(b,d));d&&d.defaultPrevented&&(a=null);a&&a(d)},washMouseEvent:function(c){return c},
+stop:function(c){c.stopAnimation=!0},each:function(c,b){return Array.prototype.forEach.call(c,b)}}}();
diff --git a/html/includes/js/adapters/standalone-framework.src.js b/html/includes/js/adapters/standalone-framework.src.js
new file mode 100644
index 0000000..f403b0d
--- /dev/null
+++ b/html/includes/js/adapters/standalone-framework.src.js
@@ -0,0 +1,603 @@
+/**
+ * @license Highcharts JS v4.0.4 (2014-09-02)
+ *
+ * Standalone Highcharts Framework
+ *
+ * License: MIT License
+ */
+
+
+/*global Highcharts */
+var HighchartsAdapter = (function () {
+
+var UNDEFINED,
+ doc = document,
+ emptyArray = [],
+ timers = [],
+ timerId,
+ animSetters = {},
+ Fx;
+
+Math.easeInOutSine = function (t, b, c, d) {
+ return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
+};
+
+
+
+/**
+ * Extend given object with custom events
+ */
+function augment(obj) {
+ function removeOneEvent(el, type, fn) {
+ el.removeEventListener(type, fn, false);
+ }
+
+ function IERemoveOneEvent(el, type, fn) {
+ fn = el.HCProxiedMethods[fn.toString()];
+ el.detachEvent('on' + type, fn);
+ }
+
+ function removeAllEvents(el, type) {
+ var events = el.HCEvents,
+ remove,
+ types,
+ len,
+ n;
+
+ if (el.removeEventListener) {
+ remove = removeOneEvent;
+ } else if (el.attachEvent) {
+ remove = IERemoveOneEvent;
+ } else {
+ return; // break on non-DOM events
+ }
+
+
+ if (type) {
+ types = {};
+ types[type] = true;
+ } else {
+ types = events;
+ }
+
+ for (n in types) {
+ if (events[n]) {
+ len = events[n].length;
+ while (len--) {
+ remove(el, n, events[n][len]);
+ }
+ }
+ }
+ }
+
+ if (!obj.HCExtended) {
+ Highcharts.extend(obj, {
+ HCExtended: true,
+
+ HCEvents: {},
+
+ bind: function (name, fn) {
+ var el = this,
+ events = this.HCEvents,
+ wrappedFn;
+
+ // handle DOM events in modern browsers
+ if (el.addEventListener) {
+ el.addEventListener(name, fn, false);
+
+ // handle old IE implementation
+ } else if (el.attachEvent) {
+
+ wrappedFn = function (e) {
+ e.target = e.srcElement || window; // #2820
+ fn.call(el, e);
+ };
+
+ if (!el.HCProxiedMethods) {
+ el.HCProxiedMethods = {};
+ }
+
+ // link wrapped fn with original fn, so we can get this in removeEvent
+ el.HCProxiedMethods[fn.toString()] = wrappedFn;
+
+ el.attachEvent('on' + name, wrappedFn);
+ }
+
+
+ if (events[name] === UNDEFINED) {
+ events[name] = [];
+ }
+
+ events[name].push(fn);
+ },
+
+ unbind: function (name, fn) {
+ var events,
+ index;
+
+ if (name) {
+ events = this.HCEvents[name] || [];
+ if (fn) {
+ index = HighchartsAdapter.inArray(fn, events);
+ if (index > -1) {
+ events.splice(index, 1);
+ this.HCEvents[name] = events;
+ }
+ if (this.removeEventListener) {
+ removeOneEvent(this, name, fn);
+ } else if (this.attachEvent) {
+ IERemoveOneEvent(this, name, fn);
+ }
+ } else {
+ removeAllEvents(this, name);
+ this.HCEvents[name] = [];
+ }
+ } else {
+ removeAllEvents(this);
+ this.HCEvents = {};
+ }
+ },
+
+ trigger: function (name, args) {
+ var events = this.HCEvents[name] || [],
+ target = this,
+ len = events.length,
+ i,
+ preventDefault,
+ fn;
+
+ // Attach a simple preventDefault function to skip default handler if called
+ preventDefault = function () {
+ args.defaultPrevented = true;
+ };
+
+ for (i = 0; i < len; i++) {
+ fn = events[i];
+
+ // args is never null here
+ if (args.stopped) {
+ return;
+ }
+
+ args.preventDefault = preventDefault;
+ args.target = target;
+
+ // If the type is not set, we're running a custom event (#2297). If it is set,
+ // we're running a browser event, and setting it will cause en error in
+ // IE8 (#2465).
+ if (!args.type) {
+ args.type = name;
+ }
+
+
+
+ // If the event handler return false, prevent the default handler from executing
+ if (fn.call(this, args) === false) {
+ args.preventDefault();
+ }
+ }
+ }
+ });
+ }
+
+ return obj;
+}
+
+
+return {
+
+ /**
+ * Initialize the adapter. This is run once as Highcharts is first run.
+ */
+ init: function (pathAnim) {
+
+ /**
+ * Compatibility section to add support for legacy IE. This can be removed if old IE
+ * support is not needed.
+ */
+ if (!doc.defaultView) {
+ this._getStyle = function (el, prop) {
+ var val;
+ if (el.style[prop]) {
+ return el.style[prop];
+ } else {
+ if (prop === 'opacity') {
+ prop = 'filter';
+ }
+ /*jslint unparam: true*/
+ val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b) { return b.toUpperCase(); })];
+ if (prop === 'filter') {
+ val = val.replace(
+ /alpha\(opacity=([0-9]+)\)/,
+ function (a, b) {
+ return b / 100;
+ }
+ );
+ }
+ /*jslint unparam: false*/
+ return val === '' ? 1 : val;
+ }
+ };
+ this.adapterRun = function (elem, method) {
+ var alias = { width: 'clientWidth', height: 'clientHeight' }[method];
+
+ if (alias) {
+ elem.style.zoom = 1;
+ return elem[alias] - 2 * parseInt(HighchartsAdapter._getStyle(elem, 'padding'), 10);
+ }
+ };
+ }
+
+ if (!Array.prototype.forEach) {
+ this.each = function (arr, fn) { // legacy
+ var i = 0,
+ len = arr.length;
+ for (; i < len; i++) {
+ if (fn.call(arr[i], arr[i], i, arr) === false) {
+ return i;
+ }
+ }
+ };
+ }
+
+ if (!Array.prototype.indexOf) {
+ this.inArray = function (item, arr) {
+ var len,
+ i = 0;
+
+ if (arr) {
+ len = arr.length;
+
+ for (; i < len; i++) {
+ if (arr[i] === item) {
+ return i;
+ }
+ }
+ }
+
+ return -1;
+ };
+ }
+
+ if (!Array.prototype.filter) {
+ this.grep = function (elements, callback) {
+ var ret = [],
+ i = 0,
+ length = elements.length;
+
+ for (; i < length; i++) {
+ if (!!callback(elements[i], i)) {
+ ret.push(elements[i]);
+ }
+ }
+
+ return ret;
+ };
+ }
+
+ //--- End compatibility section ---
+
+
+ /**
+ * Start of animation specific code
+ */
+ Fx = function (elem, options, prop) {
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+ };
+ Fx.prototype = {
+
+ update: function () {
+ var styles,
+ paths = this.paths,
+ elem = this.elem,
+ elemelem = elem.element; // if destroyed, it is null
+
+ // Animation setter defined from outside
+ if (animSetters[this.prop]) {
+ animSetters[this.prop](this);
+
+ // Animating a path definition on SVGElement
+ } else if (paths && elemelem) {
+ elem.attr('d', pathAnim.step(paths[0], paths[1], this.now, this.toD));
+
+ // Other animations on SVGElement
+ } else if (elem.attr) {
+ if (elemelem) {
+ elem.attr(this.prop, this.now);
+ }
+
+ // HTML styles
+ } else {
+ styles = {};
+ styles[this.prop] = this.now + this.unit;
+ Highcharts.css(elem, styles);
+ }
+
+ if (this.options.step) {
+ this.options.step.call(this.elem, this.now, this);
+ }
+
+ },
+ custom: function (from, to, unit) {
+ var self = this,
+ t = function (gotoEnd) {
+ return self.step(gotoEnd);
+ },
+ i;
+
+ this.startTime = +new Date();
+ this.start = from;
+ this.end = to;
+ this.unit = unit;
+ this.now = this.start;
+ this.pos = this.state = 0;
+
+ t.elem = this.elem;
+
+ if (t() && timers.push(t) === 1) {
+ timerId = setInterval(function () {
+
+ for (i = 0; i < timers.length; i++) {
+ if (!timers[i]()) {
+ timers.splice(i--, 1);
+ }
+ }
+
+ if (!timers.length) {
+ clearInterval(timerId);
+ }
+ }, 13);
+ }
+ },
+
+ step: function (gotoEnd) {
+ var t = +new Date(),
+ ret,
+ done,
+ options = this.options,
+ elem = this.elem,
+ i;
+
+ if (elem.stopAnimation || (elem.attr && !elem.element)) { // #2616, element including flag is destroyed
+ ret = false;
+
+ } else if (gotoEnd || t >= options.duration + this.startTime) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ this.options.curAnim[this.prop] = true;
+
+ done = true;
+ for (i in options.curAnim) {
+ if (options.curAnim[i] !== true) {
+ done = false;
+ }
+ }
+
+ if (done) {
+ if (options.complete) {
+ options.complete.call(elem);
+ }
+ }
+ ret = false;
+
+ } else {
+ var n = t - this.startTime;
+ this.state = n / options.duration;
+ this.pos = options.easing(n, 0, 1, options.duration);
+ this.now = this.start + ((this.end - this.start) * this.pos);
+ this.update();
+ ret = true;
+ }
+ return ret;
+ }
+ };
+
+ /**
+ * The adapter animate method
+ */
+ this.animate = function (el, prop, opt) {
+ var start,
+ unit = '',
+ end,
+ fx,
+ args,
+ name;
+
+ el.stopAnimation = false; // ready for new
+
+ if (typeof opt !== 'object' || opt === null) {
+ args = arguments;
+ opt = {
+ duration: args[2],
+ easing: args[3],
+ complete: args[4]
+ };
+ }
+ if (typeof opt.duration !== 'number') {
+ opt.duration = 400;
+ }
+ opt.easing = Math[opt.easing] || Math.easeInOutSine;
+ opt.curAnim = Highcharts.extend({}, prop);
+
+ for (name in prop) {
+ fx = new Fx(el, opt, name);
+ end = null;
+
+ if (name === 'd') {
+ fx.paths = pathAnim.init(
+ el,
+ el.d,
+ prop.d
+ );
+ fx.toD = prop.d;
+ start = 0;
+ end = 1;
+ } else if (el.attr) {
+ start = el.attr(name);
+ } else {
+ start = parseFloat(HighchartsAdapter._getStyle(el, name)) || 0;
+ if (name !== 'opacity') {
+ unit = 'px';
+ }
+ }
+
+ if (!end) {
+ end = prop[name];
+ }
+ fx.custom(start, end, unit);
+ }
+ };
+ },
+
+ /**
+ * Internal method to return CSS value for given element and property
+ */
+ _getStyle: function (el, prop) {
+ return window.getComputedStyle(el, undefined).getPropertyValue(prop);
+ },
+
+ /**
+ * Add an animation setter for a specific property
+ */
+ addAnimSetter: function (prop, fn) {
+ animSetters[prop] = fn;
+ },
+
+ /**
+ * Downloads a script and executes a callback when done.
+ * @param {String} scriptLocation
+ * @param {Function} callback
+ */
+ getScript: function (scriptLocation, callback) {
+ // We cannot assume that Assets class from mootools-more is available so instead insert a script tag to download script.
+ var head = doc.getElementsByTagName('head')[0],
+ script = doc.createElement('script');
+
+ script.type = 'text/javascript';
+ script.src = scriptLocation;
+ script.onload = callback;
+
+ head.appendChild(script);
+ },
+
+ /**
+ * Return the index of an item in an array, or -1 if not found
+ */
+ inArray: function (item, arr) {
+ return arr.indexOf ? arr.indexOf(item) : emptyArray.indexOf.call(arr, item);
+ },
+
+
+ /**
+ * A direct link to adapter methods
+ */
+ adapterRun: function (elem, method) {
+ return parseInt(HighchartsAdapter._getStyle(elem, method), 10);
+ },
+
+ /**
+ * Filter an array
+ */
+ grep: function (elements, callback) {
+ return emptyArray.filter.call(elements, callback);
+ },
+
+ /**
+ * Map an array
+ */
+ map: function (arr, fn) {
+ var results = [], i = 0, len = arr.length;
+
+ for (; i < len; i++) {
+ results[i] = fn.call(arr[i], arr[i], i, arr);
+ }
+
+ return results;
+ },
+
+ /**
+ * Get the element's offset position, corrected by overflow:auto. Loosely based on jQuery's offset method.
+ */
+ offset: function (el) {
+ var docElem = document.documentElement,
+ box = el.getBoundingClientRect();
+
+ return {
+ top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),
+ left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0)
+ };
+ },
+
+ /**
+ * Add an event listener
+ */
+ addEvent: function (el, type, fn) {
+ augment(el).bind(type, fn);
+ },
+
+ /**
+ * Remove event added with addEvent
+ */
+ removeEvent: function (el, type, fn) {
+ augment(el).unbind(type, fn);
+ },
+
+ /**
+ * Fire an event on a custom object
+ */
+ fireEvent: function (el, type, eventArguments, defaultFunction) {
+ var e;
+
+ if (doc.createEvent && (el.dispatchEvent || el.fireEvent)) {
+ e = doc.createEvent('Events');
+ e.initEvent(type, true, true);
+ e.target = el;
+
+ Highcharts.extend(e, eventArguments);
+
+ if (el.dispatchEvent) {
+ el.dispatchEvent(e);
+ } else {
+ el.fireEvent(type, e);
+ }
+
+ } else if (el.HCExtended === true) {
+ eventArguments = eventArguments || {};
+ el.trigger(type, eventArguments);
+ }
+
+ if (eventArguments && eventArguments.defaultPrevented) {
+ defaultFunction = null;
+ }
+
+ if (defaultFunction) {
+ defaultFunction(eventArguments);
+ }
+ },
+
+ washMouseEvent: function (e) {
+ return e;
+ },
+
+
+ /**
+ * Stop running animation
+ */
+ stop: function (el) {
+ el.stopAnimation = true;
+ },
+
+ /**
+ * Utility for iterating over an array. Parameters are reversed compared to jQuery.
+ * @param {Array} arr
+ * @param {Function} fn
+ */
+ each: function (arr, fn) { // modern browsers
+ return Array.prototype.forEach.call(arr, fn);
+ }
+};
+}());