From e1684b4648f51d671506c38412bbe300bd58251d Mon Sep 17 00:00:00 2001 From: David Schnur Date: Mon, 27 May 2013 19:22:30 -0400 Subject: [PATCH] Remove trailing white-space. --- jquery.colorhelpers.js | 18 ++++++++--------- jquery.flot.categories.js | 24 +++++++++++----------- jquery.flot.crosshair.js | 18 ++++++++--------- jquery.flot.image.js | 30 ++++++++++++++-------------- jquery.flot.navigate.js | 42 +++++++++++++++++++-------------------- jquery.flot.resize.js | 6 +++--- jquery.flot.selection.js | 20 +++++++++---------- jquery.flot.stack.js | 22 ++++++++++---------- jquery.flot.symbol.js | 4 ++-- jquery.flot.threshold.js | 20 +++++++++---------- jquery.flot.time.js | 2 +- 11 files changed, 103 insertions(+), 103 deletions(-) diff --git a/jquery.colorhelpers.js b/jquery.colorhelpers.js index 794a3e1..9e6864a 100644 --- a/jquery.colorhelpers.js +++ b/jquery.colorhelpers.js @@ -36,13 +36,13 @@ o[c.charAt(i)] += d; return o.normalize(); }; - + o.scale = function (c, f) { for (var i = 0; i < c.length; ++i) o[c.charAt(i)] *= f; return o.normalize(); }; - + o.toString = function () { if (o.a >= 1.0) { return "rgb("+[o.r, o.g, o.b].join(",")+")"; @@ -55,7 +55,7 @@ function clamp(min, value, max) { return value < min ? min: (value > max ? max: value); } - + o.r = clamp(0, parseInt(o.r, 10), 255); o.g = clamp(0, parseInt(o.g, 10), 255); o.b = clamp(0, parseInt(o.b, 10), 255); @@ -86,10 +86,10 @@ // catch Safari's way of signalling transparent if (c == "rgba(0, 0, 0, 0)") c = "transparent"; - + return $.color.parse(c); }; - + // parse CSS color string (like "rgb(10, 32, 43)" or "#fff"), // returns color object, if parsing failed, you get black (0, 0, // 0) out @@ -100,12 +100,12 @@ res = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str); if (res) return m(parseInt(res[1], 10), parseInt(res[2], 10), parseInt(res[3], 10)); - + // Look for rgba(num,num,num,num) 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); if (res) return m(parseInt(res[1], 10), parseInt(res[2], 10), parseInt(res[3], 10), parseFloat(res[4])); - + // Look for rgb(num%,num%,num%) res = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str); if (res) @@ -115,7 +115,7 @@ 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); if (res) return m(parseFloat(res[1])*2.55, parseFloat(res[2])*2.55, parseFloat(res[3])*2.55, parseFloat(res[4])); - + // Look for #a0b1c2 res = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str); if (res) @@ -136,7 +136,7 @@ return m(res[0], res[1], res[2]); } }; - + var lookupColors = { aqua:[0,255,255], azure:[240,255,255], diff --git a/jquery.flot.categories.js b/jquery.flot.categories.js index 6e6e8ba..3158aaf 100644 --- a/jquery.flot.categories.js +++ b/jquery.flot.categories.js @@ -52,7 +52,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories. 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 @@ -60,7 +60,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories. var xCategories = series.xaxis.options.mode == "categories", yCategories = series.yaxis.options.mode == "categories"; - + if (!(xCategories || yCategories)) return; @@ -81,14 +81,14 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories. 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; } @@ -96,7 +96,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories. function getNextIndex(categories) { var index = -1; - + for (var v in categories) if (categories[v] > index) index = categories[v]; @@ -116,11 +116,11 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories. 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 || {}; @@ -132,7 +132,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories. for (var v in o) c[v] = o[v]; } - + series[axis].categories = c; } @@ -142,7 +142,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories. transformPointsOnAxis(datapoints, axis, series[axis].categories); } - + function transformPointsOnAxis(datapoints, axis, categories) { // go through the points, transforming them var points = datapoints.points, @@ -154,7 +154,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.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]; @@ -165,7 +165,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories. categories[val] = index; ++index; } - + points[i + m] = categories[val]; } } @@ -180,7 +180,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories. plot.hooks.processRawData.push(processRawData); plot.hooks.processDatapoints.push(processDatapoints); } - + $.plot.plugins.push({ init: init, options: options, diff --git a/jquery.flot.crosshair.js b/jquery.flot.crosshair.js index c5df9d9..ff81d46 100644 --- a/jquery.flot.crosshair.js +++ b/jquery.flot.crosshair.js @@ -66,7 +66,7 @@ The plugin also adds four public methods: lineWidth: 1 } }; - + function init(plot) { // position of crosshair in pixels var crosshair = { x: -1, y: -1, locked: false }; @@ -79,12 +79,12 @@ The plugin also adds four public methods: crosshair.x = Math.max(0, Math.min(o.left, plot.width())); crosshair.y = Math.max(0, Math.min(o.top, plot.height())); } - + plot.triggerRedrawOverlay(); }; - + plot.clearCrosshair = plot.setCrosshair; // passes null for pos - + plot.lockCrosshair = function lockCrosshair(pos) { if (pos) plot.setCrosshair(pos); @@ -108,18 +108,18 @@ The plugin also adds four public methods: function onMouseMove(e) { if (crosshair.locked) return; - + if (plot.getSelection && plot.getSelection()) { crosshair.x = -1; // hide the crosshair while selecting return; } - + var offset = plot.offset(); crosshair.x = Math.max(0, Math.min(e.pageX - offset.left, plot.width())); crosshair.y = Math.max(0, Math.min(e.pageY - offset.top, plot.height())); plot.triggerRedrawOverlay(); } - + plot.hooks.bindEvents.push(function (plot, eventHolder) { if (!plot.getOptions().crosshair.mode) return; @@ -134,7 +134,7 @@ The plugin also adds four public methods: return; var plotOffset = plot.getPlotOffset(); - + ctx.save(); ctx.translate(plotOffset.left, plotOffset.top); @@ -166,7 +166,7 @@ The plugin also adds four public methods: eventHolder.unbind("mousemove", onMouseMove); }); } - + $.plot.plugins.push({ init: init, options: options, diff --git a/jquery.flot.image.js b/jquery.flot.image.js index 80e86c2..fbe1b5a 100644 --- a/jquery.flot.image.js +++ b/jquery.flot.image.js @@ -69,11 +69,11 @@ Google Maps). var urls = [], points = []; var defaultShow = options.series.images.show; - + $.each(series, function (i, s) { if (!(defaultShow || s.images.show)) return; - + if (s.data) s = s.data; @@ -95,7 +95,7 @@ Google Maps). callback(); }); }; - + $.plot.image.load = function (urls, callback) { var missing = urls.length, loaded = {}; if (missing == 0) @@ -104,9 +104,9 @@ Google Maps). $.each(urls, function (i, url) { var handler = function () { --missing; - + loaded[url] = this; - + if (missing == 0) callback(loaded); }; @@ -114,16 +114,16 @@ Google Maps). $('').load(handler).error(handler).attr('src', url); }); }; - + function drawSeries(plot, ctx, series) { var plotOffset = plot.getPlotOffset(); - + if (!series.images || !series.images.show) return; - + var points = series.datapoints.points, ps = series.datapoints.pointsize; - + for (var i = 0; i < points.length; i += ps) { var img = points[i], x1 = points[i + 1], y1 = points[i + 2], @@ -147,7 +147,7 @@ Google Maps). y2 = y1; y1 = tmp; } - + // if the anchor is at the center of the pixel, expand the // image by 1/2 pixel in each direction if (series.images.anchor == "center") { @@ -158,7 +158,7 @@ Google Maps). y1 -= tmp; y2 += tmp; } - + // clip if (x1 == x2 || y1 == y2 || x1 >= xaxis.max || x2 <= xaxis.min || @@ -185,12 +185,12 @@ Google Maps). sy1 += (sy1 - sy2) * (yaxis.max - y2) / (y2 - y1); y2 = yaxis.max; } - + x1 = xaxis.p2c(x1); x2 = xaxis.p2c(x2); y1 = yaxis.p2c(y1); y2 = yaxis.p2c(y2); - + // the transformation may have swapped us if (x1 > x2) { tmp = x2; @@ -226,12 +226,12 @@ Google Maps). { y: true, number: true, required: true } ]; } - + function init(plot) { plot.hooks.processRawData.push(processRawData); plot.hooks.drawSeries.push(drawSeries); } - + $.plot.plugins.push({ init: init, options: options, diff --git a/jquery.flot.navigate.js b/jquery.flot.navigate.js index 10256b8..73d3306 100644 --- a/jquery.flot.navigate.js +++ b/jquery.flot.navigate.js @@ -87,7 +87,7 @@ can set the default in the options. jquery.event.drag.js ~ v1.5 ~ Copyright (c) 2008, Three Dub Media (http://threedubmedia.com) Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-LICENSE.txt */ -(function(a){function e(h){var k,j=this,l=h.data||{};if(l.elem)j=h.dragTarget=l.elem,h.dragProxy=d.proxy||j,h.cursorOffsetX=l.pageX-l.left,h.cursorOffsetY=l.pageY-l.top,h.offsetX=h.pageX-h.cursorOffsetX,h.offsetY=h.pageY-h.cursorOffsetY;else if(d.dragging||l.which>0&&h.which!=l.which||a(h.target).is(l.not))return;switch(h.type){case"mousedown":return a.extend(l,a(j).offset(),{elem:j,target:h.target,pageX:h.pageX,pageY:h.pageY}),b.add(document,"mousemove mouseup",e,l),i(j,!1),d.dragging=null,!1;case!d.dragging&&"mousemove":if(g(h.pageX-l.pageX)+g(h.pageY-l.pageY)0&&h.which!=l.which||a(h.target).is(l.not))return;switch(h.type){case"mousedown":return a.extend(l,a(j).offset(),{elem:j,target:h.target,pageX:h.pageX,pageY:h.pageY}),b.add(document,"mousemove mouseup",e,l),i(j,!1),d.dragging=null,!1;case!d.dragging&&"mousemove":if(g(h.pageX-l.pageX)+g(h.pageY-l.pageY) max) { @@ -263,14 +263,14 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L ((zr[0] != null && range < zr[0]) || (zr[1] != null && range > zr[1]))) return; - + opts.min = min; opts.max = max; }); - + plot.setupGrid(); plot.draw(); - + if (!args.preventEvent) plot.getPlaceholder().trigger("plotzoom", [ plot, args ]); }; @@ -296,7 +296,7 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L var pr = opts.panRange; if (pr === false) // no panning on this axis return; - + if (pr) { // check whether we hit the wall if (pr[0] != null && pr[0] > min) { @@ -304,21 +304,21 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L min += d; max += d; } - + if (pr[1] != null && pr[1] < max) { d = pr[1] - max; min += d; max += d; } } - + opts.min = min; opts.max = max; }); - + plot.setupGrid(); plot.draw(); - + if (!args.preventEvent) plot.getPlaceholder().trigger("plotpan", [ plot, args ]); }; @@ -332,11 +332,11 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L if (panTimeout) clearTimeout(panTimeout); } - + plot.hooks.bindEvents.push(bindEvents); plot.hooks.shutdown.push(shutdown); } - + $.plot.plugins.push({ init: init, options: options, diff --git a/jquery.flot.resize.js b/jquery.flot.resize.js index 6b2c5d4..3276243 100644 --- a/jquery.flot.resize.js +++ b/jquery.flot.resize.js @@ -38,7 +38,7 @@ can just fix the size of their placeholders. plot.setupGrid(); plot.draw(); } - + function bindEvents(plot, eventHolder) { plot.getPlaceholder().resize(onResize); } @@ -46,11 +46,11 @@ can just fix the size of their placeholders. function shutdown(plot, eventHolder) { plot.getPlaceholder().unbind("resize", onResize); } - + plot.hooks.bindEvents.push(bindEvents); plot.hooks.shutdown.push(shutdown); } - + $.plot.plugins.push({ init: init, options: options, diff --git a/jquery.flot.selection.js b/jquery.flot.selection.js index c5fa038..2d18d29 100644 --- a/jquery.flot.selection.js +++ b/jquery.flot.selection.js @@ -94,11 +94,11 @@ The plugin allso adds the following methods to the plot object: var savedhandlers = {}; var mouseUpHandler = null; - + function onMouseMove(e) { if (selection.active) { updateSelection(e); - + plot.getPlaceholder().trigger("plotselecting", [ getSelection() ]); } } @@ -106,7 +106,7 @@ The plugin allso adds the following methods to the plot object: function onMouseDown(e) { if (e.which != 1) // only accept left-click return; - + // cancel out any text selections document.body.focus(); @@ -127,13 +127,13 @@ The plugin allso adds the following methods to the plot object: // this is a bit silly, but we have to use a closure to be // able to whack the same handler again mouseUpHandler = function (e) { onMouseUp(e); }; - + $(document).one("mouseup", mouseUpHandler); } function onMouseUp(e) { mouseUpHandler = null; - + // revert drag stuff for old-school browsers if (document.onselectstart !== undefined) document.onselectstart = savedhandlers.onselectstart; @@ -158,7 +158,7 @@ The plugin allso adds the following methods to the plot object: function getSelection() { if (!selectionIsSane()) return null; - + if (!selection.show) return null; var r = {}, c1 = selection.first, c2 = selection.second; @@ -252,10 +252,10 @@ The plugin allso adds the following methods to the plot object: from = to; to = tmp; } - + return { from: from, to: to, axis: axis }; } - + function setSelection(ranges, preventEvent) { var axis, range, o = plot.getOptions(); @@ -333,11 +333,11 @@ The plugin allso adds the following methods to the plot object: ctx.restore(); } }); - + plot.hooks.shutdown.push(function (plot, eventHolder) { eventHolder.unbind("mousemove", onMouseMove); eventHolder.unbind("mousedown", onMouseDown); - + if (mouseUpHandler) $(document).unbind("mouseup", mouseUpHandler); }); diff --git a/jquery.flot.stack.js b/jquery.flot.stack.js index 3d148bf..f75aaff 100644 --- a/jquery.flot.stack.js +++ b/jquery.flot.stack.js @@ -39,21 +39,21 @@ charts or filled areas). var options = { series: { stack: null } // or number/string }; - + function init(plot) { function findMatchingSeries(s, allseries) { var res = null; for (var i = 0; i < allseries.length; ++i) { if (s == allseries[i]) break; - + if (allseries[i].stack == s.stack) res = allseries[i]; } - + return res; } - + function stackData(plot, s, datapoints) { if (s.stack == null || s.stack === false) return; @@ -118,7 +118,7 @@ charts or filled areas). newpoints[l + accumulateOffset] += qy; bottom = qy; - + i += ps; j += otherps; } @@ -142,22 +142,22 @@ charts or filled areas). i += ps; continue; } - + for (m = 0; m < ps; ++m) newpoints.push(points[i + m]); - + // we might be able to interpolate a point below, // this can give us a better y if (withlines && j > 0 && otherpoints[j - otherps] != null) bottom = qy + (otherpoints[j - otherps + accumulateOffset] - qy) * (px - qx) / (otherpoints[j - otherps + keyOffset] - qx); newpoints[l + accumulateOffset] += bottom; - + i += ps; } fromgap = false; - + if (l != newpoints.length && withbottom) newpoints[l + 2] += bottom; } @@ -175,10 +175,10 @@ charts or filled areas). datapoints.points = newpoints; } - + plot.hooks.processDatapoints.push(stackData); } - + $.plot.plugins.push({ init: init, options: options, diff --git a/jquery.flot.symbol.js b/jquery.flot.symbol.js index cc181ff..3263656 100644 --- a/jquery.flot.symbol.js +++ b/jquery.flot.symbol.js @@ -58,11 +58,11 @@ The symbols are accessed as strings through the standard symbol options: if (handlers[s]) series.points.symbol = handlers[s]; } - + function init(plot) { plot.hooks.processDatapoints.push(processRawData); } - + $.plot.plugins.push({ init: init, name: 'symbols', diff --git a/jquery.flot.threshold.js b/jquery.flot.threshold.js index 2f6e635..a847d33 100644 --- a/jquery.flot.threshold.js +++ b/jquery.flot.threshold.js @@ -46,7 +46,7 @@ You may need to check for this in hover events. var options = { series: { threshold: null } // or { below: number, color: color spec} }; - + function init(plot) { function thresholdData(plot, s, datapoints, below, color) { var ps = datapoints.pointsize, i, x, y, p, prevp, @@ -58,7 +58,7 @@ You may need to check for this in hover events. thresholded.threshold = null; thresholded.originSeries = s; thresholded.data = []; - + var origpoints = datapoints.points, addCrossingPoints = s.lines.show; @@ -83,7 +83,7 @@ You may need to check for this in hover events. prevp.push(below); for (m = 2; m < ps; ++m) prevp.push(origpoints[i + m]); - + p.push(null); // start new segment p.push(null); for (m = 2; m < ps; ++m) @@ -102,25 +102,25 @@ You may need to check for this in hover events. datapoints.points = newpoints; thresholded.datapoints.points = threspoints; - + if (thresholded.datapoints.points.length > 0) { var origIndex = $.inArray(s, plot.getData()); // Insert newly-generated series right after original one (to prevent it from becoming top-most) plot.getData().splice(origIndex + 1, 0, thresholded); } - + // FIXME: there are probably some edge cases left in bars } - + function processThresholds(plot, s, datapoints) { if (!s.threshold) return; - + if (s.threshold instanceof Array) { s.threshold.sort(function(a, b) { return a.below - b.below; }); - + $(s.threshold).each(function(i, th) { thresholdData(plot, s, datapoints, th.below, th.color); }); @@ -129,10 +129,10 @@ You may need to check for this in hover events. thresholdData(plot, s, datapoints, s.threshold.below, s.threshold.color); } } - + plot.hooks.processDatapoints.push(processThresholds); } - + $.plot.plugins.push({ init: init, options: options, diff --git a/jquery.flot.time.js b/jquery.flot.time.js index 69b65be..4cc8325 100644 --- a/jquery.flot.time.js +++ b/jquery.flot.time.js @@ -158,7 +158,7 @@ API.txt for details. return makeUtcWrapper(new Date(ts)); } } - + // map of app. size of time units in milliseconds var timeUnitSize = {