Skip to content

Commit 2daa656

Browse files
committed
lint -> function() not function ()
1 parent abeae11 commit 2daa656

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+229
-216
lines changed

devtools/image_viewer/viewer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function createButton(imageName) {
3737
button.style.height = '40px';
3838
button.innerHTML = imageName;
3939

40-
button.addEventListener('click', function () {
40+
button.addEventListener('click', function() {
4141
var imgBaseline = createImg(dirBaseline, imageName),
4242
imgTest = createImg(dirTest, imageName),
4343
imgDiff = createImg(dirDiff, 'diff-' + imageName);

devtools/test_dashboard/buttons.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ anchor.style.width = '1000px';
1313

1414
function plotButtons(plots, figDir) {
1515

16-
Object.keys(plots).forEach(function (plotname) {
16+
Object.keys(plots).forEach(function(plotname) {
1717

1818
var button = document.createElement('button');
1919

@@ -25,7 +25,7 @@ function plotButtons(plots, figDir) {
2525

2626
plotlist.appendChild(button);
2727

28-
button.addEventListener('click', function () {
28+
button.addEventListener('click', function() {
2929

3030
var myImage = new Image();
3131
myImage.src = figDir + plotname + '.png';
@@ -90,7 +90,7 @@ function plotButtons(plots, figDir) {
9090
var myImage = new Image();
9191
myImage.src = dataURL;
9292

93-
myImage.onload = function () {
93+
myImage.onload = function() {
9494
myImage.height = scene.container.clientHeight;
9595
myImage.width = scene.container.clientWidth;
9696
};
@@ -114,17 +114,17 @@ function plotButtons(plots, figDir) {
114114
var mock = require('@mocks/gl3d_marker-color.json');
115115
var statusDiv = document.getElementById('status-info');
116116

117-
pummelButton.addEventListener('click', function () {
118-
setInterval(function () {
117+
pummelButton.addEventListener('click', function() {
118+
setInterval(function() {
119119
var plotDiv = document.createElement('div');
120120
window.plotDiv = plotDiv;
121121

122122
plotDiv.id = 'div' + i;
123123
document.body.appendChild(plotDiv);
124124

125-
Plotly.plot(plotDiv, mock.data, mock.layout, {staticPlot: true}).then(function () {
125+
Plotly.plot(plotDiv, mock.data, mock.layout, {staticPlot: true}).then(function() {
126126

127-
Plotly.Plots.getSubplotIds(plotDiv._fullLayout, 'gl3d').forEach(function (key) {
127+
Plotly.Plots.getSubplotIds(plotDiv._fullLayout, 'gl3d').forEach(function(key) {
128128
var scene = plotDiv._fullLayout[key]._scene;
129129
scene.destroy();
130130
i ++;
@@ -146,7 +146,7 @@ function plotButtons(plots, figDir) {
146146
scrapeButton.style.background = 'blue';
147147
plotlist.appendChild(scrapeButton);
148148

149-
scrapeButton.addEventListener('click', function () {
149+
scrapeButton.addEventListener('click', function() {
150150
Plotly.Snapshot.toSVG(Tabs.get());
151151
return;
152152
});

src/components/colorbar/draw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ module.exports = function draw(gd, id) {
500500
}
501501

502502
// setter/getters for every item defined in opts
503-
Object.keys(opts).forEach(function (name) {
503+
Object.keys(opts).forEach(function(name) {
504504
component[name] = function(v) {
505505
// getter
506506
if(!arguments.length) return opts[name];

src/components/errorbars/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = function(traceIn, traceOut, defaultColor, opts) {
2121
containerOut = traceOut[objName] = {},
2222
containerIn = traceIn[objName] || {};
2323

24-
function coerce (attr, dflt) {
24+
function coerce(attr, dflt) {
2525
return Lib.coerce(containerIn, containerOut, attributes, attr, dflt);
2626
}
2727

src/components/modebar/buttons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ modeBarButtons.toImage = {
8383
ev.clean();
8484
});
8585

86-
ev.once('error', function (err) {
86+
ev.once('error', function(err) {
8787
gd._snapshotInProgress = false;
8888

8989
Lib.notifier('Sorry there was a problem downloading your ' + format, 'long');

src/components/modebar/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ proto.updateButtons = function(buttons) {
102102
* Empty div for containing a group of buttons
103103
* @Return {HTMLelement}
104104
*/
105-
proto.createGroup = function () {
105+
proto.createGroup = function() {
106106
var group = document.createElement('div');
107107
group.className = 'modebar-group';
108108

@@ -114,7 +114,7 @@ proto.createGroup = function () {
114114
* @Param {object} config (see ./buttons.js for more info)
115115
* @Return {HTMLelement}
116116
*/
117-
proto.createButton = function (config) {
117+
proto.createButton = function(config) {
118118
var _this = this,
119119
button = document.createElement('a');
120120

@@ -162,7 +162,7 @@ proto.createButton = function (config) {
162162
* @Param {string} thisIcon.path
163163
* @Return {HTMLelement}
164164
*/
165-
proto.createIcon = function (thisIcon) {
165+
proto.createIcon = function(thisIcon) {
166166
var iconHeight = thisIcon.ascent - thisIcon.descent,
167167
svgNS = 'http://www.w3.org/2000/svg',
168168
icon = document.createElementNS(svgNS, 'svg'),
@@ -216,7 +216,7 @@ proto.updateActiveButton = function(buttonClicked) {
216216
* @Param {object} buttons 2d array of grouped button config objects
217217
* @Return {boolean}
218218
*/
219-
proto.hasButtons = function (buttons) {
219+
proto.hasButtons = function(buttons) {
220220
var currentButtons = this.buttons;
221221

222222
if(!currentButtons) return false;

src/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ lib.syncOrAsync = function(sequence, arg, finalStep) {
303303
* Helper to strip trailing slash, from
304304
* http://stackoverflow.com/questions/6680825/return-string-without-trailing-slash
305305
*/
306-
lib.stripTrailingSlash = function (str) {
306+
lib.stripTrailingSlash = function(str) {
307307
if (str.substr(-1) === '/') return str.substr(0, str.length - 1);
308308
return str;
309309
};

src/lib/matrix.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ exports.dot = function(x, y) {
6767
};
6868

6969
// translate by (x,y)
70-
exports.translationMatrix = function (x, y) {
70+
exports.translationMatrix = function(x, y) {
7171
return [[1, 0, x], [0, 1, y], [0, 0, 1]];
7272
};
7373

7474
// rotate by alpha around (0,0)
75-
exports.rotationMatrix = function (alpha) {
75+
exports.rotationMatrix = function(alpha) {
7676
var a = alpha*Math.PI/180;
7777
return [[Math.cos(a), -Math.sin(a), 0],
7878
[Math.sin(a), Math.cos(a), 0],

src/lib/queue.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var Plotly = require('../plotly');
1818
* @param args
1919
* @returns {Array}
2020
*/
21-
function copyArgArray (gd, args) {
21+
function copyArgArray(gd, args) {
2222
var copy = [];
2323
var arg;
2424

@@ -188,7 +188,7 @@ queue.redo = function redo(gd) {
188188
* @param func
189189
* @param args
190190
*/
191-
queue.plotDo = function (gd, func, args) {
191+
queue.plotDo = function(gd, func, args) {
192192
gd.autoplay = true;
193193

194194
// this *won't* copy gd and it preserves `undefined` properties!

src/lib/show_no_webgl_msg.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
var Plotly = require('../plotly');
1313

14+
var noop = function() {};
15+
16+
1417
/**
1518
* Prints a no webgl error message into the scene container
1619
* @param {scene instance} scene
@@ -19,13 +22,11 @@ var Plotly = require('../plotly');
1922
*
2023
*/
2124
module.exports = function showWebGlMsg(scene) {
22-
var noop = function () {};
23-
2425
for(var prop in scene) {
2526
if (typeof scene[prop] === 'function') scene[prop] = noop;
2627
}
2728

28-
scene.destroy = function () {
29+
scene.destroy = function() {
2930
scene.container.parentNode.removeChild(scene.container);
3031
};
3132

@@ -37,7 +38,7 @@ module.exports = function showWebGlMsg(scene) {
3738

3839
scene.container.appendChild(div);
3940
scene.container.style.background = '#FFFFFF';
40-
scene.container.onclick = function () {
41+
scene.container.onclick = function() {
4142
window.open('http://get.webgl.org');
4243
};
4344

0 commit comments

Comments
 (0)