Commit fcc7c16b authored by Nick Schonning's avatar Nick Schonning

JSCS: Remove space between function and bracket

parent 67dce054
......@@ -43,7 +43,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
*/
(function ($) {
(function($) {
var options = {
xaxis: {
categories: null
......@@ -121,7 +121,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
}
}
res.sort(function (a, b) { return a[0] - b[0]; });
res.sort(function(a, b) { return a[0] - b[0]; });
return res;
}
......
......@@ -40,7 +40,7 @@ The plugin also adds four public methods:
Example usage:
var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } };
$("#graph").bind( "plothover", function ( evt, position, item ) {
$("#graph").bind( "plothover", function( evt, position, item ) {
if ( item ) {
// Lock the crosshair to the data point being hovered
myFlot.lockCrosshair({
......@@ -58,7 +58,7 @@ The plugin also adds four public methods:
Free the crosshair to move again after locking it.
*/
(function ($) {
(function($) {
var options = {
crosshair: {
......@@ -124,7 +124,7 @@ The plugin also adds four public methods:
plot.triggerRedrawOverlay();
}
plot.hooks.bindEvents.push(function (plot, eventHolder) {
plot.hooks.bindEvents.push(function(plot, eventHolder) {
if (!plot.getOptions().crosshair.mode) {
return;
}
......@@ -133,7 +133,7 @@ The plugin also adds four public methods:
eventHolder.mousemove(onMouseMove);
});
plot.hooks.drawOverlay.push(function (plot, ctx) {
plot.hooks.drawOverlay.push(function(plot, ctx) {
var c = plot.getOptions().crosshair;
if (!c.mode) {
return;
......@@ -167,7 +167,7 @@ The plugin also adds four public methods:
ctx.restore();
});
plot.hooks.shutdown.push(function (plot, eventHolder) {
plot.hooks.shutdown.push(function(plot, eventHolder) {
eventHolder.unbind("mouseout", onMouseOut);
eventHolder.unbind("mousemove", onMouseMove);
});
......
......@@ -62,7 +62,7 @@ shadowSize and lineWidth are derived as well from the points series.
*/
(function ($) {
(function($) {
var options = {
series: {
points: {
......@@ -377,7 +377,7 @@ shadowSize and lineWidth are derived as well from the points series.
ctx.save();
ctx.translate(plotOffset.left, plotOffset.top);
$.each(plot.getData(), function (i, s) {
$.each(plot.getData(), function(i, s) {
if (s.points.errorbars && (s.points.xerr.show || s.points.yerr.show)) {
drawSeriesErrors(plot, ctx, s);
}
......
......@@ -29,7 +29,7 @@ jquery.flot.stack.js plugin, possibly some code could be shared.
*/
(function ($) {
(function($) {
var options = {
series: {
......
......@@ -52,7 +52,7 @@ Google Maps).
*/
(function ($) {
(function($) {
var options = {
series: {
images: {
......@@ -65,12 +65,12 @@ Google Maps).
$.plot.image = {};
$.plot.image.loadDataImages = function (series, options, callback) {
$.plot.image.loadDataImages = function(series, options, callback) {
var urls = [], points = [];
var defaultShow = options.series.images.show;
$.each(series, function (i, s) {
$.each(series, function(i, s) {
if (!(defaultShow || s.images.show)) {
return;
}
......@@ -79,7 +79,7 @@ Google Maps).
s = s.data;
}
$.each(s, function (i, p) {
$.each(s, function(i, p) {
if (typeof p[0] === "string") {
urls.push(p[0]);
points.push(p);
......@@ -87,8 +87,8 @@ Google Maps).
});
});
$.plot.image.load(urls, function (loadedImages) {
$.each(points, function (i, p) {
$.plot.image.load(urls, function(loadedImages) {
$.each(points, function(i, p) {
var url = p[0];
if (loadedImages[url]) {
p[0] = loadedImages[url];
......@@ -99,14 +99,14 @@ Google Maps).
});
};
$.plot.image.load = function (urls, callback) {
$.plot.image.load = function(urls, callback) {
var missing = urls.length, loaded = {};
if (missing === 0) {
callback({});
}
$.each(urls, function (i, url) {
var handler = function () {
$.each(urls, function(i, url) {
var handler = function() {
--missing;
loaded[url] = this;
......
This diff is collapsed.
......@@ -79,7 +79,7 @@ can set the default in the options.
*/
(function ($) {
(function($) {
var options = {
xaxis: {
zoomRange: null, // or [number, number] (min range, max range)
......@@ -137,7 +137,7 @@ can set the default in the options.
return;
}
panTimeout = setTimeout(function () {
panTimeout = setTimeout(function() {
plot.pan({ left: prevPageX - e.pageX,
top: prevPageY - e.pageY });
prevPageX = e.pageX;
......@@ -172,7 +172,7 @@ can set the default in the options.
}
}
plot.zoomOut = function (args) {
plot.zoomOut = function(args) {
if (!args) {
args = {};
}
......@@ -185,7 +185,7 @@ can set the default in the options.
plot.zoom(args);
};
plot.zoom = function (args) {
plot.zoom = function(args) {
if (!args) {
args = {};
}
......@@ -260,7 +260,7 @@ can set the default in the options.
}
};
plot.pan = function (args) {
plot.pan = function(args) {
var delta = {
x: +args.left,
y: +args.top
......@@ -273,7 +273,7 @@ can set the default in the options.
delta.y = 0;
}
$.each(plot.getAxes(), function (_, axis) {
$.each(plot.getAxes(), function(_, axis) {
var opts = axis.options,
min = axis.c2p(axis.p2c(axis.min) + d),
......
......@@ -11,7 +11,7 @@ can just fix the size of their placeholders.
*/
(function ($) {
(function($) {
var options = { }; // no options
function init(plot) {
......
......@@ -78,7 +78,7 @@ The plugin allso adds the following methods to the plot object:
*/
(function ($) {
(function($) {
function init(plot) {
var selection = {
......@@ -124,11 +124,11 @@ The plugin allso adds the following methods to the plot object:
// prevent text selection and drag in old-school browsers
if (document.onselectstart !== undefined && savedhandlers.onselectstart === null) {
savedhandlers.onselectstart = document.onselectstart;
document.onselectstart = function () { return false; };
document.onselectstart = function() { return false; };
}
if (document.ondrag !== undefined && savedhandlers.ondrag === null) {
savedhandlers.ondrag = document.ondrag;
document.ondrag = function () { return false; };
document.ondrag = function() { return false; };
}
setSelectionPos(selection.first, e);
......@@ -137,7 +137,7 @@ 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); };
mouseUpHandler = function(e) { onMouseUp(e); };
$(document).one(selection.touch ? "touchend" : "mouseup", mouseUpHandler);
}
......@@ -179,7 +179,7 @@ The plugin allso adds the following methods to the plot object:
c1 = selection.first,
c2 = selection.second;
$.each(plot.getAxes(), function (name, axis) {
$.each(plot.getAxes(), function(name, axis) {
if (axis.used) {
var p1 = axis.c2p(c1[axis.direction]),
p2 = axis.c2p(c2[axis.direction]);
......@@ -339,7 +339,7 @@ The plugin allso adds the following methods to the plot object:
});
plot.hooks.drawOverlay.push(function (plot, ctx) {
plot.hooks.drawOverlay.push(function(plot, ctx) {
// draw selection
if (selection.show && selectionIsSane()) {
var plotOffset = plot.getPlotOffset();
......@@ -367,7 +367,7 @@ The plugin allso adds the following methods to the plot object:
}
});
plot.hooks.shutdown.push(function (plot, eventHolder) {
plot.hooks.shutdown.push(function(plot, eventHolder) {
eventHolder.unbind("mousemove", onMouseMove);
eventHolder.unbind("mousedown", onMouseDown);
if (mouseUpHandler) {
......
......@@ -35,7 +35,7 @@ charts or filled areas).
*/
(function ($) {
(function($) {
var options = {
series: { stack: null } // or number/string
};
......
......@@ -13,18 +13,18 @@ The symbols are accessed as strings through the standard symbol options:
*/
(function ($) {
(function($) {
function processRawData(plot, series) {
// we normalize the area of each symbol so it is approximately the
// same as a circle of the given radius
var handlers = {
square: function (ctx, x, y, radius) {
square: function(ctx, x, y, radius) {
// pi * r^2 = (2s)^2 => s = r * sqrt(pi)/2
var size = radius * Math.sqrt(Math.PI) / 2;
ctx.rect(x - size, y - size, size + size, size + size);
},
diamond: function (ctx, x, y, radius) {
diamond: function(ctx, x, y, radius) {
// pi * r^2 = 2s^2 => s = r * sqrt(pi/2)
var size = radius * Math.sqrt(Math.PI / 2);
ctx.moveTo(x - size, y);
......@@ -33,7 +33,7 @@ The symbols are accessed as strings through the standard symbol options:
ctx.lineTo(x, y + size);
ctx.lineTo(x - size, y);
},
triangle: function (ctx, x, y, radius, shadow) {
triangle: function(ctx, x, y, radius, shadow) {
// pi * r^2 = 1/2 * s^2 * sin (pi / 3) => s = r * sqrt(2 * pi / sin(pi / 3))
var size = radius * Math.sqrt(2 * Math.PI / Math.sin(Math.PI / 3));
var height = size * Math.sin(Math.PI / 3);
......@@ -44,7 +44,7 @@ The symbols are accessed as strings through the standard symbol options:
ctx.lineTo(x - size/2, y + height/2);
}
},
cross: function (ctx, x, y, radius) {
cross: function(ctx, x, y, radius) {
// pi * r^2 = (2s)^2 => s = r * sqrt(pi)/2
var size = radius * Math.sqrt(Math.PI) / 2;
ctx.moveTo(x - size, y - size);
......
......@@ -43,7 +43,7 @@ You may need to check for this in hover events.
*/
(function ($) {
(function($) {
var options = {
series: { threshold: null } // or { below: number, color: color spec}
};
......
......@@ -226,7 +226,7 @@ API.txt for details.
[1, "year"]]);
function init(plot) {
plot.hooks.processOptions.push(function (plot) {
plot.hooks.processOptions.push(function(plot) {
$.each(plot.getAxes(), function(axisName, axis) {
var opts = axis.options;
......@@ -385,7 +385,7 @@ API.txt for details.
return ticks;
};
axis.tickFormatter = function (v, axis) {
axis.tickFormatter = function(v, axis) {
var d = dateGenerator(v, axis.options);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment