From d2b85cf80c389f11a2df532c804b1ee6d22fbf12 Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Fri, 31 Jan 2014 00:08:05 -0800 Subject: [PATCH] code style improvements (for jscs) --- src/common/CoordinateGrid.js | 2 +- src/common/DayEventRenderer.js | 2 +- src/common/View.js | 2 +- src/gcal/gcal.js | 2 +- tests/automated/fullCalendar.js | 10 ++++++---- tests/automated/hiddenDays.js | 6 +++--- tests/automated/minTime.js | 6 +++--- tests/automated/slotDuration.js | 2 +- 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/common/CoordinateGrid.js b/src/common/CoordinateGrid.js index 7c5ef7e..e200873 100644 --- a/src/common/CoordinateGrid.js +++ b/src/common/CoordinateGrid.js @@ -29,7 +29,7 @@ function CoordinateGrid(buildFunc) { break; } } - return (r>=0 && c>=0) ? { row:r, col:c } : null; + return (r>=0 && c>=0) ? { row: r, col: c } : null; }; diff --git a/src/common/DayEventRenderer.js b/src/common/DayEventRenderer.js index 285d2e5..fa34614 100644 --- a/src/common/DayEventRenderer.js +++ b/src/common/DayEventRenderer.js @@ -648,7 +648,7 @@ function DayEventRenderer() { var eventEnd; var helpers; var eventCopy = $.extend({}, event); - var minCellOffset = dayOffsetToCellOffset( dateToDayOffset(event.start) ); + var minCellOffset = dayOffsetToCellOffset(dateToDayOffset(event.start)); clearSelection(); $('body') .css('cursor', direction + '-resize') diff --git a/src/common/View.js b/src/common/View.js index 51d1109..fa4bb80 100644 --- a/src/common/View.js +++ b/src/common/View.js @@ -481,7 +481,7 @@ function View(element, calendar, viewName) { var out = date.clone(); inc = inc || 1; while ( - isHiddenDayHash[ ( out.day() + (isExclusive ? inc : 0) + 7 ) % 7 ] + isHiddenDayHash[(out.day() + (isExclusive ? inc : 0) + 7) % 7] ) { out.add('days', inc); } diff --git a/src/gcal/gcal.js b/src/gcal/gcal.js index 19d2903..5cd282f 100644 --- a/src/gcal/gcal.js +++ b/src/gcal/gcal.js @@ -41,7 +41,7 @@ function transformOptions(sourceOptions, start, end, timezone) { var success = sourceOptions.success; var data = $.extend({}, sourceOptions.data || {}, { - 'singleevents': true, + singleevents: true, 'max-results': 9999 }); diff --git a/tests/automated/fullCalendar.js b/tests/automated/fullCalendar.js index e2c3eb2..7dd6133 100644 --- a/tests/automated/fullCalendar.js +++ b/tests/automated/fullCalendar.js @@ -48,10 +48,12 @@ describe('fullCalendar constructor', function() { editable: true }); $('#calendar').fullCalendar('addEventSource', { - events: [{ - title: eventName, - start: new Date() - }] + events: [ + { + title: eventName, + start: new Date() + } + ] }); var el = $('div .fc-event'); var offsetBefore = el.offset(); diff --git a/tests/automated/hiddenDays.js b/tests/automated/hiddenDays.js index 3f52567..9b2ae74 100644 --- a/tests/automated/hiddenDays.js +++ b/tests/automated/hiddenDays.js @@ -30,7 +30,7 @@ describe('hiddenDays', function() { describe('when setting hiddenDays with 1', function() { beforeEach(function() { $('#cal').fullCalendar({ - hiddenDays: [1] + hiddenDays: [ 1 ] }); }); it('should return 6 days', function() { @@ -52,7 +52,7 @@ describe('hiddenDays', function() { describe('when setting hiddenDays with 3,5', function() { beforeEach(function() { $('#cal').fullCalendar({ - hiddenDays: [3, 5] + hiddenDays: [ 3, 5 ] }); }); it('should return 6 days', function() { @@ -78,7 +78,7 @@ describe('hiddenDays', function() { describe('when setting all hiddenDays', function() { it('should expect to throw an exception', function() { var options = { - hiddenDays: [0, 1, 2, 3, 4, 5, 6] + hiddenDays: [ 0, 1, 2, 3, 4, 5, 6 ] }; expect(function() { $('#cal').fullCalendar(options); diff --git a/tests/automated/minTime.js b/tests/automated/minTime.js index 44195ac..fbc606c 100644 --- a/tests/automated/minTime.js +++ b/tests/automated/minTime.js @@ -7,7 +7,7 @@ describe('minTime', function() { var numToStringConverter = function(timeIn) { var time = (timeIn % 12); - if ($.inArray(timeIn, [0, 12]) != -1) { + if ($.inArray(timeIn, [ 0, 12 ]) != -1) { time = 12; } var amPm = 'am'; @@ -44,7 +44,7 @@ describe('minTime', function() { describe('when using a whole number', function() { - var hourNumbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]; + var hourNumbers = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 ]; describe('in agendaWeek', function() { beforeEach(function() { @@ -85,7 +85,7 @@ describe('minTime', function() { describe('when using default slotInterval and \'uneven\' minTime', function() { - var hourNumbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]; + var hourNumbers = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 ]; describe('in agendaWeek', function() { beforeEach(function() { diff --git a/tests/automated/slotDuration.js b/tests/automated/slotDuration.js index d967743..36c0c7c 100644 --- a/tests/automated/slotDuration.js +++ b/tests/automated/slotDuration.js @@ -55,7 +55,7 @@ describe('slotDuration', function() { describe('when slotMinutes is set to a series of times', function() { - var slotMinutesList = [10, 12, 15, 17, 20, 30, 35, 45, 60, 62, 120, 300]; + var slotMinutesList = [ 10, 12, 15, 17, 20, 30, 35, 45, 60, 62, 120, 300 ]; describe('in agendaWeek', function() { beforeEach(function() {