[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

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

View File

@@ -99,7 +99,7 @@ define(
mockScope = jasmine.createSpyObj(
"$scope",
[ '$watch', '$on' ]
['$watch', '$on']
);
mockLoader = jasmine.createSpyObj('objectLoader', ['load']);
mockDomainObject = mockA;
@@ -245,4 +245,4 @@ define(
});
}
);
);

View File

@@ -61,7 +61,9 @@ define(
mockTimespan.getDuration.andReturn(50);
mockTimespan.getEnd.andReturn(150);
mockToPixels.andCallFake(function (t) { return t * 10; });
mockToPixels.andCallFake(function (t) {
return t * 10;
});
controller = new TimelineGanttController(TEST_MAX_OFFSCREEN);
});
@@ -96,4 +98,4 @@ define(
});
}
);
);

View File

@@ -32,7 +32,7 @@ define(
beforeEach(function () {
mockScope = jasmine.createSpyObj(
'$scope',
[ '$watchCollection' ]
['$watchCollection']
);
testResources = [
{ key: 'abc', name: "Some name" },
@@ -58,7 +58,7 @@ define(
// Supply new parameters
mockScope.$watchCollection.mostRecentCall.args[1]({
graphs: [ mockGraphA, mockGraphB ],
graphs: [mockGraphA, mockGraphB],
origin: 9,
duration: 144
});

View File

@@ -38,7 +38,7 @@ define(
// This controller's job is just to expose the formatter
// in scope, so simply verify that the two agree.
it("formats durations", function () {
[ 0, 100, 4123, 93600, 748801230012].forEach(function (n) {
[0, 100, 4123, 93600, 748801230012].forEach(function (n) {
expect(controller.niceTime(n))
.toEqual(formatter.format(n));
});

View File

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

View File

@@ -90,7 +90,9 @@ define(
mockScope.domainObject.getCapability.andCallFake(function (c) {
if (c === 'editor') {
return {
inEditContext: function () {return true;}
inEditContext: function () {
return true;
}
};
}
});

View File

@@ -35,19 +35,19 @@ define(
beforeEach(function () {
mockDragHandler = jasmine.createSpyObj(
'dragHandler',
[ 'start' ]
['start']
);
mockSnapHandler = jasmine.createSpyObj(
'snapHandler',
[ 'snap' ]
['snap']
);
mockDomainObject = jasmine.createSpyObj(
'domainObject',
[ 'getCapability', 'getId' ]
['getCapability', 'getId']
);
mockType = jasmine.createSpyObj(
'type',
[ 'instanceOf' ]
['instanceOf']
);
mockDomainObject.getId.andReturn('test-id');

View File

@@ -81,15 +81,15 @@ define(
['a', 'b', 'c', 'd', 'e', 'f'].forEach(function (id, index) {
mockTimespans[id] = jasmine.createSpyObj(
'timespan-' + id,
[ 'getStart', 'getEnd', 'getDuration', 'setStart', 'setEnd', 'setDuration' ]
['getStart', 'getEnd', 'getDuration', 'setStart', 'setEnd', 'setDuration']
);
mockPersists[id] = jasmine.createSpyObj(
'persistence-' + id,
[ 'persist' ]
['persist']
);
mockMutations[id] = jasmine.createSpyObj(
'mutation-' + id,
[ 'mutate' ]
['mutate']
);
mockTimespans[id].getStart.andReturn(index * 1000);
mockTimespans[id].getDuration.andReturn(4000 + index);
@@ -225,4 +225,4 @@ define(
});
}
);
);

View File

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

View File

@@ -33,15 +33,15 @@ define(
beforeEach(function () {
mockDragHandler = jasmine.createSpyObj(
'dragHandler',
[ 'end', 'persist' ]
['end', 'persist']
);
mockSnapHandler = jasmine.createSpyObj(
'snapHandler',
[ 'snap' ]
['snap']
);
mockZoomController = jasmine.createSpyObj(
'zoom',
[ 'toMillis', 'toPixels' ]
['toMillis', 'toPixels']
);
mockDragHandler.end.andReturn(12321);
@@ -112,4 +112,4 @@ define(
});
}
);
);

View File

@@ -33,15 +33,15 @@ define(
beforeEach(function () {
mockDragHandler = jasmine.createSpyObj(
'dragHandler',
[ 'start', 'duration', 'end', 'move', 'persist' ]
['start', 'duration', 'end', 'move', 'persist']
);
mockSnapHandler = jasmine.createSpyObj(
'snapHandler',
[ 'snap' ]
['snap']
);
mockZoomController = jasmine.createSpyObj(
'zoom',
[ 'toMillis', 'toPixels' ]
['toMillis', 'toPixels']
);
mockDragHandler.start.andReturn(12321);
@@ -179,4 +179,4 @@ define(
});
}
);
);

View File

@@ -34,7 +34,7 @@ define(
mockDragHandler = jasmine.createSpyObj(
'dragHandler',
[ 'start', 'end', 'ids' ]
['start', 'end', 'ids']
);
mockDragHandler.ids.andReturn(['a', 'b', 'c', 'd']);
@@ -76,4 +76,4 @@ define(
});
}
);
);

View File

@@ -33,15 +33,15 @@ define(
beforeEach(function () {
mockDragHandler = jasmine.createSpyObj(
'dragHandler',
[ 'start', 'persist' ]
['start', 'persist']
);
mockSnapHandler = jasmine.createSpyObj(
'snapHandler',
[ 'snap' ]
['snap']
);
mockZoomController = jasmine.createSpyObj(
'zoom',
[ 'toMillis', 'toPixels' ]
['toMillis', 'toPixels']
);
mockDragHandler.start.andReturn(12321);
@@ -111,4 +111,4 @@ define(
});
}
);
);

View File

@@ -48,9 +48,9 @@ define(
beforeEach(function () {
testResources = {
a: [ 'xyz', 'abc' ],
b: [ 'xyz' ],
c: [ 'xyz', 'abc', 'def', 'ghi' ]
a: ['xyz', 'abc'],
b: ['xyz'],
c: ['xyz', 'abc', 'def', 'ghi']
};
mockQ = jasmine.createSpyObj('$q', ['when', 'all']);
@@ -58,16 +58,16 @@ define(
mockSwimlanes = ['a', 'b', 'c'].map(function (k) {
var mockSwimlane = jasmine.createSpyObj(
'swimlane-' + k,
[ 'graph', 'color' ]
['graph', 'color']
),
mockGraph = jasmine.createSpyObj(
'graph-' + k,
[ 'getPointCount', 'getDomainValue', 'getRangeValue' ]
['getPointCount', 'getDomainValue', 'getRangeValue']
);
mockSwimlane.graph.andReturn(true);
mockSwimlane.domainObject = jasmine.createSpyObj(
'domainObject-' + k,
[ 'getCapability', 'hasCapability', 'useCapability', 'getId' ]
['getCapability', 'hasCapability', 'useCapability', 'getId']
);
mockSwimlane.color.andReturn('#' + k);
// Provide just enough information about graphs to support
@@ -148,4 +148,4 @@ define(
});
}
);
);

View File

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

View File

@@ -42,9 +42,9 @@ define(
beforeEach(function () {
testColors = {
a: [ 0, 1, 0 ],
b: [ 1, 0, 1 ],
c: [ 1, 0, 0 ]
a: [0, 1, 0],
b: [1, 0, 1],
c: [1, 0, 0]
};
mockGraphs = [];
@@ -53,11 +53,11 @@ define(
['a', 'b', 'c'].forEach(function (k, i) {
var mockGraph = jasmine.createSpyObj(
'utilization-' + k,
[ 'getPointCount', 'getDomainValue', 'getRangeValue' ]
['getPointCount', 'getDomainValue', 'getRangeValue']
);
mockDomainObjects[k] = jasmine.createSpyObj(
'domainObject-' + k,
[ 'getCapability', 'useCapability' ]
['getCapability', 'useCapability']
);
mockDomainObjects[k].useCapability.andReturn(asPromise({
testResource: mockGraph
@@ -72,7 +72,7 @@ define(
mockRenderer = jasmine.createSpyObj(
'renderer',
[ 'render', 'decode' ]
['render', 'decode']
);
mockRenderer.render.andCallFake(function (utilization) {
@@ -167,4 +167,4 @@ define(
});
}
);
);

View File

@@ -49,10 +49,14 @@ define(
var colors = {}, i, ids = [];
// Add item to set
function set(c) { colors[c] = true; }
function set(c) {
colors[c] = true;
}
// Generate ids
for (i = 0; i < 30; i += 1) { ids.push("id" + i); }
for (i = 0; i < 30; i += 1) {
ids.push("id" + i);
}
// Assign colors to each id, then retrieve colors,
// storing into the set

View File

@@ -38,16 +38,16 @@ define(
);
mockSelection = jasmine.createSpyObj(
'selection',
[ 'get' ]
['get']
);
mockActionCapability = jasmine.createSpyObj(
'action',
[ 'getActions' ]
['getActions']
);
mockActions = ['a', 'b', 'c'].map(function (type) {
var mockAction = jasmine.createSpyObj(
'action-' + type,
[ 'perform', 'getMetadata' ]
['perform', 'getMetadata']
);
mockAction.getMetadata.andReturn({ type: type });
return mockAction;

View File

@@ -43,7 +43,7 @@ define(
mockSwimlane.domainObject = jasmine.createSpyObj(
'domainObject',
[ 'getCapability', 'getModel' ]
['getCapability', 'getModel']
);
mockCapabilities.mutation = jasmine.createSpyObj(
@@ -158,11 +158,11 @@ define(
it("fires the 'remove' action when remove is called", function () {
var mockChild = jasmine.createSpyObj(
'childObject',
[ 'getCapability', 'getModel' ]
['getCapability', 'getModel']
),
mockAction = jasmine.createSpyObj(
'action',
[ 'perform' ]
['perform']
);
mockChild.getCapability.andCallFake(function (c) {

View File

@@ -41,28 +41,28 @@ define(
mockSwimlane = jasmine.createSpyObj(
"swimlane",
[ "highlight", "highlightBottom" ]
["highlight", "highlightBottom"]
);
// domainObject, idPath, children, expanded
mockSwimlane.domainObject = jasmine.createSpyObj(
"domainObject",
[ "getId", "getCapability", "useCapability", "hasCapability" ]
["getId", "getCapability", "useCapability", "hasCapability"]
);
mockSwimlane.idPath = [ 'a', 'b' ];
mockSwimlane.children = [ {} ];
mockSwimlane.idPath = ['a', 'b'];
mockSwimlane.children = [{}];
mockSwimlane.expanded = true;
mockSwimlane.parent = {};
mockSwimlane.parent.idPath = ['a'];
mockSwimlane.parent.domainObject = jasmine.createSpyObj(
"domainObject",
[ "getId", "getCapability", "useCapability", "hasCapability" ]
["getId", "getCapability", "useCapability", "hasCapability"]
);
mockSwimlane.parent.children = [ mockSwimlane ];
mockSwimlane.parent.children = [mockSwimlane];
mockSwimlane.children[0].domainObject = jasmine.createSpyObj(
"domainObject",
[ "getId", "getCapability", "useCapability", "hasCapability" ]
["getId", "getCapability", "useCapability", "hasCapability"]
);
mockAction = jasmine.createSpyObj('action', ['perform']);
@@ -73,11 +73,11 @@ define(
mockOtherObject = jasmine.createSpyObj(
"domainObject",
[ "getId", "getCapability", "useCapability", "hasCapability" ]
["getId", "getCapability", "useCapability", "hasCapability"]
);
mockActionCapability = jasmine.createSpyObj("action", ["perform", "getActions"]);
mockPersistence = jasmine.createSpyObj("persistence", ["persist"]);
mockContext = jasmine.createSpyObj('context', [ 'getParent' ]);
mockContext = jasmine.createSpyObj('context', ['getParent']);
mockActionCapability.getActions.andReturn([mockAction]);
mockSwimlane.parent.domainObject.getId.andReturn('a');
@@ -152,7 +152,7 @@ define(
});
it("inserts into when highlighted", function () {
var testModel = { composition: [ 'c' ] };
var testModel = { composition: ['c'] };
mockSwimlane.highlight.andReturn(true);
handler.drop('d', mockOtherObject);
// Should have mutated
@@ -167,7 +167,7 @@ define(
});
it("inserts after as a peer when highlighted at the bottom", function () {
var testModel = { composition: [ 'x', 'b', 'y' ] };
var testModel = { composition: ['x', 'b', 'y'] };
mockSwimlane.highlightBottom.andReturn(true);
mockSwimlane.expanded = false;
handler.drop('d', mockOtherObject);
@@ -177,11 +177,11 @@ define(
// Run the mutator
mockSwimlane.parent.domainObject.useCapability.mostRecentCall
.args[1](testModel);
expect(testModel.composition).toEqual([ 'x', 'b', 'd', 'y']);
expect(testModel.composition).toEqual(['x', 'b', 'd', 'y']);
});
it("inserts into when highlighted at the bottom and expanded", function () {
var testModel = { composition: [ 'c' ] };
var testModel = { composition: ['c'] };
mockSwimlane.highlightBottom.andReturn(true);
mockSwimlane.expanded = true;
handler.drop('d', mockOtherObject);
@@ -191,11 +191,11 @@ define(
// Run the mutator
mockSwimlane.domainObject.useCapability.mostRecentCall
.args[1](testModel);
expect(testModel.composition).toEqual([ 'd', 'c' ]);
expect(testModel.composition).toEqual(['d', 'c']);
});
it("inserts after as a peer when highlighted at the bottom and childless", function () {
var testModel = { composition: [ 'x', 'b', 'y' ] };
var testModel = { composition: ['x', 'b', 'y'] };
mockSwimlane.highlightBottom.andReturn(true);
mockSwimlane.expanded = true;
mockSwimlane.children = [];
@@ -206,11 +206,11 @@ define(
// Run the mutator
mockSwimlane.parent.domainObject.useCapability.mostRecentCall
.args[1](testModel);
expect(testModel.composition).toEqual([ 'x', 'b', 'd', 'y']);
expect(testModel.composition).toEqual(['x', 'b', 'd', 'y']);
});
it("allows reordering within a parent", function () {
var testModel = { composition: [ 'x', 'b', 'y', 'd' ] };
var testModel = { composition: ['x', 'b', 'y', 'd'] };
mockSwimlane.highlightBottom.andReturn(true);
mockSwimlane.expanded = true;
@@ -227,7 +227,7 @@ define(
runs(function () {
mockSwimlane.parent.domainObject.useCapability.mostRecentCall
.args[1](testModel);
expect(testModel.composition).toEqual([ 'x', 'b', 'd', 'y']);
expect(testModel.composition).toEqual(['x', 'b', 'd', 'y']);
});
});

View File

@@ -36,7 +36,9 @@ define(
testConfiguration;
function asPromise(v) {
return { then: function (cb) { cb(v); } };
return { then: function (cb) {
cb(v);
} };
}
beforeEach(function () {
@@ -218,4 +220,4 @@ define(
});
});
}
);
);