Commit df84961e authored by Robert Knight's avatar Robert Knight

Require trailing commas on multi-line array/object literals

Add an ESLint rule to require this and fix up non-conforming code using
ESLint's --fix tool.
parent 697758b7
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
"rules": { "rules": {
"array-callback-return": "error", "array-callback-return": "error",
"block-scoped-var": "error", "block-scoped-var": "error",
"comma-dangle": ["error", "always-multiline"],
"consistent-return": "error", "consistent-return": "error",
"curly": "error", "curly": "error",
"dot-notation": "error", "dot-notation": "error",
......
...@@ -293,7 +293,7 @@ function runKarma(baseConfig, opts, done) { ...@@ -293,7 +293,7 @@ function runKarma(baseConfig, opts, done) {
client: { client: {
mocha: { mocha: {
grep: taskArgs.grep, grep: taskArgs.grep,
} },
}, },
}; };
......
...@@ -48,7 +48,7 @@ function annotationMapper($rootScope, annotationUI, store) { ...@@ -48,7 +48,7 @@ function annotationMapper($rootScope, annotationUI, store) {
function deleteAnnotation(annotation) { function deleteAnnotation(annotation) {
return store.annotation.delete({ return store.annotation.delete({
id: annotation.id id: annotation.id,
}).then(function () { }).then(function () {
$rootScope.$emit(events.ANNOTATION_DELETED, annotation); $rootScope.$emit(events.ANNOTATION_DELETED, annotation);
return annotation; return annotation;
...@@ -59,7 +59,7 @@ function annotationMapper($rootScope, annotationUI, store) { ...@@ -59,7 +59,7 @@ function annotationMapper($rootScope, annotationUI, store) {
loadAnnotations: loadAnnotations, loadAnnotations: loadAnnotations,
unloadAnnotations: unloadAnnotations, unloadAnnotations: unloadAnnotations,
createAnnotation: createAnnotation, createAnnotation: createAnnotation,
deleteAnnotation: deleteAnnotation deleteAnnotation: deleteAnnotation,
}; };
} }
......
...@@ -55,7 +55,7 @@ function AnnotationUISync($rootScope, $window, annotationUI, bridge) { ...@@ -55,7 +55,7 @@ function AnnotationUISync($rootScope, $window, annotationUI, bridge) {
annotationUI.setShowHighlights(state); annotationUI.setShowHighlights(state);
bridge.call('setVisibleHighlights', state); bridge.call('setVisibleHighlights', state);
} }
} },
}; };
for (var channel in channelListeners) { for (var channel in channelListeners) {
......
...@@ -53,7 +53,7 @@ PDFMetadata.prototype.getMetadata = function () { ...@@ -53,7 +53,7 @@ PDFMetadata.prototype.getMetadata = function () {
} }
var link = [ var link = [
{href: fingerprintToURN(app.documentFingerprint)} {href: fingerprintToURN(app.documentFingerprint)},
]; ];
var url = getPDFURL(app); var url = getPDFURL(app);
......
...@@ -39,7 +39,7 @@ describe('pdf-metadata', function () { ...@@ -39,7 +39,7 @@ describe('pdf-metadata', function () {
metadata: { metadata: {
metadata: { metadata: {
'dc:title': 'fakeTitle', 'dc:title': 'fakeTitle',
} },
}, },
url: 'http://fake.com', url: 'http://fake.com',
}; };
......
...@@ -52,24 +52,24 @@ function configureRoutes($routeProvider) { ...@@ -52,24 +52,24 @@ function configureRoutes($routeProvider) {
controller: 'AnnotationViewerController', controller: 'AnnotationViewerController',
template: VIEWER_TEMPLATE, template: VIEWER_TEMPLATE,
reloadOnSearch: false, reloadOnSearch: false,
resolve: resolve resolve: resolve,
}); });
$routeProvider.when('/viewer', $routeProvider.when('/viewer',
{ {
controller: 'WidgetController', controller: 'WidgetController',
template: VIEWER_TEMPLATE, template: VIEWER_TEMPLATE,
reloadOnSearch: false, reloadOnSearch: false,
resolve: resolve resolve: resolve,
}); });
$routeProvider.when('/stream', $routeProvider.when('/stream',
{ {
controller: 'StreamController', controller: 'StreamController',
template: VIEWER_TEMPLATE, template: VIEWER_TEMPLATE,
reloadOnSearch: false, reloadOnSearch: false,
resolve: resolve resolve: resolve,
}); });
return $routeProvider.otherwise({ return $routeProvider.otherwise({
redirectTo: '/viewer' redirectTo: '/viewer',
}); });
} }
...@@ -115,7 +115,7 @@ module.exports = angular.module('h', [ ...@@ -115,7 +115,7 @@ module.exports = angular.module('h', [
['ui.bootstrap', require('./vendor/ui-bootstrap-custom-tpls-0.13.4')][0], ['ui.bootstrap', require('./vendor/ui-bootstrap-custom-tpls-0.13.4')][0],
// Local addons // Local addons
'ngRaven' 'ngRaven',
]) ])
.controller('AppController', require('./app-controller')) .controller('AppController', require('./app-controller'))
......
...@@ -34,7 +34,7 @@ function fetchToken($http, session, settings) { ...@@ -34,7 +34,7 @@ function fetchToken($http, session, settings) {
skipAuthorization: true, skipAuthorization: true,
transformRequest: function (data) { transformRequest: function (data) {
return queryString.stringify(data); return queryString.stringify(data);
} },
}; };
return $http.get(tokenUrl, config).then(function (response) { return $http.get(tokenUrl, config).then(function (response) {
return response.data; return response.data;
......
...@@ -71,6 +71,6 @@ module.exports = function () { ...@@ -71,6 +71,6 @@ module.exports = function () {
isPrivate: '<', isPrivate: '<',
isOpen: '<', isOpen: '<',
onClose: '&', onClose: '&',
} },
}; };
}; };
...@@ -441,7 +441,7 @@ function AnnotationController( ...@@ -441,7 +441,7 @@ function AnnotationController(
drafts.update(vm.annotation, { drafts.update(vm.annotation, {
tags: vm.state().tags, tags: vm.state().tags,
text: vm.state().text, text: vm.state().text,
isPrivate: privacy === 'private' isPrivate: privacy === 'private',
}); });
}; };
...@@ -544,7 +544,7 @@ function annotation() { ...@@ -544,7 +544,7 @@ function annotation() {
showDocumentInfo: '<', showDocumentInfo: '<',
onReplyCountClick: '&', onReplyCountClick: '&',
replyCount: '<', replyCount: '<',
isCollapsed: '<' isCollapsed: '<',
}, },
template: require('../../../templates/client/annotation.html'), template: require('../../../templates/client/annotation.html'),
}; };
...@@ -560,5 +560,5 @@ module.exports = { ...@@ -560,5 +560,5 @@ module.exports = {
// These are meant to be the public API of this module. // These are meant to be the public API of this module.
directive: annotation, directive: annotation,
Controller: AnnotationController Controller: AnnotationController,
}; };
...@@ -35,7 +35,7 @@ function groupList( $window, groups, settings) { ...@@ -35,7 +35,7 @@ function groupList( $window, groups, settings) {
}, },
restrict: 'E', restrict: 'E',
scope: { scope: {
auth: '<' auth: '<',
}, },
template: require('../../../templates/client/group_list.html'), template: require('../../../templates/client/group_list.html'),
}; };
...@@ -43,5 +43,5 @@ function groupList( $window, groups, settings) { ...@@ -43,5 +43,5 @@ function groupList( $window, groups, settings) {
module.exports = { module.exports = {
directive: groupList, directive: groupList,
Controller: GroupListController Controller: GroupListController,
}; };
...@@ -18,6 +18,6 @@ module.exports = function() { ...@@ -18,6 +18,6 @@ module.exports = function() {
restrict: 'A', restrict: 'A',
link: function($scope, $element) { link: function($scope, $element) {
$element[0].focus(); $element[0].focus();
} },
}; };
}; };
...@@ -35,6 +35,6 @@ module.exports = function () { ...@@ -35,6 +35,6 @@ module.exports = function () {
scope: { scope: {
auth: '<', auth: '<',
onClose: '&', onClose: '&',
} },
}; };
}; };
...@@ -116,7 +116,7 @@ module.exports = function($sanitize) { ...@@ -116,7 +116,7 @@ module.exports = function($sanitize) {
var shortcuts = { var shortcuts = {
66: scope.insertBold, 66: scope.insertBold,
73: scope.insertItalic, 73: scope.insertItalic,
75: scope.insertLink 75: scope.insertLink,
}; };
var shortcut = shortcuts[e.keyCode]; var shortcut = shortcuts[e.keyCode];
......
...@@ -34,7 +34,7 @@ module.exports = function () { ...@@ -34,7 +34,7 @@ module.exports = function () {
isShared: '<', isShared: '<',
onCancel: '&', onCancel: '&',
onSave: '&', onSave: '&',
onSetPrivacy: '&' onSetPrivacy: '&',
}, },
template: require('../../../templates/client/publish_annotation_btn.html'), template: require('../../../templates/client/publish_annotation_btn.html'),
}; };
......
...@@ -36,5 +36,5 @@ module.exports = { ...@@ -36,5 +36,5 @@ module.exports = {
template: require('../../../templates/client/sidebar_tutorial.html'), template: require('../../../templates/client/sidebar_tutorial.html'),
}; };
}, },
Controller: SidebarTutorialController Controller: SidebarTutorialController,
}; };
...@@ -7,6 +7,6 @@ module.exports = ['$animate', function($animate) { ...@@ -7,6 +7,6 @@ module.exports = ['$animate', function($animate) {
$animate.enabled(false, elem); $animate.enabled(false, elem);
}, },
restrict: 'C', restrict: 'C',
template: '<span><span></span></span>' template: '<span><span></span></span>',
}; };
}]; }];
...@@ -25,7 +25,7 @@ describe('annotationShareDialog', function () { ...@@ -25,7 +25,7 @@ describe('annotationShareDialog', function () {
describe('The annotation share dialog', function () { describe('The annotation share dialog', function () {
it('has class is-open set when it is open', function () { it('has class is-open set when it is open', function () {
element = util.createDirective(document, 'annotationShareDialog', { element = util.createDirective(document, 'annotationShareDialog', {
isOpen: true isOpen: true,
}); });
assert.isOk(element.find('.annotation-share-dialog').hasClass('is-open')); assert.isOk(element.find('.annotation-share-dialog').hasClass('is-open'));
...@@ -33,7 +33,7 @@ describe('annotationShareDialog', function () { ...@@ -33,7 +33,7 @@ describe('annotationShareDialog', function () {
it('does not have class is-open set when it is not open', function () { it('does not have class is-open set when it is not open', function () {
element = util.createDirective(document, 'annotationShareDialog', { element = util.createDirective(document, 'annotationShareDialog', {
isOpen: false isOpen: false,
}); });
assert.isNotOk(element.find('.annotation-share-dialog').hasClass('is-open')); assert.isNotOk(element.find('.annotation-share-dialog').hasClass('is-open'));
...@@ -51,7 +51,7 @@ describe('annotationShareDialog', function () { ...@@ -51,7 +51,7 @@ describe('annotationShareDialog', function () {
group: { group: {
name: 'Public', name: 'Public',
type: 'public', type: 'public',
public: true public: true,
}, },
uri: 'fakeURI', uri: 'fakeURI',
isPrivate: false, isPrivate: false,
...@@ -101,9 +101,9 @@ describe('annotationShareDialog', function () { ...@@ -101,9 +101,9 @@ describe('annotationShareDialog', function () {
it('is available to a group', function () { it('is available to a group', function () {
element = util.createDirective(document, 'annotationShareDialog', { element = util.createDirective(document, 'annotationShareDialog', {
group: { group: {
public: false public: false,
}, },
isPrivate: false isPrivate: false,
}); });
var actualMessage = element.find('.annotation-share-dialog-msg').text(); var actualMessage = element.find('.annotation-share-dialog-msg').text();
...@@ -116,7 +116,7 @@ describe('annotationShareDialog', function () { ...@@ -116,7 +116,7 @@ describe('annotationShareDialog', function () {
it('is private', function () { it('is private', function () {
element = util.createDirective(document, 'annotationShareDialog', { element = util.createDirective(document, 'annotationShareDialog', {
isPrivate: true isPrivate: true,
}); });
var actualMessage = element.find('.annotation-share-dialog-msg').text(); var actualMessage = element.find('.annotation-share-dialog-msg').text();
......
...@@ -32,7 +32,7 @@ function annotationDirective() { ...@@ -32,7 +32,7 @@ function annotationDirective() {
domainAndTitle: function (annot) { // eslint-disable-line no-unused-vars domainAndTitle: function (annot) { // eslint-disable-line no-unused-vars
return fakeDocumentMeta; return fakeDocumentMeta;
}, },
} },
}); });
return annotation.directive; return annotation.directive;
...@@ -125,10 +125,10 @@ describe('annotation', function() { ...@@ -125,10 +125,10 @@ describe('annotation', function() {
read: ['acct:bill@localhost'], read: ['acct:bill@localhost'],
update: ['acct:bill@localhost'], update: ['acct:bill@localhost'],
destroy: ['acct:bill@localhost'], destroy: ['acct:bill@localhost'],
admin: ['acct:bill@localhost'] admin: ['acct:bill@localhost'],
} },
}), }),
deleteAnnotation: sandbox.stub() deleteAnnotation: sandbox.stub(),
}; };
var fakeAnnotationUI = {}; var fakeAnnotationUI = {};
...@@ -136,7 +136,7 @@ describe('annotation', function() { ...@@ -136,7 +136,7 @@ describe('annotation', function() {
fakeDrafts = { fakeDrafts = {
update: sandbox.stub(), update: sandbox.stub(),
remove: sandbox.stub(), remove: sandbox.stub(),
get: sandbox.stub() get: sandbox.stub(),
}; };
var fakeFeatures = { var fakeFeatures = {
...@@ -152,21 +152,21 @@ describe('annotation', function() { ...@@ -152,21 +152,21 @@ describe('annotation', function() {
isPrivate: sandbox.stub().returns(false), isPrivate: sandbox.stub().returns(false),
permits: sandbox.stub().returns(true), permits: sandbox.stub().returns(true),
shared: sandbox.stub().returns({ shared: sandbox.stub().returns({
read: ['everybody'] read: ['everybody'],
}), }),
'private': sandbox.stub().returns({ 'private': sandbox.stub().returns({
read: ['justme'] read: ['justme'],
}), }),
'default': sandbox.stub().returns({ 'default': sandbox.stub().returns({
read: ['default'] read: ['default'],
}), }),
setDefault: sandbox.stub() setDefault: sandbox.stub(),
}; };
fakeSession = { fakeSession = {
state: { state: {
userid: 'acct:bill@localhost' userid: 'acct:bill@localhost',
} },
}; };
var fakeSettings = { var fakeSettings = {
...@@ -177,7 +177,7 @@ describe('annotation', function() { ...@@ -177,7 +177,7 @@ describe('annotation', function() {
focused: function() { focused: function() {
return {}; return {};
}, },
get: function() {} get: function() {},
}; };
fakeStore = { fakeStore = {
...@@ -270,8 +270,8 @@ describe('annotation', function() { ...@@ -270,8 +270,8 @@ describe('annotation', function() {
read: ['foo'], read: ['foo'],
update: ['bar'], update: ['bar'],
'delete': ['gar'], 'delete': ['gar'],
admin: ['har'] admin: ['har'],
} },
}; };
var originalPermissions = JSON.parse(JSON.stringify( var originalPermissions = JSON.parse(JSON.stringify(
annotation.permissions)); annotation.permissions));
...@@ -454,7 +454,7 @@ describe('annotation', function() { ...@@ -454,7 +454,7 @@ describe('annotation', function() {
createDirective(annotation); createDirective(annotation);
$scope.$digest(); $scope.$digest();
assert.deepEqual(annotation.permissions, { assert.deepEqual(annotation.permissions, {
read: ['justme'] read: ['justme'],
}); });
}); });
}); });
...@@ -468,7 +468,7 @@ describe('annotation', function() { ...@@ -468,7 +468,7 @@ describe('annotation', function() {
read: ['acct:joe@localhost'], read: ['acct:joe@localhost'],
update: ['acct:joe@localhost'], update: ['acct:joe@localhost'],
destroy: ['acct:joe@localhost'], destroy: ['acct:joe@localhost'],
admin: ['acct:joe@localhost'] admin: ['acct:joe@localhost'],
}; };
}); });
...@@ -476,7 +476,7 @@ describe('annotation', function() { ...@@ -476,7 +476,7 @@ describe('annotation', function() {
var controller = createDirective(annotation).controller; var controller = createDirective(annotation).controller;
var reply = sinon.match({ var reply = sinon.match({
references: [annotation.id], references: [annotation.id],
uri: annotation.uri uri: annotation.uri,
}); });
controller.reply(); controller.reply();
assert.calledWith(fakeAnnotationMapper.createAnnotation, reply); assert.calledWith(fakeAnnotationMapper.createAnnotation, reply);
...@@ -488,7 +488,7 @@ describe('annotation', function() { ...@@ -488,7 +488,7 @@ describe('annotation', function() {
var reply = sinon.match({ var reply = sinon.match({
references: [annotation.id], references: [annotation.id],
permissions: perms, permissions: perms,
uri: annotation.uri uri: annotation.uri,
}); });
fakePermissions.isShared.returns(true); fakePermissions.isShared.returns(true);
fakePermissions.shared.returns(perms); fakePermissions.shared.returns(perms);
...@@ -582,10 +582,10 @@ describe('annotation', function() { ...@@ -582,10 +582,10 @@ describe('annotation', function() {
{ {
selector: [ selector: [
{ {
type: 'TextQuoteSelector' type: 'TextQuoteSelector',
} },
] ],
} },
]; ];
var controller = createDirective(annotation).controller; var controller = createDirective(annotation).controller;
...@@ -632,7 +632,7 @@ describe('annotation', function() { ...@@ -632,7 +632,7 @@ describe('annotation', function() {
var controller = createDirective().controller; var controller = createDirective().controller;
sandbox.stub($window, 'confirm').returns(true); sandbox.stub($window, 'confirm').returns(true);
fakeAnnotationMapper.deleteAnnotation.returns($q.reject({ fakeAnnotationMapper.deleteAnnotation.returns($q.reject({
status: 0 status: 0,
})); }));
controller.delete().then(function() { controller.delete().then(function() {
assert.calledWith(fakeFlash.error, assert.calledWith(fakeFlash.error,
...@@ -649,7 +649,7 @@ describe('annotation', function() { ...@@ -649,7 +649,7 @@ describe('annotation', function() {
fakeAnnotationMapper.deleteAnnotation.returns($q.reject({ fakeAnnotationMapper.deleteAnnotation.returns($q.reject({
status: 500, status: 500,
statusText: 'Server Error', statusText: 'Server Error',
data: {} data: {},
})); }));
controller.delete().then(function() { controller.delete().then(function() {
assert.calledWith(fakeFlash.error, assert.calledWith(fakeFlash.error,
...@@ -708,7 +708,7 @@ describe('annotation', function() { ...@@ -708,7 +708,7 @@ describe('annotation', function() {
it('flashes a generic error if the server can\'t be reached', function() { it('flashes a generic error if the server can\'t be reached', function() {
var controller = createController(); var controller = createController();
fakeStore.annotation.create = sinon.stub().returns(Promise.reject({ fakeStore.annotation.create = sinon.stub().returns(Promise.reject({
status: 0 status: 0,
})); }));
return controller.save().then(function() { return controller.save().then(function() {
assert.calledWith(fakeFlash.error, assert.calledWith(fakeFlash.error,
...@@ -721,7 +721,7 @@ describe('annotation', function() { ...@@ -721,7 +721,7 @@ describe('annotation', function() {
fakeStore.annotation.create = sinon.stub().returns(Promise.reject({ fakeStore.annotation.create = sinon.stub().returns(Promise.reject({
status: 500, status: 500,
statusText: 'Server Error', statusText: 'Server Error',
data: {} data: {},
})); }));
return controller.save().then(function() { return controller.save().then(function() {
assert.calledWith(fakeFlash.error, assert.calledWith(fakeFlash.error,
...@@ -782,7 +782,7 @@ describe('annotation', function() { ...@@ -782,7 +782,7 @@ describe('annotation', function() {
it('flashes a generic error if the server cannot be reached', function () { it('flashes a generic error if the server cannot be reached', function () {
var controller = createController(); var controller = createController();
fakeStore.annotation.update = sinon.stub().returns(Promise.reject({ fakeStore.annotation.update = sinon.stub().returns(Promise.reject({
status: -1 status: -1,
})); }));
return controller.save().then(function() { return controller.save().then(function() {
assert.calledWith(fakeFlash.error, assert.calledWith(fakeFlash.error,
...@@ -795,7 +795,7 @@ describe('annotation', function() { ...@@ -795,7 +795,7 @@ describe('annotation', function() {
fakeStore.annotation.update = sinon.stub().returns(Promise.reject({ fakeStore.annotation.update = sinon.stub().returns(Promise.reject({
status: 500, status: 500,
statusText: 'Server Error', statusText: 'Server Error',
data: {} data: {},
})); }));
return controller.save().then(function() { return controller.save().then(function() {
assert.calledWith(fakeFlash.error, assert.calledWith(fakeFlash.error,
...@@ -815,7 +815,7 @@ describe('annotation', function() { ...@@ -815,7 +815,7 @@ describe('annotation', function() {
it('starts editing immediately if there is a draft', function() { it('starts editing immediately if there is a draft', function() {
fakeDrafts.get.returns({ fakeDrafts.get.returns({
tags: ['unsaved'], tags: ['unsaved'],
text: 'unsaved-text' text: 'unsaved-text',
}); });
var controller = createDirective().controller; var controller = createDirective().controller;
assert.isTrue(controller.editing()); assert.isTrue(controller.editing());
...@@ -824,7 +824,7 @@ describe('annotation', function() { ...@@ -824,7 +824,7 @@ describe('annotation', function() {
it('uses the text and tags from the draft if present', function() { it('uses the text and tags from the draft if present', function() {
fakeDrafts.get.returns({ fakeDrafts.get.returns({
tags: ['unsaved-tag'], tags: ['unsaved-tag'],
text: 'unsaved-text' text: 'unsaved-text',
}); });
var controller = createDirective().controller; var controller = createDirective().controller;
assert.deepEqual(controller.state().tags, ['unsaved-tag']); assert.deepEqual(controller.state().tags, ['unsaved-tag']);
...@@ -947,7 +947,7 @@ describe('annotation', function() { ...@@ -947,7 +947,7 @@ describe('annotation', function() {
it('displays links to tags on the stream', function () { it('displays links to tags on the stream', function () {
var directive = createDirective({ var directive = createDirective({
id: '1234', id: '1234',
tags: ['atag'] tags: ['atag'],
}); });
var links = [].slice.apply(directive.element[0].querySelectorAll('a')); var links = [].slice.apply(directive.element[0].querySelectorAll('a'));
var tagLinks = links.filter(function (link) { var tagLinks = links.filter(function (link) {
...@@ -964,7 +964,7 @@ describe('annotation', function() { ...@@ -964,7 +964,7 @@ describe('annotation', function() {
var annotation = Object.assign({}, fixtures.defaultAnnotation(), { var annotation = Object.assign({}, fixtures.defaultAnnotation(), {
links: { links: {
html: 'https://test.hypothes.is/a/deadbeef', html: 'https://test.hypothes.is/a/deadbeef',
incontext: 'https://hpt.is/deadbeef' incontext: 'https://hpt.is/deadbeef',
}, },
}); });
var controller = createDirective(annotation).controller; var controller = createDirective(annotation).controller;
...@@ -985,7 +985,7 @@ describe('annotation', function() { ...@@ -985,7 +985,7 @@ describe('annotation', function() {
var annotation = Object.assign({}, fixtures.defaultAnnotation(), { var annotation = Object.assign({}, fixtures.defaultAnnotation(), {
links: { links: {
html: 'https://test.hypothes.is/a/deadbeef', html: 'https://test.hypothes.is/a/deadbeef',
incontext: 'https://hpt.is/deadbeef' incontext: 'https://hpt.is/deadbeef',
}, },
}); });
var controller = createDirective(annotation).controller; var controller = createDirective(annotation).controller;
......
...@@ -57,8 +57,8 @@ describe('annotationThread', function () { ...@@ -57,8 +57,8 @@ describe('annotationThread', function () {
id: '1', id: '1',
annotation: {id: '1'}, annotation: {id: '1'},
visible: false, visible: false,
children: [] children: [],
} },
}); });
var pageObject = new PageObject(element); var pageObject = new PageObject(element);
assert.equal(pageObject.annotations().length, 1); assert.equal(pageObject.annotations().length, 1);
...@@ -78,7 +78,7 @@ describe('annotationThread', function () { ...@@ -78,7 +78,7 @@ describe('annotationThread', function () {
visible: true, visible: true,
}], }],
collapsed: false, collapsed: false,
} },
}); });
var pageObject = new PageObject(element); var pageObject = new PageObject(element);
assert.isFalse(pageObject.isHidden(pageObject.replyList())); assert.isFalse(pageObject.isHidden(pageObject.replyList()));
...@@ -97,7 +97,7 @@ describe('annotationThread', function () { ...@@ -97,7 +97,7 @@ describe('annotationThread', function () {
visible: true, visible: true,
}], }],
collapsed: true, collapsed: true,
} },
}); });
var pageObject = new PageObject(element); var pageObject = new PageObject(element);
assert.isTrue(pageObject.isHidden(pageObject.replyList())); assert.isTrue(pageObject.isHidden(pageObject.replyList()));
...@@ -121,7 +121,7 @@ describe('annotationThread', function () { ...@@ -121,7 +121,7 @@ describe('annotationThread', function () {
visible: true, visible: true,
}], }],
collapsed: false, collapsed: false,
} },
}); });
var pageObject = new PageObject(element); var pageObject = new PageObject(element);
assert.equal(pageObject.visibleReplies().length, 1); assert.equal(pageObject.visibleReplies().length, 1);
...@@ -140,7 +140,7 @@ describe('annotationThread', function () { ...@@ -140,7 +140,7 @@ describe('annotationThread', function () {
onChangeCollapsed: { onChangeCollapsed: {
args: ['id', 'collapsed'], args: ['id', 'collapsed'],
callback: onChangeCollapsed, callback: onChangeCollapsed,
} },
}); });
element.ctrl.toggleCollapsed(); element.ctrl.toggleCollapsed();
assert.calledWith(onChangeCollapsed, '123', false); assert.calledWith(onChangeCollapsed, '123', false);
......
...@@ -219,7 +219,7 @@ describe('excerpt directive', function () { ...@@ -219,7 +219,7 @@ describe('excerpt directive', function () {
onCollapsibleChanged: { onCollapsibleChanged: {
args: ['collapsible'], args: ['collapsible'],
callback: callback, callback: callback,
} },
}, '<span></span>'); }, '<span></span>');
fakeOverflowMonitor.ctrl.onOverflowChanged(true); fakeOverflowMonitor.ctrl.onOverflowChanged(true);
assert.calledWith(callback, true); assert.calledWith(callback, true);
......
...@@ -36,11 +36,11 @@ describe('groupList', function () { ...@@ -36,11 +36,11 @@ describe('groupList', function () {
groups = [{ groups = [{
id: 'public', id: 'public',
public: true public: true,
},{ },{
id: 'h-devs', id: 'h-devs',
name: 'Hypothesis Developers', name: 'Hypothesis Developers',
url: GROUP_LINK url: GROUP_LINK,
}]; }];
fakeGroups = { fakeGroups = {
......
...@@ -11,7 +11,7 @@ var fakeLocalStorage = { ...@@ -11,7 +11,7 @@ var fakeLocalStorage = {
}, },
getItem: function (key) { getItem: function (key) {
return fakeStorage[key]; return fakeStorage[key];
} },
}; };
describe('publishAnnotationBtn', function () { describe('publishAnnotationBtn', function () {
...@@ -34,13 +34,13 @@ describe('publishAnnotationBtn', function () { ...@@ -34,13 +34,13 @@ describe('publishAnnotationBtn', function () {
element = util.createDirective(document, 'publishAnnotationBtn', { element = util.createDirective(document, 'publishAnnotationBtn', {
group: { group: {
name: 'Public', name: 'Public',
type: 'public' type: 'public',
}, },
canPost: true, canPost: true,
isShared: false, isShared: false,
onSave: function () {}, onSave: function () {},
onSetPrivacy: function () {}, onSetPrivacy: function () {},
onCancel: function () {} onCancel: function () {},
}); });
}); });
...@@ -54,9 +54,9 @@ describe('publishAnnotationBtn', function () { ...@@ -54,9 +54,9 @@ describe('publishAnnotationBtn', function () {
element.link({ element.link({
group: { group: {
name: 'Research Lab', name: 'Research Lab',
type: 'group' type: 'group',
}, },
isShared: true isShared: true,
}); });
var buttons = element.find('button'); var buttons = element.find('button');
assert.equal(buttons[0].innerHTML, 'Post to Research Lab'); assert.equal(buttons[0].innerHTML, 'Post to Research Lab');
...@@ -65,7 +65,7 @@ describe('publishAnnotationBtn', function () { ...@@ -65,7 +65,7 @@ describe('publishAnnotationBtn', function () {
it('should save when "Post..." is clicked', function () { it('should save when "Post..." is clicked', function () {
var savedSpy = sinon.spy(); var savedSpy = sinon.spy();
element.link({ element.link({
onSave: savedSpy onSave: savedSpy,
}); });
assert.ok(!savedSpy.called); assert.ok(!savedSpy.called);
angular.element(element.find('button')[0]).click(); angular.element(element.find('button')[0]).click();
...@@ -77,7 +77,7 @@ describe('publishAnnotationBtn', function () { ...@@ -77,7 +77,7 @@ describe('publishAnnotationBtn', function () {
element.link({ element.link({
// for existing annotations, the privacy should not be changed // for existing annotations, the privacy should not be changed
// unless the user makes a choice from the list // unless the user makes a choice from the list
onSetPrivacy: privacyChangedSpy onSetPrivacy: privacyChangedSpy,
}); });
assert.ok(!privacyChangedSpy.called); assert.ok(!privacyChangedSpy.called);
...@@ -91,14 +91,14 @@ describe('publishAnnotationBtn', function () { ...@@ -91,14 +91,14 @@ describe('publishAnnotationBtn', function () {
it('should disable post buttons when posting is not possible', function () { it('should disable post buttons when posting is not possible', function () {
element.link({ element.link({
canPost: false canPost: false,
}); });
var disabledBtns = element.find('button[disabled]'); var disabledBtns = element.find('button[disabled]');
assert.equal(disabledBtns.length, 1); assert.equal(disabledBtns.length, 1);
// check that buttons are enabled when posting is possible // check that buttons are enabled when posting is possible
element.link({ element.link({
canPost: true canPost: true,
}); });
disabledBtns = element.find('button[disabled]'); disabledBtns = element.find('button[disabled]');
assert.equal(disabledBtns.length, 0); assert.equal(disabledBtns.length, 0);
...@@ -107,7 +107,7 @@ describe('publishAnnotationBtn', function () { ...@@ -107,7 +107,7 @@ describe('publishAnnotationBtn', function () {
it('should revert changes when cancel is clicked', function () { it('should revert changes when cancel is clicked', function () {
var cancelSpy = sinon.spy(); var cancelSpy = sinon.spy();
element.link({ element.link({
onCancel: cancelSpy onCancel: cancelSpy,
}); });
var cancelBtn = element.find('.publish-annotation-cancel-btn'); var cancelBtn = element.find('.publish-annotation-cancel-btn');
assert.equal(cancelBtn.length, 1); assert.equal(cancelBtn.length, 1);
......
...@@ -18,7 +18,7 @@ describe('searchStatusBar', function () { ...@@ -18,7 +18,7 @@ describe('searchStatusBar', function () {
it('should display the filter count', function () { it('should display the filter count', function () {
var elem = util.createDirective(document, 'searchStatusBar', { var elem = util.createDirective(document, 'searchStatusBar', {
filterActive: true, filterActive: true,
filterMatchCount: 5 filterMatchCount: 5,
}); });
assert.include(elem[0].textContent, "5 search results"); assert.include(elem[0].textContent, "5 search results");
}); });
......
...@@ -9,9 +9,9 @@ describe('SidebarTutorialController', function () { ...@@ -9,9 +9,9 @@ describe('SidebarTutorialController', function () {
var session = { var session = {
state: { state: {
preferences: { preferences: {
show_sidebar_tutorial: true show_sidebar_tutorial: true,
} },
} },
}; };
var controller = new Controller(session); var controller = new Controller(session);
...@@ -24,9 +24,9 @@ describe('SidebarTutorialController', function () { ...@@ -24,9 +24,9 @@ describe('SidebarTutorialController', function () {
var session = { var session = {
state: { state: {
preferences: { preferences: {
show_sidebar_tutorial: false show_sidebar_tutorial: false,
} },
} },
}; };
var controller = new Controller(session); var controller = new Controller(session);
......
...@@ -22,7 +22,7 @@ describe('sortDropdown', function () { ...@@ -22,7 +22,7 @@ describe('sortDropdown', function () {
onChangeSortKey: { onChangeSortKey: {
args: ['sortKey'], args: ['sortKey'],
callback: changeSpy, callback: changeSpy,
} },
}); });
var links = elem.find('li'); var links = elem.find('li');
angular.element(links[0]).click(); angular.element(links[0]).click();
......
...@@ -25,7 +25,7 @@ describe('tagEditor', function () { ...@@ -25,7 +25,7 @@ describe('tagEditor', function () {
it('converts tags to the form expected by ng-tags-input', function () { it('converts tags to the form expected by ng-tags-input', function () {
var element = util.createDirective(document, 'tag-editor', { var element = util.createDirective(document, 'tag-editor', {
tags: ['foo', 'bar'] tags: ['foo', 'bar'],
}); });
assert.deepEqual(element.ctrl.tagList, [{text: 'foo'}, {text: 'bar'}]); assert.deepEqual(element.ctrl.tagList, [{text: 'foo'}, {text: 'bar'}]);
}); });
......
...@@ -23,7 +23,7 @@ describe('windowScroll', function () { ...@@ -23,7 +23,7 @@ describe('windowScroll', function () {
html = {}; html = {};
view = { view = {
addEventListener: sinon.spy(), addEventListener: sinon.spy(),
removeEventListener: sinon.spy() removeEventListener: sinon.spy(),
}; };
doc = {documentElement: html, defaultView: view}; doc = {documentElement: html, defaultView: view};
......
...@@ -25,6 +25,6 @@ module.exports = function () { ...@@ -25,6 +25,6 @@ module.exports = function () {
scope.$on('$destroy', function () { scope.$on('$destroy', function () {
view.removeEventListener('scroll', onScroll); view.removeEventListener('scroll', onScroll);
}); });
} },
}; };
}; };
...@@ -74,7 +74,7 @@ function DraftStore() { ...@@ -74,7 +74,7 @@ function DraftStore() {
model: model, model: model,
isPrivate: changes.isPrivate, isPrivate: changes.isPrivate,
tags: changes.tags, tags: changes.tags,
text: changes.text text: changes.text,
}; };
this.remove(model); this.remove(model);
this._drafts.push(newDraft); this._drafts.push(newDraft);
......
...@@ -40,7 +40,7 @@ function features($log, session) { ...@@ -40,7 +40,7 @@ function features($log, session) {
} }
return { return {
flagEnabled: flagEnabled flagEnabled: flagEnabled,
}; };
} }
......
...@@ -12,7 +12,7 @@ module.exports = function(config) { ...@@ -12,7 +12,7 @@ module.exports = function(config) {
'browserify', 'browserify',
'mocha', 'mocha',
'chai', 'chai',
'sinon' 'sinon',
], ],
// list of files / patterns to load in the browser // list of files / patterns to load in the browser
...@@ -35,7 +35,7 @@ module.exports = function(config) { ...@@ -35,7 +35,7 @@ module.exports = function(config) {
{ pattern: '**/test/*-test.js', watched: false, included: true, served: true }, { pattern: '**/test/*-test.js', watched: false, included: true, served: true },
// Integration tests // Integration tests
{ pattern: '**/integration/*-test.js', watched: false, included: true, served: true } { pattern: '**/integration/*-test.js', watched: false, included: true, served: true },
], ],
// list of files to exclude // list of files to exclude
...@@ -60,7 +60,7 @@ module.exports = function(config) { ...@@ -60,7 +60,7 @@ module.exports = function(config) {
bundle bundle
.transform('coffeeify') .transform('coffeeify')
.plugin('proxyquire-universal'); .plugin('proxyquire-universal');
} },
}, },
mochaReporter: { mochaReporter: {
......
...@@ -24,7 +24,7 @@ function sessionActions(options) { ...@@ -24,7 +24,7 @@ function sessionActions(options) {
dismiss_sidebar_tutorial: { dismiss_sidebar_tutorial: {
method: 'POST', method: 'POST',
params: { path: 'dismiss_sidebar_tutorial' }, params: { path: 'dismiss_sidebar_tutorial' },
} },
}; };
Object.keys(actions).forEach(function (action) { Object.keys(actions).forEach(function (action) {
...@@ -54,7 +54,7 @@ function session($http, $resource, $rootScope, flash, raven, settings) { ...@@ -54,7 +54,7 @@ function session($http, $resource, $rootScope, flash, raven, settings) {
var actions = sessionActions({ var actions = sessionActions({
headers: headers, headers: headers,
transformResponse: process, transformResponse: process,
withCredentials: true withCredentials: true,
}); });
var endpoint = new URL('app/:path', settings.serviceUrl).href; var endpoint = new URL('app/:path', settings.serviceUrl).href;
var resource = $resource(endpoint, {}, actions); var resource = $resource(endpoint, {}, actions);
......
...@@ -7,7 +7,7 @@ function defaultAnnotation() { ...@@ -7,7 +7,7 @@ function defaultAnnotation() {
return { return {
id: 'deadbeef', id: 'deadbeef',
document: { document: {
title: 'A special document' title: 'A special document',
}, },
target: [{source: 'source', 'selector': []}], target: [{source: 'source', 'selector': []}],
uri: 'http://example.com', uri: 'http://example.com',
...@@ -26,7 +26,7 @@ function newAnnotation() { ...@@ -26,7 +26,7 @@ function newAnnotation() {
target: ['foo', 'bar'], target: ['foo', 'bar'],
references: [], references: [],
text: 'Annotation text', text: 'Annotation text',
tags: ['tag_1', 'tag_2'] tags: ['tag_1', 'tag_2'],
}; };
} }
...@@ -38,7 +38,7 @@ function newReply() { ...@@ -38,7 +38,7 @@ function newReply() {
target: ['foo', 'bar'], target: ['foo', 'bar'],
references: ['parent-id'], references: ['parent-id'],
text: 'Annotation text', text: 'Annotation text',
tags: ['tag_1', 'tag_2'] tags: ['tag_1', 'tag_2'],
}; };
} }
...@@ -60,7 +60,7 @@ function newEmptyAnnotation() { ...@@ -60,7 +60,7 @@ function newEmptyAnnotation() {
function newHighlight() { function newHighlight() {
return { return {
id: undefined, id: undefined,
$highlight: true $highlight: true,
}; };
} }
...@@ -74,7 +74,7 @@ function oldAnnotation() { ...@@ -74,7 +74,7 @@ function oldAnnotation() {
target: ['foo', 'bar'], target: ['foo', 'bar'],
references: [], references: [],
text: 'This is my annotation', text: 'This is my annotation',
tags: ['tag_1', 'tag_2'] tags: ['tag_1', 'tag_2'],
}; };
} }
...@@ -88,7 +88,7 @@ function oldHighlight() { ...@@ -88,7 +88,7 @@ function oldHighlight() {
target: ['foo', 'bar'], target: ['foo', 'bar'],
references: [], references: [],
text: '', text: '',
tags: [] tags: [],
}; };
} }
...@@ -101,7 +101,7 @@ function oldPageNote() { ...@@ -101,7 +101,7 @@ function oldPageNote() {
target: [], target: [],
references: [], references: [],
text: '', text: '',
tags: [] tags: [],
}; };
} }
...@@ -114,7 +114,7 @@ function oldReply() { ...@@ -114,7 +114,7 @@ function oldReply() {
target: ['foo'], target: ['foo'],
references: ['parent_annotation_id'], references: ['parent_annotation_id'],
text: '', text: '',
tags: [] tags: [],
}; };
} }
......
...@@ -86,7 +86,7 @@ describe('annotationMapper', function() { ...@@ -86,7 +86,7 @@ describe('annotationMapper', function() {
assert.called($rootScope.$emit); assert.called($rootScope.$emit);
assert.calledWith($rootScope.$emit, events.ANNOTATION_UPDATED, { assert.calledWith($rootScope.$emit, events.ANNOTATION_UPDATED, {
id: 1, id: 1,
url: 'http://example.com' url: 'http://example.com',
}); });
}); });
...@@ -118,7 +118,7 @@ describe('annotationMapper', function() { ...@@ -118,7 +118,7 @@ describe('annotationMapper', function() {
annotationMapper.unloadAnnotations(annotations); annotationMapper.unloadAnnotations(annotations);
assert.calledWith($rootScope.$emit, events.ANNOTATIONS_UNLOADED, [{ assert.calledWith($rootScope.$emit, events.ANNOTATIONS_UNLOADED, [{
id: 1, id: 1,
url: 'http://example.com' url: 'http://example.com',
}]); }]);
}); });
}); });
......
...@@ -12,7 +12,7 @@ describe('annotation-metadata', function () { ...@@ -12,7 +12,7 @@ describe('annotation-metadata', function () {
it('returns the hostname from model.uri as the domain', function() { it('returns the hostname from model.uri as the domain', function() {
var model = { var model = {
document: {}, document: {},
uri: 'http://example.com/' uri: 'http://example.com/',
}; };
assert.equal(documentMetadata(model).domain, 'example.com'); assert.equal(documentMetadata(model).domain, 'example.com');
...@@ -22,7 +22,7 @@ describe('annotation-metadata', function () { ...@@ -22,7 +22,7 @@ describe('annotation-metadata', function () {
it('uses model.uri as the uri', function() { it('uses model.uri as the uri', function() {
var model = { var model = {
document: {}, document: {},
uri: 'http://example.com/' uri: 'http://example.com/',
}; };
assert.equal( assert.equal(
...@@ -35,7 +35,7 @@ describe('annotation-metadata', function () { ...@@ -35,7 +35,7 @@ describe('annotation-metadata', function () {
var model = { var model = {
uri: 'http://example.com/', uri: 'http://example.com/',
document: { document: {
title: ['My Document', 'My Other Document'] title: ['My Document', 'My Other Document'],
}, },
}; };
...@@ -93,7 +93,7 @@ describe('annotation-metadata', function () { ...@@ -93,7 +93,7 @@ describe('annotation-metadata', function () {
var model = { var model = {
links: { links: {
incontext: 'https://example.com', incontext: 'https://example.com',
} },
}; };
assert.equal(domainAndTitle(model).titleLink, 'https://example.com'); assert.equal(domainAndTitle(model).titleLink, 'https://example.com');
...@@ -197,8 +197,8 @@ describe('annotation-metadata', function () { ...@@ -197,8 +197,8 @@ describe('annotation-metadata', function () {
selector: [{ selector: [{
type: 'TextPositionSelector', type: 'TextPositionSelector',
start: 100, start: 100,
}] }],
}] }],
}), 100); }), 100);
}); });
...@@ -206,7 +206,7 @@ describe('annotation-metadata', function () { ...@@ -206,7 +206,7 @@ describe('annotation-metadata', function () {
assert.equal(annotationMetadata.location({ assert.equal(annotationMetadata.location({
target: [{ target: [{
selector: undefined, selector: undefined,
}] }],
}), Number.POSITIVE_INFINITY); }), Number.POSITIVE_INFINITY);
}); });
}); });
...@@ -214,23 +214,23 @@ describe('annotation-metadata', function () { ...@@ -214,23 +214,23 @@ describe('annotation-metadata', function () {
describe('.isPageNote', function () { describe('.isPageNote', function () {
it ('returns true for an annotation with an empty target', function () { it ('returns true for an annotation with an empty target', function () {
assert.isTrue(annotationMetadata.isPageNote({ assert.isTrue(annotationMetadata.isPageNote({
target: [] target: [],
})); }));
}); });
it ('returns true for an annotation without selectors', function () { it ('returns true for an annotation without selectors', function () {
assert.isTrue(annotationMetadata.isPageNote({ assert.isTrue(annotationMetadata.isPageNote({
target: [{selector: undefined}] target: [{selector: undefined}],
})); }));
}); });
it ('returns true for an annotation without a target', function () { it ('returns true for an annotation without a target', function () {
assert.isTrue(annotationMetadata.isPageNote({ assert.isTrue(annotationMetadata.isPageNote({
target: undefined target: undefined,
})); }));
}); });
it ('returns false for an annotation which is a reply', function () { it ('returns false for an annotation which is a reply', function () {
assert.isFalse(annotationMetadata.isPageNote({ assert.isFalse(annotationMetadata.isPageNote({
target: [], target: [],
references: ['xyz'] references: ['xyz'],
})); }));
}); });
}); });
...@@ -238,7 +238,7 @@ describe('annotation-metadata', function () { ...@@ -238,7 +238,7 @@ describe('annotation-metadata', function () {
describe ('.isAnnotation', function () { describe ('.isAnnotation', function () {
it ('returns true if an annotation is a top level annotation', function () { it ('returns true if an annotation is a top level annotation', function () {
assert.isTrue(annotationMetadata.isAnnotation({ assert.isTrue(annotationMetadata.isAnnotation({
target: [{selector: []}] target: [{selector: []}],
})); }));
}); });
it ('returns false if an annotation has no target', function () { it ('returns false if an annotation has no target', function () {
......
...@@ -36,8 +36,8 @@ describe('AnnotationUISync', function () { ...@@ -36,8 +36,8 @@ describe('AnnotationUISync', function () {
links: [ links: [
{ window: PARENT_WINDOW, channel: createChannel() }, { window: PARENT_WINDOW, channel: createChannel() },
{ window: 'ANOTHER_WINDOW', channel: createChannel() }, { window: 'ANOTHER_WINDOW', channel: createChannel() },
{ window: 'THIRD_WINDOW', channel: createChannel() } { window: 'THIRD_WINDOW', channel: createChannel() },
] ],
}; };
annotationUI = annotationUIFactory($rootScope, {}); annotationUI = annotationUIFactory($rootScope, {});
......
...@@ -120,7 +120,7 @@ describe('annotationUI', function () { ...@@ -120,7 +120,7 @@ describe('annotationUI', function () {
it('adds the passed annotations to the focusedAnnotationMap', function () { it('adds the passed annotations to the focusedAnnotationMap', function () {
annotationUI.focusAnnotations([1, 2, 3]); annotationUI.focusAnnotations([1, 2, 3]);
assert.deepEqual(annotationUI.getState().focusedAnnotationMap, { assert.deepEqual(annotationUI.getState().focusedAnnotationMap, {
1: true, 2: true, 3: true 1: true, 2: true, 3: true,
}); });
}); });
...@@ -128,7 +128,7 @@ describe('annotationUI', function () { ...@@ -128,7 +128,7 @@ describe('annotationUI', function () {
annotationUI.focusAnnotations([1]); annotationUI.focusAnnotations([1]);
annotationUI.focusAnnotations([2, 3]); annotationUI.focusAnnotations([2, 3]);
assert.deepEqual(annotationUI.getState().focusedAnnotationMap, { assert.deepEqual(annotationUI.getState().focusedAnnotationMap, {
2: true, 3: true 2: true, 3: true,
}); });
}); });
...@@ -170,7 +170,7 @@ describe('annotationUI', function () { ...@@ -170,7 +170,7 @@ describe('annotationUI', function () {
it('adds the passed annotations to the selectedAnnotationMap', function () { it('adds the passed annotations to the selectedAnnotationMap', function () {
annotationUI.selectAnnotations([1, 2, 3]); annotationUI.selectAnnotations([1, 2, 3]);
assert.deepEqual(annotationUI.getState().selectedAnnotationMap, { assert.deepEqual(annotationUI.getState().selectedAnnotationMap, {
1: true, 2: true, 3: true 1: true, 2: true, 3: true,
}); });
}); });
...@@ -178,7 +178,7 @@ describe('annotationUI', function () { ...@@ -178,7 +178,7 @@ describe('annotationUI', function () {
annotationUI.selectAnnotations([1]); annotationUI.selectAnnotations([1]);
annotationUI.selectAnnotations([2, 3]); annotationUI.selectAnnotations([2, 3]);
assert.deepEqual(annotationUI.getState().selectedAnnotationMap, { assert.deepEqual(annotationUI.getState().selectedAnnotationMap, {
2: true, 3: true 2: true, 3: true,
}); });
}); });
...@@ -194,7 +194,7 @@ describe('annotationUI', function () { ...@@ -194,7 +194,7 @@ describe('annotationUI', function () {
annotationUI.selectAnnotations([1, 2]); annotationUI.selectAnnotations([1, 2]);
annotationUI.toggleSelectedAnnotations([3, 4]); annotationUI.toggleSelectedAnnotations([3, 4]);
assert.deepEqual(annotationUI.getState().selectedAnnotationMap, { assert.deepEqual(annotationUI.getState().selectedAnnotationMap, {
1: true, 2: true, 3: true, 4: true 1: true, 2: true, 3: true, 4: true,
}); });
}); });
...@@ -216,7 +216,7 @@ describe('annotationUI', function () { ...@@ -216,7 +216,7 @@ describe('annotationUI', function () {
annotationUI.selectAnnotations([1, 2, 3]); annotationUI.selectAnnotations([1, 2, 3]);
annotationUI.removeSelectedAnnotation(2); annotationUI.removeSelectedAnnotation(2);
assert.deepEqual(annotationUI.getState().selectedAnnotationMap, { assert.deepEqual(annotationUI.getState().selectedAnnotationMap, {
1: true, 3: true 1: true, 3: true,
}); });
}); });
......
...@@ -16,7 +16,7 @@ function FakeStore(annots) { ...@@ -16,7 +16,7 @@ function FakeStore(annots) {
}); });
} }
return Promise.resolve(result); return Promise.resolve(result);
} },
}; };
this.search = function (query) { this.search = function (query) {
...@@ -59,7 +59,7 @@ describe('AnnotationViewerController', function () { ...@@ -59,7 +59,7 @@ describe('AnnotationViewerController', function () {
annotationUI: { annotationUI: {
setCollapsed: sinon.stub(), setCollapsed: sinon.stub(),
highlightAnnotations: sinon.stub(), highlightAnnotations: sinon.stub(),
subscribe: sinon.stub() subscribe: sinon.stub(),
}, },
rootThread: {thread: sinon.stub()}, rootThread: {thread: sinon.stub()},
streamer: { setConfig: function () {} }, streamer: { setConfig: function () {} },
...@@ -69,12 +69,12 @@ describe('AnnotationViewerController', function () { ...@@ -69,12 +69,12 @@ describe('AnnotationViewerController', function () {
return { return {
addClause: function () { addClause: function () {
return { return {
addClause: function () {} addClause: function () {},
}; };
} },
}; };
}, },
getFilter: function () {} getFilter: function () {},
}, },
annotationMapper: { annotationMapper: {
loadAnnotations: sinon.spy(), loadAnnotations: sinon.spy(),
......
...@@ -53,7 +53,7 @@ describe('AppController', function () { ...@@ -53,7 +53,7 @@ describe('AppController', function () {
fakeAnnotationUI = { fakeAnnotationUI = {
tool: 'comment', tool: 'comment',
clearSelectedAnnotations: sandbox.spy() clearSelectedAnnotations: sandbox.spy(),
}; };
fakeAuth = { fakeAuth = {
...@@ -66,16 +66,16 @@ describe('AppController', function () { ...@@ -66,16 +66,16 @@ describe('AppController', function () {
all: sandbox.stub().returns([]), all: sandbox.stub().returns([]),
discard: sandbox.spy(), discard: sandbox.spy(),
count: sandbox.stub().returns(0), count: sandbox.stub().returns(0),
unsaved: sandbox.stub().returns([]) unsaved: sandbox.stub().returns([]),
}; };
fakeFeatures = { fakeFeatures = {
fetch: sandbox.spy(), fetch: sandbox.spy(),
flagEnabled: sandbox.stub().returns(false) flagEnabled: sandbox.stub().returns(false),
}; };
fakeLocation = { fakeLocation = {
search: sandbox.stub().returns({}) search: sandbox.stub().returns({}),
}; };
fakeParams = {id: 'test'}; fakeParams = {id: 'test'};
...@@ -90,7 +90,7 @@ describe('AppController', function () { ...@@ -90,7 +90,7 @@ describe('AppController', function () {
fakeWindow = { fakeWindow = {
top: {}, top: {},
confirm: sandbox.stub() confirm: sandbox.stub(),
}; };
fakeSettings = { fakeSettings = {
......
...@@ -81,7 +81,7 @@ describe('build-thread', function () { ...@@ -81,7 +81,7 @@ describe('build-thread', function () {
references: ['1'], references: ['1'],
},{ },{
id: '3', id: '3',
references: ['1','2'] references: ['1','2'],
}]; }];
var thread = createThread(NESTED_FIXTURE); var thread = createThread(NESTED_FIXTURE);
...@@ -92,8 +92,8 @@ describe('build-thread', function () { ...@@ -92,8 +92,8 @@ describe('build-thread', function () {
children: [{ children: [{
annotation: NESTED_FIXTURE[2], annotation: NESTED_FIXTURE[2],
children: [], children: [],
}] }],
}] }],
}]); }]);
}); });
...@@ -210,7 +210,7 @@ describe('build-thread', function () { ...@@ -210,7 +210,7 @@ describe('build-thread', function () {
filterFn: function (annot) { filterFn: function (annot) {
return annot.text.match(/first/); return annot.text.match(/first/);
}, },
forceVisible: ['3'] forceVisible: ['3'],
}); });
assert.isFalse(thread.children[0].collapsed); assert.isFalse(thread.children[0].collapsed);
}); });
...@@ -252,14 +252,14 @@ describe('build-thread', function () { ...@@ -252,14 +252,14 @@ describe('build-thread', function () {
context('when there is a selection', function () { context('when there is a selection', function () {
it('shows only selected annotations', function () { it('shows only selected annotations', function () {
var thread = createThread(SIMPLE_FIXTURE, { var thread = createThread(SIMPLE_FIXTURE, {
selected: ['1'] selected: ['1'],
}); });
assert.deepEqual(thread, [{ assert.deepEqual(thread, [{
annotation: SIMPLE_FIXTURE[0], annotation: SIMPLE_FIXTURE[0],
children: [{ children: [{
annotation: SIMPLE_FIXTURE[2], annotation: SIMPLE_FIXTURE[2],
children: [], children: [],
}] }],
}]); }]);
}); });
}); });
...@@ -284,7 +284,7 @@ describe('build-thread', function () { ...@@ -284,7 +284,7 @@ describe('build-thread', function () {
assert.deepEqual(thread, [{ assert.deepEqual(thread, [{
annotation: fixture[1], annotation: fixture[1],
children: [] children: [],
}]); }]);
}); });
}); });
...@@ -322,14 +322,14 @@ describe('build-thread', function () { ...@@ -322,14 +322,14 @@ describe('build-thread', function () {
},{ },{
id: '3', id: '3',
references: ['1'], references: ['1'],
created: 100 created: 100,
},{ },{
id: '2', id: '2',
references: ['1'], references: ['1'],
created: 50, created: 50,
}]; }];
var thread = createThread(fixture, { var thread = createThread(fixture, {
sortCompareFn: function (a, b) { return a.id < b.id; } sortCompareFn: function (a, b) { return a.id < b.id; },
}); });
assert.deepEqual(annots(thread[0].children), assert.deepEqual(annots(thread[0].children),
[fixture[2], fixture[1]]); [fixture[2], fixture[1]]);
...@@ -349,7 +349,7 @@ describe('build-thread', function () { ...@@ -349,7 +349,7 @@ describe('build-thread', function () {
},{ },{
annotation: SIMPLE_FIXTURE[1], annotation: SIMPLE_FIXTURE[1],
children: [], children: [],
replyCount: 0 replyCount: 0,
}]); }]);
}); });
}); });
......
...@@ -11,8 +11,8 @@ var sessionWithThreeGroups = function() { ...@@ -11,8 +11,8 @@ var sessionWithThreeGroups = function() {
{name: 'Group 1', id: 'id1'}, {name: 'Group 1', id: 'id1'},
{name: 'Group 2', id: 'id2'}, {name: 'Group 2', id: 'id2'},
{name: 'Group 3', id: 'id3'}, {name: 'Group 3', id: 'id3'},
] ],
} },
}; };
}; };
...@@ -22,7 +22,7 @@ describe('groups', function() { ...@@ -22,7 +22,7 @@ describe('groups', function() {
var fakeRootScope; var fakeRootScope;
var fakeHttp; var fakeHttp;
var fakeSettings = { var fakeSettings = {
serviceUrl: 'https://test.hypothes.is/' serviceUrl: 'https://test.hypothes.is/',
}; };
var sandbox; var sandbox;
...@@ -32,7 +32,7 @@ describe('groups', function() { ...@@ -32,7 +32,7 @@ describe('groups', function() {
fakeSession = sessionWithThreeGroups(); fakeSession = sessionWithThreeGroups();
fakeLocalStorage = { fakeLocalStorage = {
getItem: sandbox.stub(), getItem: sandbox.stub(),
setItem: sandbox.stub() setItem: sandbox.stub(),
}; };
fakeRootScope = { fakeRootScope = {
eventCallbacks: [], eventCallbacks: [],
...@@ -43,7 +43,7 @@ describe('groups', function() { ...@@ -43,7 +43,7 @@ describe('groups', function() {
if (event === events.GROUPS_CHANGED) { if (event === events.GROUPS_CHANGED) {
this.eventCallbacks.push(callback); this.eventCallbacks.push(callback);
} }
} },
}; };
fakeHttp = sandbox.stub(); fakeHttp = sandbox.stub();
}); });
...@@ -73,7 +73,7 @@ describe('groups', function() { ...@@ -73,7 +73,7 @@ describe('groups', function() {
assert.deepEqual(groups, [ assert.deepEqual(groups, [
{name: 'Group 1', id: 'id1'}, {name: 'Group 1', id: 'id1'},
{name: 'Group 2', id: 'id2'}, {name: 'Group 2', id: 'id2'},
{name: 'Group 3', id: 'id3'} {name: 'Group 3', id: 'id3'},
]); ]);
}); });
}); });
...@@ -177,7 +177,7 @@ describe('groups', function() { ...@@ -177,7 +177,7 @@ describe('groups', function() {
s.leave('id2'); s.leave('id2');
assert.calledWithMatch(fakeHttp, { assert.calledWithMatch(fakeHttp, {
url: fakeSettings.serviceUrl + 'groups/id2/leave', url: fakeSettings.serviceUrl + 'groups/id2/leave',
method: 'POST' method: 'POST',
}); });
}); });
}); });
......
...@@ -111,7 +111,7 @@ describe('markdown commands', function () { ...@@ -111,7 +111,7 @@ describe('markdown commands', function () {
'one [' + sel + '](<sel>http://insert-your-link-here.com</sel>) three'); 'one [' + sel + '](<sel>http://insert-your-link-here.com</sel>) three');
},[ },[
{selection: 'two'}, {selection: 'two'},
{selection: 'jim:smith'} {selection: 'jim:smith'},
]); ]);
unroll('converts URLs to links', function (testCase) { unroll('converts URLs to links', function (testCase) {
......
...@@ -10,9 +10,9 @@ function fakeExceptionData(scriptURL) { ...@@ -10,9 +10,9 @@ function fakeExceptionData(scriptURL) {
stacktrace: { stacktrace: {
frames: [{ frames: [{
filename: scriptURL, filename: scriptURL,
}] }],
} },
}] }],
}, },
culprit: scriptURL, culprit: scriptURL,
}; };
......
...@@ -148,7 +148,7 @@ describe('rootThread', function () { ...@@ -148,7 +148,7 @@ describe('rootThread', function () {
function targetWithPos(pos) { function targetWithPos(pos) {
return [{ return [{
selector: [{type: 'TextPositionSelector', start: pos}] selector: [{type: 'TextPositionSelector', start: pos}],
}]; }];
} }
......
...@@ -63,8 +63,8 @@ describe('h:session', function () { ...@@ -63,8 +63,8 @@ describe('h:session', function () {
it('should invoke the flash service with any flash messages', function () { it('should invoke the flash service with any flash messages', function () {
var response = { var response = {
flash: { flash: {
error: ['fail'] error: ['fail'],
} },
}; };
$httpBackend.expectPOST(url).respond(response); $httpBackend.expectPOST(url).respond(response);
session.login({}); session.login({});
...@@ -75,12 +75,12 @@ describe('h:session', function () { ...@@ -75,12 +75,12 @@ describe('h:session', function () {
it('should assign errors and status reasons to the model', function () { it('should assign errors and status reasons to the model', function () {
var response = { var response = {
model: { model: {
userid: 'alice' userid: 'alice',
}, },
errors: { errors: {
password: 'missing' password: 'missing',
}, },
reason: 'bad credentials' reason: 'bad credentials',
}; };
$httpBackend.expectPOST(url).respond(response); $httpBackend.expectPOST(url).respond(response);
var result = session.login({}); var result = session.login({});
...@@ -95,7 +95,7 @@ describe('h:session', function () { ...@@ -95,7 +95,7 @@ describe('h:session', function () {
var headers = { var headers = {
'Accept': 'application/json, text/plain, */*', 'Accept': 'application/json, text/plain, */*',
'Content-Type': 'application/json;charset=utf-8', 'Content-Type': 'application/json;charset=utf-8',
'X-XSRF-TOKEN': token 'X-XSRF-TOKEN': token,
}; };
var model = {csrf: token}; var model = {csrf: token};
$httpBackend.expectPOST(url).respond({model: model}); $httpBackend.expectPOST(url).respond({model: model});
...@@ -111,8 +111,8 @@ describe('h:session', function () { ...@@ -111,8 +111,8 @@ describe('h:session', function () {
it('should expose the model as session.state', function () { it('should expose the model as session.state', function () {
var response = { var response = {
model: { model: {
userid: 'alice' userid: 'alice',
} },
}; };
assert.deepEqual(session.state, {}); assert.deepEqual(session.state, {});
$httpBackend.expectPOST(url).respond(response); $httpBackend.expectPOST(url).respond(response);
...@@ -185,7 +185,7 @@ describe('h:session', function () { ...@@ -185,7 +185,7 @@ describe('h:session', function () {
$rootScope.$on(events.SESSION_CHANGED, sessionChangeCallback); $rootScope.$on(events.SESSION_CHANGED, sessionChangeCallback);
session.update({ session.update({
groups: [{ groups: [{
id: 'groupid' id: 'groupid',
}], }],
csrf: 'dummytoken', csrf: 'dummytoken',
}); });
...@@ -196,9 +196,9 @@ describe('h:session', function () { ...@@ -196,9 +196,9 @@ describe('h:session', function () {
sessionChangeCallback.reset(); sessionChangeCallback.reset();
session.update({ session.update({
groups: [{ groups: [{
id: 'groupid2' id: 'groupid2',
}], }],
csrf: 'dummytoken' csrf: 'dummytoken',
}); });
assert.calledWith(sessionChangeCallback, sinon.match({}), assert.calledWith(sessionChangeCallback, sinon.match({}),
{initialLoad: false}); {initialLoad: false});
...@@ -209,9 +209,9 @@ describe('h:session', function () { ...@@ -209,9 +209,9 @@ describe('h:session', function () {
$rootScope.$on(events.GROUPS_CHANGED, groupChangeCallback); $rootScope.$on(events.GROUPS_CHANGED, groupChangeCallback);
session.update({ session.update({
groups: [{ groups: [{
id: 'groupid' id: 'groupid',
}], }],
csrf: 'dummytoken' csrf: 'dummytoken',
}); });
assert.calledOnce(groupChangeCallback); assert.calledOnce(groupChangeCallback);
}); });
...@@ -221,7 +221,7 @@ describe('h:session', function () { ...@@ -221,7 +221,7 @@ describe('h:session', function () {
$rootScope.$on(events.USER_CHANGED, userChangeCallback); $rootScope.$on(events.USER_CHANGED, userChangeCallback);
session.update({ session.update({
userid: 'fred', userid: 'fred',
csrf: 'dummytoken' csrf: 'dummytoken',
}); });
assert.calledOnce(userChangeCallback); assert.calledOnce(userChangeCallback);
}); });
......
...@@ -98,11 +98,11 @@ describe('store', function () { ...@@ -98,11 +98,11 @@ describe('store', function () {
var annotation = { var annotation = {
$highlight: true, $highlight: true,
$notme: 'nooooo!', $notme: 'nooooo!',
allowed: 123 allowed: 123,
}; };
store.annotation.create({}, annotation); store.annotation.create({}, annotation);
$httpBackend.expectPOST('http://example.com/api/annotations', { $httpBackend.expectPOST('http://example.com/api/annotations', {
allowed: 123 allowed: 123,
}) })
.respond(function () { return {id: 'test'}; }); .respond(function () { return {id: 'test'}; });
$httpBackend.flush(); $httpBackend.flush();
......
...@@ -53,7 +53,7 @@ describe('streamer', function () { ...@@ -53,7 +53,7 @@ describe('streamer', function () {
fakeRootScope = { fakeRootScope = {
$apply: function (callback) { $apply: function (callback) {
callback(); callback();
} },
}; };
fakeAnnotationMapper = { fakeAnnotationMapper = {
...@@ -110,8 +110,8 @@ describe('streamer', function () { ...@@ -110,8 +110,8 @@ describe('streamer', function () {
action: 'create', action: 'create',
}, },
payload: [{ payload: [{
group: 'public' group: 'public',
}] }],
}); });
assert.ok(fakeAnnotationMapper.loadAnnotations.calledOnce); assert.ok(fakeAnnotationMapper.loadAnnotations.calledOnce);
}); });
...@@ -124,8 +124,8 @@ describe('streamer', function () { ...@@ -124,8 +124,8 @@ describe('streamer', function () {
action: 'delete', action: 'delete',
}, },
payload: [{ payload: [{
group: 'public' group: 'public',
}] }],
}); });
assert.ok(fakeAnnotationMapper.unloadAnnotations.calledOnce); assert.ok(fakeAnnotationMapper.unloadAnnotations.calledOnce);
}); });
...@@ -136,8 +136,8 @@ describe('streamer', function () { ...@@ -136,8 +136,8 @@ describe('streamer', function () {
createDefaultStreamer(); createDefaultStreamer();
var model = { var model = {
groups: [{ groups: [{
id: 'new-group' id: 'new-group',
}] }],
}; };
fakeWebSocket.notify({ fakeWebSocket.notify({
type: 'session-change', type: 'session-change',
......
...@@ -22,7 +22,7 @@ var FIXTURES_TO_FUZZY_STRING = [ ...@@ -22,7 +22,7 @@ var FIXTURES_TO_FUZZY_STRING = [
[1 * year, '1 Jan 1970'], [1 * year, '1 Jan 1970'],
[1 * year + 2 * month, '1 Jan 1970'], [1 * year + 2 * month, '1 Jan 1970'],
[2 * year, '1 Jan 1970'], [2 * year, '1 Jan 1970'],
[8 * year, '1 Jan 1970'] [8 * year, '1 Jan 1970'],
]; ];
var FIXTURES_NEXT_FUZZY_UPDATE = [ var FIXTURES_NEXT_FUZZY_UPDATE = [
...@@ -35,7 +35,7 @@ var FIXTURES_NEXT_FUZZY_UPDATE = [ ...@@ -35,7 +35,7 @@ var FIXTURES_NEXT_FUZZY_UPDATE = [
[27 * hour, null], [27 * hour, null],
[3 * day + 30 * minute, null], [3 * day + 30 * minute, null],
[6 * month + 2 * day, null], [6 * month + 2 * day, null],
[8 * year, null] [8 * year, null],
]; ];
describe('time', function () { describe('time', function () {
...@@ -69,9 +69,9 @@ describe('time', function () { ...@@ -69,9 +69,9 @@ describe('time', function () {
} else { } else {
return '1 Jan 1970'; return '1 Jan 1970';
} }
} },
}; };
} },
}; };
} }
......
...@@ -81,7 +81,7 @@ describe('WidgetController', function () { ...@@ -81,7 +81,7 @@ describe('WidgetController', function () {
fakeAnnotationMapper = { fakeAnnotationMapper = {
loadAnnotations: sandbox.spy(), loadAnnotations: sandbox.spy(),
unloadAnnotations: sandbox.spy() unloadAnnotations: sandbox.spy(),
}; };
fakeCrossFrame = { fakeCrossFrame = {
...@@ -98,13 +98,13 @@ describe('WidgetController', function () { ...@@ -98,13 +98,13 @@ describe('WidgetController', function () {
}; };
fakeStreamer = { fakeStreamer = {
setConfig: sandbox.spy() setConfig: sandbox.spy(),
}; };
fakeStreamFilter = { fakeStreamFilter = {
resetFilter: sandbox.stub().returnsThis(), resetFilter: sandbox.stub().returnsThis(),
addClause: sandbox.stub().returnsThis(), addClause: sandbox.stub().returnsThis(),
getFilter: sandbox.stub().returns({}) getFilter: sandbox.stub().returns({}),
}; };
fakeGroups = { fakeGroups = {
...@@ -334,7 +334,7 @@ describe('WidgetController', function () { ...@@ -334,7 +334,7 @@ describe('WidgetController', function () {
it('does not clear the selection if the new annotation is a reply', function () { it('does not clear the selection if the new annotation is a reply', function () {
$rootScope.$emit('beforeAnnotationCreated', { $rootScope.$emit('beforeAnnotationCreated', {
references: ['parent-id'] references: ['parent-id'],
}); });
assert.notCalled($scope.clearSelection); assert.notCalled($scope.clearSelection);
}); });
...@@ -353,7 +353,7 @@ describe('WidgetController', function () { ...@@ -353,7 +353,7 @@ describe('WidgetController', function () {
{ {
uri: 'http://www.example.com', uri: 'http://www.example.com',
searchUris: [], searchUris: [],
} },
]; ];
// There is a direct-linked annotation // There is a direct-linked annotation
...@@ -393,7 +393,7 @@ describe('WidgetController', function () { ...@@ -393,7 +393,7 @@ describe('WidgetController', function () {
it('shows logged out message if selection is available', function () { it('shows logged out message if selection is available', function () {
$scope.auth = { $scope.auth = {
status: 'logged-out' status: 'logged-out',
}; };
annotationUI.addAnnotations([{id: '123'}]); annotationUI.addAnnotations([{id: '123'}]);
annotationUI.selectAnnotations(['123']); annotationUI.selectAnnotations(['123']);
...@@ -403,7 +403,7 @@ describe('WidgetController', function () { ...@@ -403,7 +403,7 @@ describe('WidgetController', function () {
it('does not show loggedout message if selection is unavailable', function () { it('does not show loggedout message if selection is unavailable', function () {
$scope.auth = { $scope.auth = {
status: 'logged-out' status: 'logged-out',
}; };
annotationUI.selectAnnotations(['missing']); annotationUI.selectAnnotations(['missing']);
$scope.$digest(); $scope.$digest();
...@@ -412,7 +412,7 @@ describe('WidgetController', function () { ...@@ -412,7 +412,7 @@ describe('WidgetController', function () {
it('does not show loggedout message if there is no selection', function () { it('does not show loggedout message if there is no selection', function () {
$scope.auth = { $scope.auth = {
status: 'logged-out' status: 'logged-out',
}; };
annotationUI.selectAnnotations([]); annotationUI.selectAnnotations([]);
$scope.$digest(); $scope.$digest();
...@@ -421,7 +421,7 @@ describe('WidgetController', function () { ...@@ -421,7 +421,7 @@ describe('WidgetController', function () {
it('does not show loggedout message if user is not logged out', function () { it('does not show loggedout message if user is not logged out', function () {
$scope.auth = { $scope.auth = {
status: 'logged-in' status: 'logged-in',
}; };
annotationUI.addAnnotations([{id: '123'}]); annotationUI.addAnnotations([{id: '123'}]);
annotationUI.selectAnnotations(['123']); annotationUI.selectAnnotations(['123']);
...@@ -431,7 +431,7 @@ describe('WidgetController', function () { ...@@ -431,7 +431,7 @@ describe('WidgetController', function () {
it('does not show loggedout message if not a direct link', function () { it('does not show loggedout message if not a direct link', function () {
$scope.auth = { $scope.auth = {
status: 'logged-out' status: 'logged-out',
}; };
delete fakeSettings.annotations; delete fakeSettings.annotations;
annotationUI.addAnnotations([{id: '123'}]); annotationUI.addAnnotations([{id: '123'}]);
......
...@@ -103,33 +103,33 @@ var BREAKPOINTS = [ ...@@ -103,33 +103,33 @@ var BREAKPOINTS = [
{ {
test: lessThanThirtySecondsAgo, test: lessThanThirtySecondsAgo,
format: function () {return 'Just now';}, format: function () {return 'Just now';},
nextUpdate: 1 nextUpdate: 1,
}, },
{ {
test: lessThanOneMinuteAgo, test: lessThanOneMinuteAgo,
format: nSec, format: nSec,
nextUpdate: 1 nextUpdate: 1,
}, },
{ {
test: lessThanOneHourAgo, test: lessThanOneHourAgo,
format: nMin, format: nMin,
nextUpdate: minute nextUpdate: minute,
}, },
{ {
test: lessThanOneDayAgo, test: lessThanOneDayAgo,
format: nHr, format: nHr,
nextUpdate: hour nextUpdate: hour,
}, },
{ {
test: thisYear, test: thisYear,
format: dayAndMonth, format: dayAndMonth,
nextUpdate: null nextUpdate: null,
}, },
{ {
test: function () {return true;}, test: function () {return true;},
format: dayAndMonthAndYear, format: dayAndMonthAndYear,
nextUpdate: null nextUpdate: null,
} },
]; ];
function getBreakpoint(date, now) { function getBreakpoint(date, now) {
......
...@@ -76,7 +76,7 @@ function delay(delay, src) { ...@@ -76,7 +76,7 @@ function delay(delay, src) {
lastValue = value; lastValue = value;
clearTimeout(timeout); clearTimeout(timeout);
timeout = setTimeout(onNext, delay); timeout = setTimeout(onNext, delay);
} },
}); });
return function () { return function () {
......
...@@ -50,7 +50,7 @@ function Socket(url) { ...@@ -50,7 +50,7 @@ function Socket(url) {
// Don't retry forever -- fail permanently after 10 retries // Don't retry forever -- fail permanently after 10 retries
retries: 10, retries: 10,
// Randomize retry times to minimise the thundering herd effect // Randomize retry times to minimise the thundering herd effect
randomize: true randomize: true,
}); });
operation.attempt(function () { operation.attempt(function () {
......
...@@ -53,7 +53,7 @@ var stripReturnPatterns = [ ...@@ -53,7 +53,7 @@ var stripReturnPatterns = [
// Unit test cases // Unit test cases
/it\(/, /it\(/,
// Assignments in setters etc. // Assignments in setters etc.
/[^=]+=[^=]+/ /[^=]+=[^=]+/,
]; ];
/** /**
......
...@@ -73,7 +73,7 @@ function uploadReleaseFile(opts, project, release, file) { ...@@ -73,7 +73,7 @@ function uploadReleaseFile(opts, project, release, file) {
formData: { formData: {
file: fs.createReadStream(file.path), file: fs.createReadStream(file.path),
name: path.basename(file.path), name: path.basename(file.path),
} },
}).then(function (result) { }).then(function (result) {
if (result.response.statusCode === 201) { if (result.response.statusCode === 201) {
return; return;
......
...@@ -19,7 +19,7 @@ module.exports = { ...@@ -19,7 +19,7 @@ module.exports = {
'ng-tags-input', 'ng-tags-input',
'angular-toastr', 'angular-toastr',
'angulartics/src/angulartics', 'angulartics/src/angulartics',
'angulartics/src/angulartics-ga' 'angulartics/src/angulartics-ga',
], ],
katex: ['katex'], katex: ['katex'],
showdown: ['showdown'], showdown: ['showdown'],
...@@ -39,5 +39,5 @@ module.exports = { ...@@ -39,5 +39,5 @@ module.exports = {
noParseModules: [ noParseModules: [
'jquery', 'jquery',
'katex', 'katex',
] ],
}; };
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