Переглянути джерело

ChronoComponent -> DateComponent

Adam Shaw 8 роки тому
батько
коміт
49779dd574

+ 3 - 3
src.json

@@ -36,9 +36,9 @@
     "component/FillRenderer.js",
     "component/HelperRenderer.js",
     "component/Component.js",
-    "component/ChronoComponent.js",
-    "component/ChronoComponent.util.js",
-    "component/InteractiveChronoComponent.js",
+    "component/DateComponent.js",
+    "component/DateComponent.util.js",
+    "component/InteractiveDateComponent.js",
     "common/DayGridFillRenderer.js",
     "common/DayGridEventRenderer.js",
     "common/DayGridHelperRenderer.js",

+ 0 - 2
src/agenda/AgendaView.js

@@ -110,7 +110,6 @@ var AgendaView = FC.AgendaView = View.extend({
 
 	// Unrenders the content of the view. Since we haven't separated skeleton rendering from date rendering,
 	// always completely kill each grid's rendering.
-	// TODO: move this over to ChronoComponent
 	unrenderDates: function() {
 		this.timeGrid.unrenderDates();
 		this.timeGrid.removeElement();
@@ -304,7 +303,6 @@ var AgendaView = FC.AgendaView = View.extend({
 		View.prototype.renderEventsPayload.apply(this, arguments);
 
 		// the all-day area is flexible and might have a lot of events, so shift the height
-		// TODO: how will ChronoComponent handle this?
 		this.updateHeight();
 	},
 

+ 0 - 1
src/basic/BasicView.js

@@ -263,7 +263,6 @@ var BasicView = FC.BasicView = View.extend({
 		View.prototype.renderEventsPayload.apply(this, arguments);
 
 		// must compensate for events that overflow the row
-		// TODO: how will ChronoComponent handle this?
 		this.updateHeight();
 	}
 

+ 5 - 5
src/common/DayGrid.js

@@ -2,7 +2,7 @@
 /* A component that renders a grid of whole-days that runs horizontally. There can be multiple rows, one per week.
 ----------------------------------------------------------------------------------------------------------------------*/
 
-var DayGrid = FC.DayGrid = InteractiveChronoComponent.extend(StandardInteractionsMixin, DayTableMixin, {
+var DayGrid = FC.DayGrid = InteractiveDateComponent.extend(StandardInteractionsMixin, DayTableMixin, {
 
 	eventRendererClass: DayGridEventRenderer,
 	helperRendererClass: DayGridHelperRenderer,
@@ -24,7 +24,7 @@ var DayGrid = FC.DayGrid = InteractiveChronoComponent.extend(StandardInteraction
 	constructor: function(view) {
 		this.view = view; // do first, for opt calls during initialization
 
-		InteractiveChronoComponent.call(this);
+		InteractiveDateComponent.call(this);
 	},
 
 
@@ -319,7 +319,7 @@ var DayGrid = FC.DayGrid = InteractiveChronoComponent.extend(StandardInteraction
 			return eventFootprint.componentFootprint.isAllDay;
 		});
 
-		return InteractiveChronoComponent.prototype.renderBgEventFootprints.call(this, allDayEventFootprints);
+		return InteractiveDateComponent.prototype.renderBgEventFootprints.call(this, allDayEventFootprints);
 	},
 
 
@@ -327,13 +327,13 @@ var DayGrid = FC.DayGrid = InteractiveChronoComponent.extend(StandardInteraction
 	unrenderEvents: function() {
 		this.removeSegPopover(); // removes the "more.." events popover
 
-		InteractiveChronoComponent.prototype.unrenderEvents.apply(this, arguments);
+		InteractiveDateComponent.prototype.unrenderEvents.apply(this, arguments);
 	},
 
 
 	// Retrieves all rendered segment objects currently rendered on the grid
 	getEventSegs: function() {
-		return InteractiveChronoComponent.prototype.getEventSegs.call(this) // get the segments from the super-method
+		return InteractiveDateComponent.prototype.getEventSegs.call(this) // get the segments from the super-method
 			.concat(this.popoverSegs || []); // append the segments from the "more..." popover
 	},
 

+ 2 - 2
src/common/TimeGrid.js

@@ -3,7 +3,7 @@
 ----------------------------------------------------------------------------------------------------------------------*/
 // We mixin DayTable, even though there is only a single row of days
 
-var TimeGrid = FC.TimeGrid = InteractiveChronoComponent.extend(StandardInteractionsMixin, DayTableMixin, {
+var TimeGrid = FC.TimeGrid = InteractiveDateComponent.extend(StandardInteractionsMixin, DayTableMixin, {
 
 	eventRendererClass: TimeGridEventRenderer,
 	businessHourRendererClass: BusinessHourRenderer,
@@ -46,7 +46,7 @@ var TimeGrid = FC.TimeGrid = InteractiveChronoComponent.extend(StandardInteracti
 	constructor: function(view) {
 		this.view = view; // do first, for opt calls during initialization
 
-		InteractiveChronoComponent.call(this); // call the super-constructor
+		InteractiveDateComponent.call(this); // call the super-constructor
 
 		this.processOptions();
 	},

+ 1 - 1
src/common/View.date-range.js

@@ -349,7 +349,7 @@ View.mixin({
 	},
 
 
-	// For ChronoComponent::getDayClasses
+	// For DateComponent::getDayClasses
 	isDateInOtherMonth: function(date) {
 		return false;
 	},

+ 9 - 9
src/common/View.js

@@ -2,7 +2,7 @@
 /* An abstract class from which other views inherit from
 ----------------------------------------------------------------------------------------------------------------------*/
 
-var View = FC.View = InteractiveChronoComponent.extend({
+var View = FC.View = InteractiveDateComponent.extend({
 
 	type: null, // subclass' view name (string)
 	name: null, // deprecated. use `type` instead
@@ -47,7 +47,7 @@ var View = FC.View = InteractiveChronoComponent.extend({
 		// .name is deprecated
 		this.name = this.type;
 
-		InteractiveChronoComponent.call(this);
+		InteractiveDateComponent.call(this);
 
 		this.initHiddenDays();
 		this.eventOrderSpecs = parseFieldSpecs(this.opt('eventOrder'));
@@ -171,7 +171,7 @@ var View = FC.View = InteractiveChronoComponent.extend({
 
 
 	setElement: function(el) {
-		InteractiveChronoComponent.prototype.setElement.apply(this, arguments);
+		InteractiveDateComponent.prototype.setElement.apply(this, arguments);
 
 		this.bindBaseRenderHandlers();
 	},
@@ -181,7 +181,7 @@ var View = FC.View = InteractiveChronoComponent.extend({
 		this.unsetDate();
 		this.unbindBaseRenderHandlers();
 
-		InteractiveChronoComponent.prototype.removeElement.apply(this, arguments);
+		InteractiveDateComponent.prototype.removeElement.apply(this, arguments);
 	},
 
 
@@ -389,7 +389,7 @@ var View = FC.View = InteractiveChronoComponent.extend({
 
 	// Binds DOM handlers to elements that reside outside the view container, such as the document
 	bindGlobalHandlers: function() {
-		InteractiveChronoComponent.prototype.bindGlobalHandlers.apply(this, arguments);
+		InteractiveDateComponent.prototype.bindGlobalHandlers.apply(this, arguments);
 
 		this.listenTo(GlobalEmitter.get(), {
 			touchstart: this.processUnselect,
@@ -400,7 +400,7 @@ var View = FC.View = InteractiveChronoComponent.extend({
 
 	// Unbinds DOM handlers from elements that reside outside the view container
 	unbindGlobalHandlers: function() {
-		InteractiveChronoComponent.prototype.unbindGlobalHandlers.apply(this, arguments);
+		InteractiveDateComponent.prototype.unbindGlobalHandlers.apply(this, arguments);
 
 		this.stopListeningTo(GlobalEmitter.get());
 	},
@@ -477,7 +477,7 @@ var View = FC.View = InteractiveChronoComponent.extend({
 
 	/* Dimensions
 	------------------------------------------------------------------------------------------------------------------*/
-	// TODO: move some of these to ChronoComponent
+	// TODO: move some of these to DateComponent
 
 
 	// Refreshes anything dependant upon sizing of the container element of the grid
@@ -701,7 +701,7 @@ var View = FC.View = InteractiveChronoComponent.extend({
 
 	// Event Rendering Utils
 	// -----------------------------------------------------------------------------------------------------------------
-	// TODO: move this to ChronoComponent
+	// TODO: move this to DateComponent
 
 
 	// Hides all rendered event segments linked to the given event
@@ -885,7 +885,7 @@ var View = FC.View = InteractiveChronoComponent.extend({
 			);
 		}
 		else {
-			InteractiveChronoComponent.prototype.renderSelectionFootprint.apply(this, arguments);
+			InteractiveDateComponent.prototype.renderSelectionFootprint.apply(this, arguments);
 		}
 	},
 

+ 2 - 2
src/component/ChronoComponent.js → src/component/DateComponent.js

@@ -1,5 +1,5 @@
 
-var ChronoComponent = Component.extend({
+var DateComponent = Component.extend({
 
 	children: null,
 	isRTL: false, // frequently accessed options
@@ -346,7 +346,7 @@ var ChronoComponent = Component.extend({
 
 	// Hit Areas
 	// ---------------------------------------------------------------------------------------------------------------
-	// just because all ChronoComponents support this interface
+	// just because all DateComponents support this interface
 	// doesn't mean they need to have their own internal coord system. they can defer to sub-components.
 
 

+ 2 - 2
src/component/ChronoComponent.util.js → src/component/DateComponent.util.js

@@ -1,5 +1,5 @@
 
-ChronoComponent.mixin({
+DateComponent.mixin({
 
 	// Generates HTML for an anchor to another view into the calendar.
 	// Will either generate an <a> tag or a non-clickable <span> tag, depending on enabled settings.
@@ -65,7 +65,7 @@ ChronoComponent.mixin({
 		else {
 			classes.push('fc-' + dayIDs[date.day()]);
 
-			if (view.isDateInOtherMonth(date)) { // TODO: use ChronoComponent subclass somehow
+			if (view.isDateInOtherMonth(date)) { // TODO: use DateComponent subclass somehow
 				classes.push('fc-other-month');
 			}
 

+ 2 - 2
src/component/InteractiveChronoComponent.js → src/component/InteractiveDateComponent.js

@@ -1,5 +1,5 @@
 
-var InteractiveChronoComponent = ChronoComponent.extend({
+var InteractiveDateComponent = DateComponent.extend({
 
 	dateClickingClass: null,
 	dateSelectingClass: null,
@@ -25,7 +25,7 @@ var InteractiveChronoComponent = ChronoComponent.extend({
 
 
 	constructor: function() {
-		ChronoComponent.call(this);
+		DateComponent.call(this);
 
 		if (this.dateSelectingClass) {
 			this.dateClicking = new this.dateClickingClass(this);