[Code Style] Run gulp fixstyle

...to apply code style settings from #142.
This commit is contained in:
Victor Woeltjen
2016-05-19 11:29:13 -07:00
parent f12b9704d9
commit fa77139077
440 changed files with 1885 additions and 1662 deletions

View File

@@ -64,7 +64,7 @@ define(
function makeMockDomainObject(id) {
var mockObject = jasmine.createSpyObj(
'domainObject-' + id,
[ 'getId', 'getModel', 'getCapability' ]
['getId', 'getModel', 'getCapability']
);
mockObject.getId.andReturn(id);
mockObject.getModel.andReturn({ name: "Point " + id});
@@ -74,11 +74,11 @@ define(
beforeEach(function () {
mockScope = jasmine.createSpyObj(
'$scope',
[ "$on", "$watch", "commit" ]
["$on", "$watch", "commit"]
);
mockHandler = jasmine.createSpyObj(
'telemetryHandler',
[ 'handle' ]
['handle']
);
mockQ = jasmine.createSpyObj('$q', ['when']);
mockDialogService = jasmine.createSpyObj(
@@ -87,11 +87,11 @@ define(
);
mockFormatter = jasmine.createSpyObj(
'telemetryFormatter',
[ 'formatDomainValue', 'formatRangeValue' ]
['formatDomainValue', 'formatRangeValue']
);
mockDomainObject = jasmine.createSpyObj(
'domainObject',
[ 'getId', 'getModel', 'getCapability' ]
['getId', 'getModel', 'getCapability']
);
mockHandle = jasmine.createSpyObj(
'subscription',
@@ -106,10 +106,10 @@ define(
);
mockEvent = jasmine.createSpyObj(
'event',
[ 'preventDefault' ]
['preventDefault']
);
testGrid = [ 123, 456 ];
testGrid = [123, 456];
testModel = {
composition: ['a', 'b', 'c'],
layoutGrid: testGrid
@@ -136,7 +136,7 @@ define(
mockScope.configuration = testConfiguration;
mockScope.selection = jasmine.createSpyObj(
'selection',
[ 'select', 'get', 'selected', 'deselect', 'proxy' ]
['select', 'get', 'selected', 'deselect', 'proxy']
);
controller = new FixedController(
@@ -418,7 +418,7 @@ define(
expect(controller.selected().style).toEqual(oldStyle);
// Drag a little
controller.moveHandle().continueDrag([ 1000, 100 ]);
controller.moveHandle().continueDrag([1000, 100]);
// Style should have been updated
expect(controller.selected().style).not.toEqual(oldStyle);

View File

@@ -24,7 +24,7 @@ define(
['../src/FixedDragHandle'],
function (FixedDragHandle) {
var TEST_GRID_SIZE = [ 13, 33 ];
var TEST_GRID_SIZE = [13, 33];
describe("A fixed position drag handle", function () {
var mockElementHandle,
@@ -35,7 +35,7 @@ define(
beforeEach(function () {
mockElementHandle = jasmine.createSpyObj(
'elementHandle',
[ 'x', 'y' ]
['x', 'y']
);
mockUpdate = jasmine.createSpy('update');
mockCommit = jasmine.createSpy('commit');
@@ -61,13 +61,13 @@ define(
it("allows handles to be dragged", function () {
handle.startDrag();
handle.continueDrag([ 16, 8 ]);
handle.continueDrag([16, 8]);
// Should update x/y, snapped to grid
expect(mockElementHandle.x).toHaveBeenCalledWith(7);
expect(mockElementHandle.y).toHaveBeenCalledWith(8);
handle.continueDrag([ -16, -35 ]);
handle.continueDrag([-16, -35]);
// Should have interpreted relative to initial state
expect(mockElementHandle.x).toHaveBeenCalledWith(5);
@@ -84,4 +84,4 @@ define(
});
}
);
);

View File

@@ -34,7 +34,7 @@ define(
mockComposition,
mockCompositionObjects;
function mockPromise(value){
function mockPromise(value) {
return {
then: function (thenFunc) {
return mockPromise(thenFunc(value));
@@ -42,12 +42,12 @@ define(
};
}
function mockDomainObject(id){
function mockDomainObject(id) {
return {
getId: function() {
getId: function () {
return id;
},
useCapability: function() {
useCapability: function () {
return mockCompositionCapability;
}
};
@@ -56,11 +56,11 @@ define(
beforeEach(function () {
mockScope = jasmine.createSpyObj(
"$scope",
[ "$watch", "$watchCollection", "$on", "commit" ]
["$watch", "$watchCollection", "$on", "commit"]
);
mockEvent = jasmine.createSpyObj(
'event',
[ 'preventDefault' ]
['preventDefault']
);
testModel = {};
@@ -238,7 +238,7 @@ define(
var styleB;
// Start with a very small frame size
testModel.layoutGrid = [ 1, 1 ];
testModel.layoutGrid = [1, 1];
// White-boxy; we know which watch is which
mockScope.$watch.calls[0].args[1](testModel.layoutGrid);
@@ -255,7 +255,7 @@ define(
var style;
// Start with a very small frame size
testModel.layoutGrid = [ 1, 1 ];
testModel.layoutGrid = [1, 1];
mockScope.$watch.calls[0].args[1](testModel.layoutGrid);
// Notify that a drop occurred

View File

@@ -26,56 +26,56 @@ define(
describe("A Layout drag handler", function () {
var testPosition = {
position: [ 8, 11 ],
dimensions: [ 3, 2 ]
position: [8, 11],
dimensions: [3, 2]
};
it("changes position by a supplied factor, rounding by grid size", function () {
var handler = new LayoutDrag(
testPosition,
[ 1, 1 ],
[ 0, 0 ],
[ 10, 20 ]
[1, 1],
[0, 0],
[10, 20]
);
expect(handler.getAdjustedPosition([ 37, 84 ])).toEqual({
position: [ 12, 15 ],
dimensions: [ 3, 2 ]
expect(handler.getAdjustedPosition([37, 84])).toEqual({
position: [12, 15],
dimensions: [3, 2]
});
expect(handler.getAdjustedPosition([ -37, 84 ])).toEqual({
position: [ 4, 15 ],
dimensions: [ 3, 2 ]
expect(handler.getAdjustedPosition([-37, 84])).toEqual({
position: [4, 15],
dimensions: [3, 2]
});
});
it("changes dimensions by a supplied factor, rounding by grid size", function () {
var handler = new LayoutDrag(
testPosition,
[ 0, 0 ],
[ 1, 1 ],
[ 10, 20 ]
[0, 0],
[1, 1],
[10, 20]
);
expect(handler.getAdjustedPosition([ 37, 84 ])).toEqual({
position: [ 8, 11 ],
dimensions: [ 7, 6 ]
expect(handler.getAdjustedPosition([37, 84])).toEqual({
position: [8, 11],
dimensions: [7, 6]
});
});
it("allows mixing dimension and position factors", function () {
var handler = new LayoutDrag(
testPosition,
[ 0, 1 ],
[ -1, 0 ],
[ 10, 20 ]
[0, 1],
[-1, 0],
[10, 20]
);
expect(handler.getAdjustedPosition([ 11, 84 ])).toEqual({
position: [ 8, 15 ],
dimensions: [ 2, 2 ]
expect(handler.getAdjustedPosition([11, 84])).toEqual({
position: [8, 15],
dimensions: [2, 2]
});
});
});
}
);
);

View File

@@ -37,7 +37,7 @@ define(
height: 24,
fill: "transparent"
};
testElements = [ {}, {}, testElement, {} ];
testElements = [{}, {}, testElement, {}];
proxy = new BoxProxy(
testElement,
testElements.indexOf(testElement),

View File

@@ -24,8 +24,8 @@ define(
['../../src/elements/ElementFactory'],
function (ElementFactory) {
var DIALOG_ELEMENTS = [ 'image', 'text' ],
NON_DIALOG_ELEMENTS = [ 'box', 'line' ];
var DIALOG_ELEMENTS = ['image', 'text'],
NON_DIALOG_ELEMENTS = ['box', 'line'];
describe("The fixed position element factory", function () {
var mockDialogService,
@@ -35,11 +35,11 @@ define(
beforeEach(function () {
mockDialogService = jasmine.createSpyObj(
'dialogService',
[ 'getUserInput' ]
['getUserInput']
);
mockPromise = jasmine.createSpyObj(
'promise',
[ 'then' ]
['then']
);
mockDialogService.getUserInput.andReturn(mockPromise);
@@ -66,4 +66,4 @@ define(
});
});
}
);
);

View File

@@ -37,7 +37,7 @@ define(
width: 42,
height: 24
};
testElements = [ {}, {}, testElement, {} ];
testElements = [{}, {}, testElement, {}];
proxy = new ElementProxy(
testElement,
testElements.indexOf(testElement),

View File

@@ -37,7 +37,7 @@ define(
height: 24,
url: "http://www.nasa.gov"
};
testElements = [ {}, {}, testElement, {} ];
testElements = [{}, {}, testElement, {}];
proxy = new ImageProxy(
testElement,
testElements.indexOf(testElement),

View File

@@ -70,4 +70,4 @@ define(
});
}
);
);

View File

@@ -92,4 +92,4 @@ define(
});
}
);
);

View File

@@ -75,4 +75,4 @@ define(
});
}
);
);

View File

@@ -38,7 +38,7 @@ define(
height: 24,
id: "test-id"
};
testElements = [ {}, {}, testElement, {} ];
testElements = [{}, {}, testElement, {}];
proxy = new TelemetryProxy(
testElement,
testElements.indexOf(testElement),

View File

@@ -37,7 +37,7 @@ define(
height: 24,
fill: "transparent"
};
testElements = [ {}, {}, testElement, {} ];
testElements = [{}, {}, testElement, {}];
proxy = new TextProxy(
testElement,
testElements.indexOf(testElement),