From fce863fc1ec119e4c4cb4a500562423920c1eb58 Mon Sep 17 00:00:00 2001
From: "A. Svensson"
Date: Tue, 19 May 2015 19:57:56 +0200
Subject: [PATCH] Removed the js graph crap.
---
src/static/css/style.css | 19 -
src/static/js/jquery.flot.categories.js | 191 --
src/static/js/jquery.flot.js | 3168 ------------------
src/static/js/jquery.flot.time.js | 432 ---
src/templates/gameservers/server_detail.html | 78 +-
5 files changed, 1 insertion(+), 3887 deletions(-)
delete mode 100644 src/static/js/jquery.flot.categories.js
delete mode 100644 src/static/js/jquery.flot.js
delete mode 100644 src/static/js/jquery.flot.time.js
diff --git a/src/static/css/style.css b/src/static/css/style.css
index 0043eee..36f796f 100644
--- a/src/static/css/style.css
+++ b/src/static/css/style.css
@@ -82,25 +82,6 @@ body {
width: 25%;
}
-#weekly_history {
- width:100%;
- height:200px;
-}
-
-#weekday_averages {
- width:100%;
- height:200px;
-}
-
-#tooltip {
- position: absolute;
- display: none;
- border: 1px solid #fdd;
- padding: 2px;
- background-color: #fee;
- opacity: 0.80;
-}
-
/* Footer *********************************************************************/
#bottom_footer {
font-size: 11px;
diff --git a/src/static/js/jquery.flot.categories.js b/src/static/js/jquery.flot.categories.js
deleted file mode 100644
index a1b4c2f..0000000
--- a/src/static/js/jquery.flot.categories.js
+++ /dev/null
@@ -1,191 +0,0 @@
-/* Flot plugin for plotting textual data or categories.
-
-Copyright (c) 2007-2014 IOLA and Ole Laursen.
-Licensed under the MIT license.
-
-Consider a dataset like [["February", 34], ["March", 20], ...]. This plugin
-allows you to plot such a dataset directly.
-
-To enable it, you must specify mode: "categories" on the axis with the textual
-labels, e.g.
-
- $.plot("#placeholder", data, { xaxis: { mode: "categories" } });
-
-By default, the labels are ordered as they are met in the data series. If you
-need a different ordering, you can specify "categories" on the axis options
-and list the categories there:
-
- xaxis: {
- mode: "categories",
- categories: ["February", "March", "April"]
- }
-
-If you need to customize the distances between the categories, you can specify
-"categories" as an object mapping labels to values
-
- xaxis: {
- mode: "categories",
- categories: { "February": 1, "March": 3, "April": 4 }
- }
-
-If you don't specify all categories, the remaining categories will be numbered
-from the max value plus 1 (with a spacing of 1 between each).
-
-Internally, the plugin works by transforming the input data through an auto-
-generated mapping where the first category becomes 0, the second 1, etc.
-Hence, a point like ["February", 34] becomes [0, 34] internally in Flot (this
-is visible in hover and click events that return numbers rather than the
-category labels). The plugin also overrides the tick generator to spit out the
-categories as ticks instead of the values.
-
-If you need to map a value back to its label, the mapping is always accessible
-as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
-
-*/
-
-(function ($) {
- var options = {
- xaxis: {
- categories: null
- },
- yaxis: {
- categories: null
- }
- };
-
- function processRawData(plot, series, data, datapoints) {
- // if categories are enabled, we need to disable
- // auto-transformation to numbers so the strings are intact
- // for later processing
-
- var xCategories = series.xaxis.options.mode == "categories",
- yCategories = series.yaxis.options.mode == "categories";
-
- if (!(xCategories || yCategories))
- return;
-
- var format = datapoints.format;
-
- if (!format) {
- // FIXME: auto-detection should really not be defined here
- var s = series;
- format = [];
- format.push({ x: true, number: true, required: true });
- format.push({ y: true, number: true, required: true });
-
- if (s.bars.show || (s.lines.show && s.lines.fill)) {
- var autoscale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero));
- format.push({ y: true, number: true, required: false, defaultValue: 0, autoscale: autoscale });
- if (s.bars.horizontal) {
- delete format[format.length - 1].y;
- format[format.length - 1].x = true;
- }
- }
-
- datapoints.format = format;
- }
-
- for (var m = 0; m < format.length; ++m) {
- if (format[m].x && xCategories)
- format[m].number = false;
-
- if (format[m].y && yCategories)
- format[m].number = false;
- }
- }
-
- function getNextIndex(categories) {
- var index = -1;
-
- for (var v in categories)
- if (categories[v] > index)
- index = categories[v];
-
- return index + 1;
- }
-
- function categoriesTickGenerator(axis) {
- var res = [];
- for (var label in axis.categories) {
- var v = axis.categories[label];
- if (v >= axis.min && v <= axis.max)
- res.push([v, label]);
- }
-
- res.sort(function (a, b) { return a[0] - b[0]; });
-
- return res;
- }
-
- function setupCategoriesForAxis(series, axis, datapoints) {
- if (series[axis].options.mode != "categories")
- return;
-
- if (!series[axis].categories) {
- // parse options
- var c = {}, o = series[axis].options.categories || {};
- if ($.isArray(o)) {
- for (var i = 0; i < o.length; ++i)
- c[o[i]] = i;
- }
- else {
- for (var v in o)
- c[v] = o[v];
- }
-
- series[axis].categories = c;
- }
-
- // fix ticks
- if (!series[axis].options.ticks)
- series[axis].options.ticks = categoriesTickGenerator;
-
- transformPointsOnAxis(datapoints, axis, series[axis].categories);
- }
-
- function transformPointsOnAxis(datapoints, axis, categories) {
- // go through the points, transforming them
- var points = datapoints.points,
- ps = datapoints.pointsize,
- format = datapoints.format,
- formatColumn = axis.charAt(0),
- index = getNextIndex(categories);
-
- for (var i = 0; i < points.length; i += ps) {
- if (points[i] == null)
- continue;
-
- for (var m = 0; m < ps; ++m) {
- var val = points[i + m];
-
- if (val == null || !format[m][formatColumn])
- continue;
-
- if (!(val in categories)) {
- categories[val] = index;
- ++index;
- }
-
- points[i + m] = categories[val];
- }
- }
- }
-
- function processDatapoints(plot, series, datapoints) {
- setupCategoriesForAxis(series, "xaxis", datapoints);
- setupCategoriesForAxis(series, "yaxis", datapoints);
- }
-
- function init(plot) {
- plot.hooks.processRawData.push(processRawData);
- plot.hooks.processDatapoints.push(processDatapoints);
- }
-
- $.plot.plugins.push({
- init: init,
- options: options,
- name: 'categories',
- version: '1.0'
- });
-})(jQuery);
-
diff --git a/src/static/js/jquery.flot.js b/src/static/js/jquery.flot.js
deleted file mode 100644
index 39f3e4c..0000000
--- a/src/static/js/jquery.flot.js
+++ /dev/null
@@ -1,3168 +0,0 @@
-/* Javascript plotting library for jQuery, version 0.8.3.
-
-Copyright (c) 2007-2014 IOLA and Ole Laursen.
-Licensed under the MIT license.
-
-*/
-
-// first an inline dependency, jquery.colorhelpers.js, we inline it here
-// for convenience
-
-/* Plugin for jQuery for working with colors.
- *
- * Version 1.1.
- *
- * Inspiration from jQuery color animation plugin by John Resig.
- *
- * Released under the MIT license by Ole Laursen, October 2009.
- *
- * Examples:
- *
- * $.color.parse("#fff").scale('rgb', 0.25).add('a', -0.5).toString()
- * var c = $.color.extract($("#mydiv"), 'background-color');
- * console.log(c.r, c.g, c.b, c.a);
- * $.color.make(100, 50, 25, 0.4).toString() // returns "rgba(100,50,25,0.4)"
- *
- * Note that .scale() and .add() return the same modified object
- * instead of making a new one.
- *
- * V. 1.1: Fix error handling so e.g. parsing an empty string does
- * produce a color rather than just crashing.
- */
-(function($){$.color={};$.color.make=function(r,g,b,a){var o={};o.r=r||0;o.g=g||0;o.b=b||0;o.a=a!=null?a:1;o.add=function(c,d){for(var i=0;i=1){return"rgb("+[o.r,o.g,o.b].join(",")+")"}else{return"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"}};o.normalize=function(){function clamp(min,value,max){return valuemax?max:value}o.r=clamp(0,parseInt(o.r),255);o.g=clamp(0,parseInt(o.g),255);o.b=clamp(0,parseInt(o.b),255);o.a=clamp(0,o.a,1);return o};o.clone=function(){return $.color.make(o.r,o.b,o.g,o.a)};return o.normalize()};$.color.extract=function(elem,css){var c;do{c=elem.css(css).toLowerCase();if(c!=""&&c!="transparent")break;elem=elem.parent()}while(elem.length&&!$.nodeName(elem.get(0),"body"));if(c=="rgba(0, 0, 0, 0)")c="transparent";return $.color.parse(c)};$.color.parse=function(str){var res,m=$.color.make;if(res=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10));if(res=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10),parseFloat(res[4]));if(res=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55);if(res=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55,parseFloat(res[4]));if(res=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))return m(parseInt(res[1],16),parseInt(res[2],16),parseInt(res[3],16));if(res=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))return m(parseInt(res[1]+res[1],16),parseInt(res[2]+res[2],16),parseInt(res[3]+res[3],16));var name=$.trim(str).toLowerCase();if(name=="transparent")return m(255,255,255,0);else{res=lookupColors[name]||[0,0,0];return m(res[0],res[1],res[2])}};var lookupColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
-
-// the actual Flot code
-(function($) {
-
- // Cache the prototype hasOwnProperty for faster access
-
- var hasOwnProperty = Object.prototype.hasOwnProperty;
-
- // A shim to provide 'detach' to jQuery versions prior to 1.4. Using a DOM
- // operation produces the same effect as detach, i.e. removing the element
- // without touching its jQuery data.
-
- // Do not merge this into Flot 0.9, since it requires jQuery 1.4.4+.
-
- if (!$.fn.detach) {
- $.fn.detach = function() {
- return this.each(function() {
- if (this.parentNode) {
- this.parentNode.removeChild( this );
- }
- });
- };
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // The Canvas object is a wrapper around an HTML5
-
Players
@@ -56,84 +55,9 @@
Weekly history
-
+
Average per day
-
-
-
-
-
-
-
{% endblock %}