[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

@@ -28,8 +28,8 @@ define(
["../../src/gestures/ContextMenuGesture"],
function (ContextMenuGesture) {
var JQLITE_FUNCTIONS = [ "on", "off", "find", "append", "remove" ],
DOMAIN_OBJECT_METHODS = [ "getId", "getModel", "getCapability", "hasCapability", "useCapability"];
var JQLITE_FUNCTIONS = ["on", "off", "find", "append", "remove"],
DOMAIN_OBJECT_METHODS = ["getId", "getModel", "getCapability", "hasCapability", "useCapability"];
describe("The 'context menu' gesture", function () {
@@ -55,15 +55,15 @@ define(
mockEvent = jasmine.createSpyObj("event", ["preventDefault"]);
mockContextMenuAction = jasmine.createSpyObj(
"action",
[ "perform", "getActions" ]
["perform", "getActions"]
);
mockActionContext = {domainObject: mockDomainObject, event: mockEvent};
mockDomainObject.getCapability.andReturn(mockContextMenuAction);
mockContextMenuAction.perform.andReturn(jasmine.any(Function));
mockAgentService.isMobile.andReturn(false);
gesture = new ContextMenuGesture(mockTimeout, mockAgentService, mockElement, mockDomainObject);
// Capture the contextmenu callback
@@ -90,7 +90,7 @@ define(
mockDomainObject.calls
);
});
it("attaches a callback for context menu events on mobile", function () {
// Mock touch event and set to mobile device
mockTouchEvent = jasmine.createSpyObj("event", ["preventDefault", "touches"]);
@@ -98,21 +98,21 @@ define(
mockTouch.length = 1;
mockTouchEvent.touches.andReturn(mockTouch);
mockAgentService.isMobile.andReturn(true);
// Then create new (mobile) gesture
gesture = new ContextMenuGesture(mockTimeout, mockAgentService, mockElement, mockDomainObject);
// Set calls for the touchstart and touchend gestures
fireTouchStartGesture = mockElement.on.calls[1].args[1];
fireTouchEndGesture = mockElement.on.mostRecentCall.args[1];
// Fire touchstart and expect touch start to begin
fireTouchStartGesture(mockTouchEvent);
expect(mockElement.on).toHaveBeenCalledWith(
"touchstart",
jasmine.any(Function)
);
// Expect timeout to begin and then fireTouchEnd
expect(mockTimeout).toHaveBeenCalled();
mockTimeout.mostRecentCall.args[0]();
@@ -120,4 +120,4 @@ define(
});
});
}
);
);

View File

@@ -27,10 +27,10 @@ define(
["../../src/gestures/DragGesture", "../../src/gestures/GestureConstants"],
function (DragGesture, GestureConstants) {
var JQLITE_FUNCTIONS = [ "on", "off", "attr", "removeAttr" ],
LOG_FUNCTIONS = [ "error", "warn", "info", "debug"],
DND_FUNCTIONS = [ "setData", "getData", "removeData" ],
DOMAIN_OBJECT_METHODS = [ "getId", "getModel", "getCapability", "hasCapability", "useCapability"],
var JQLITE_FUNCTIONS = ["on", "off", "attr", "removeAttr"],
LOG_FUNCTIONS = ["error", "warn", "info", "debug"],
DND_FUNCTIONS = ["setData", "getData", "removeData"],
DOMAIN_OBJECT_METHODS = ["getId", "getModel", "getCapability", "hasCapability", "useCapability"],
TEST_ID = "test-id";
@@ -135,4 +135,4 @@ define(
});
}
);
);

View File

@@ -29,8 +29,8 @@ define(
// Methods to mock
var JQLITE_FUNCTIONS = [ "on", "off", "attr", "removeAttr", "scope" ],
DOMAIN_OBJECT_METHODS = [ "getId", "getModel", "getCapability", "hasCapability", "useCapability"],
var JQLITE_FUNCTIONS = ["on", "off", "attr", "removeAttr", "scope"],
DOMAIN_OBJECT_METHODS = ["getId", "getModel", "getCapability", "hasCapability", "useCapability"],
TEST_ID = "test-id",
DROP_ID = "drop-id";
@@ -69,9 +69,9 @@ define(
mockElement = jasmine.createSpyObj("element", JQLITE_FUNCTIONS);
mockDomainObject = jasmine.createSpyObj("domainObject", DOMAIN_OBJECT_METHODS);
mockDraggedObject = jasmine.createSpyObj("draggedObject", DOMAIN_OBJECT_METHODS);
mockPersistence = jasmine.createSpyObj("persistence", [ "persist" ]);
mockPersistence = jasmine.createSpyObj("persistence", ["persist"]);
mockEvent = jasmine.createSpyObj("event", ["preventDefault"]);
mockEvent.dataTransfer = jasmine.createSpyObj("dataTransfer", [ "getData" ]);
mockEvent.dataTransfer = jasmine.createSpyObj("dataTransfer", ["getData"]);
mockScope = jasmine.createSpyObj("$scope", ["$broadcast"]);
mockUnwrappedElement = jasmine.createSpyObj("unwrapped", ["getBoundingClientRect"]);
mockAction = jasmine.createSpyObj('action', ['getActions']);
@@ -130,11 +130,11 @@ define(
expect(mockEvent.preventDefault).toHaveBeenCalled();
expect(mockEvent.dataTransfer.dropEffect).toBeDefined();
});
it("invokes compose on drop in edit mode", function () {
// Set the mockDomainObject to have the editor capability
mockDomainObject.hasCapability.andReturn(true);
callbacks.dragover(mockEvent);
expect(mockAction.getActions).toHaveBeenCalledWith({
key: 'compose',
@@ -143,14 +143,14 @@ define(
callbacks.drop(mockEvent);
expect(mockCompose.perform).toHaveBeenCalled();
});
it("does not invoke compose on drop in browse mode for non-folders", function () {
// Set the mockDomainObject to not have the editor capability
mockDomainObject.hasCapability.andReturn(false);
// Set the mockDomainObject to not have a type of folder
mockDomainObject.getModel.andReturn({type: 'notAFolder'});
callbacks.dragover(mockEvent);
expect(mockAction.getActions).toHaveBeenCalledWith({
key: 'compose',
@@ -159,8 +159,8 @@ define(
callbacks.drop(mockEvent);
expect(mockCompose.perform).not.toHaveBeenCalled();
});
it("invokes compose on drop in browse mode for folders", function () {
// Set the mockDomainObject to not have the editor capability
mockDomainObject.hasCapability.andReturn(false);
@@ -175,11 +175,11 @@ define(
callbacks.drop(mockEvent);
expect(mockCompose.perform).toHaveBeenCalled();
});
it("broadcasts drop position (in edit mode)", function () {
// Set the mockDomainObject to have the editor capability
mockDomainObject.hasCapability.andReturn(true);
testRect.left = 42;
testRect.top = 36;
mockEvent.pageX = 52;

View File

@@ -27,9 +27,9 @@ define(
["../../src/gestures/GestureProvider"],
function (GestureProvider) {
var JQLITE_FUNCTIONS = [ "on", "off", "attr", "removeAttr" ],
var JQLITE_FUNCTIONS = ["on", "off", "attr", "removeAttr"],
GESTURE_KEYS = ["a", "b", "c", "d", "e"],
DOMAIN_OBJECT_METHODS = [ "getId", "getModel", "getCapability", "hasCapability", "useCapability"];
DOMAIN_OBJECT_METHODS = ["getId", "getModel", "getCapability", "hasCapability", "useCapability"];
describe("The gesture provider", function () {
var mockGestures,
@@ -86,4 +86,4 @@ define(
});
});
}
);
);

View File

@@ -33,11 +33,11 @@ define(
beforeEach(function () {
mockGestureService = jasmine.createSpyObj(
"gestureService",
[ "attachGestures" ]
["attachGestures"]
);
mockGestureHandle = jasmine.createSpyObj(
"gestureHandle",
[ "destroy" ]
["destroy"]
);
mockElement = { someKey: "some value" };
@@ -62,7 +62,7 @@ define(
expect(mockGestureService.attachGestures).toHaveBeenCalledWith(
mockElement,
domainObject,
[ "a", "b", "c" ]
["a", "b", "c"]
);
// Should not have been destroyed yet...
@@ -77,4 +77,4 @@ define(
});
}
);
);