Преглед изворни кода

code style improvements (for jscs)

Adam Shaw пре 12 година
родитељ
комит
d2b85cf80c

+ 1 - 1
src/common/CoordinateGrid.js

@@ -29,7 +29,7 @@ function CoordinateGrid(buildFunc) {
 				break;
 				break;
 			}
 			}
 		}
 		}
-		return (r>=0 && c>=0) ? { row:r, col:c } : null;
+		return (r>=0 && c>=0) ? { row: r, col: c } : null;
 	};
 	};
 	
 	
 	
 	

+ 1 - 1
src/common/DayEventRenderer.js

@@ -648,7 +648,7 @@ function DayEventRenderer() {
 			var eventEnd;
 			var eventEnd;
 			var helpers;
 			var helpers;
 			var eventCopy = $.extend({}, event);
 			var eventCopy = $.extend({}, event);
-			var minCellOffset = dayOffsetToCellOffset( dateToDayOffset(event.start) );
+			var minCellOffset = dayOffsetToCellOffset(dateToDayOffset(event.start));
 			clearSelection();
 			clearSelection();
 			$('body')
 			$('body')
 				.css('cursor', direction + '-resize')
 				.css('cursor', direction + '-resize')

+ 1 - 1
src/common/View.js

@@ -481,7 +481,7 @@ function View(element, calendar, viewName) {
 		var out = date.clone();
 		var out = date.clone();
 		inc = inc || 1;
 		inc = inc || 1;
 		while (
 		while (
-			isHiddenDayHash[ ( out.day() + (isExclusive ? inc : 0) + 7 ) % 7 ]
+			isHiddenDayHash[(out.day() + (isExclusive ? inc : 0) + 7) % 7]
 		) {
 		) {
 			out.add('days', inc);
 			out.add('days', inc);
 		}
 		}

+ 1 - 1
src/gcal/gcal.js

@@ -41,7 +41,7 @@ function transformOptions(sourceOptions, start, end, timezone) {
 
 
 	var success = sourceOptions.success;
 	var success = sourceOptions.success;
 	var data = $.extend({}, sourceOptions.data || {}, {
 	var data = $.extend({}, sourceOptions.data || {}, {
-		'singleevents': true,
+		singleevents: true,
 		'max-results': 9999
 		'max-results': 9999
 	});
 	});
 
 

+ 6 - 4
tests/automated/fullCalendar.js

@@ -48,10 +48,12 @@ describe('fullCalendar constructor', function() {
 					editable: true
 					editable: true
 				});
 				});
 				$('#calendar').fullCalendar('addEventSource', {
 				$('#calendar').fullCalendar('addEventSource', {
-					events: [{
-						title: eventName,
-						start: new Date()
-					}]
+					events: [
+						{
+							title: eventName,
+							start: new Date()
+						}
+					]
 				});
 				});
 				var el = $('div .fc-event');
 				var el = $('div .fc-event');
 				var offsetBefore = el.offset();
 				var offsetBefore = el.offset();

+ 3 - 3
tests/automated/hiddenDays.js

@@ -30,7 +30,7 @@ describe('hiddenDays', function() {
 	describe('when setting hiddenDays with 1', function() {
 	describe('when setting hiddenDays with 1', function() {
 		beforeEach(function() {
 		beforeEach(function() {
 			$('#cal').fullCalendar({
 			$('#cal').fullCalendar({
-				hiddenDays: [1]
+				hiddenDays: [ 1 ]
 			});
 			});
 		});
 		});
 		it('should return 6 days', function() {
 		it('should return 6 days', function() {
@@ -52,7 +52,7 @@ describe('hiddenDays', function() {
 	describe('when setting hiddenDays with 3,5', function() {
 	describe('when setting hiddenDays with 3,5', function() {
 		beforeEach(function() {
 		beforeEach(function() {
 			$('#cal').fullCalendar({
 			$('#cal').fullCalendar({
-				hiddenDays: [3, 5]
+				hiddenDays: [ 3, 5 ]
 			});
 			});
 		});
 		});
 		it('should return 6 days', function() {
 		it('should return 6 days', function() {
@@ -78,7 +78,7 @@ describe('hiddenDays', function() {
 	describe('when setting all hiddenDays', function() {
 	describe('when setting all hiddenDays', function() {
 		it('should expect to throw an exception', function() {
 		it('should expect to throw an exception', function() {
 			var options = {
 			var options = {
-				hiddenDays: [0, 1, 2, 3, 4, 5, 6]
+				hiddenDays: [ 0, 1, 2, 3, 4, 5, 6 ]
 			};
 			};
 			expect(function() {
 			expect(function() {
 				$('#cal').fullCalendar(options);
 				$('#cal').fullCalendar(options);

+ 3 - 3
tests/automated/minTime.js

@@ -7,7 +7,7 @@ describe('minTime', function() {
 
 
 	var numToStringConverter = function(timeIn) {
 	var numToStringConverter = function(timeIn) {
 		var time = (timeIn % 12);
 		var time = (timeIn % 12);
-		if ($.inArray(timeIn, [0, 12]) != -1) {
+		if ($.inArray(timeIn, [ 0, 12 ]) != -1) {
 			time = 12;
 			time = 12;
 		}
 		}
 		var amPm = 'am';
 		var amPm = 'am';
@@ -44,7 +44,7 @@ describe('minTime', function() {
 
 
 	describe('when using a whole number', 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() {
 		describe('in agendaWeek', function() {
 			beforeEach(function() {
 			beforeEach(function() {
@@ -85,7 +85,7 @@ describe('minTime', function() {
 
 
 	describe('when using default slotInterval and \'uneven\' 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() {
 		describe('in agendaWeek', function() {
 			beforeEach(function() {
 			beforeEach(function() {

+ 1 - 1
tests/automated/slotDuration.js

@@ -55,7 +55,7 @@ describe('slotDuration', function() {
 
 
 	describe('when slotMinutes is set to a series of times', 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() {
 		describe('in agendaWeek', function() {
 			beforeEach(function() {
 			beforeEach(function() {