Browse Source

rename the namespace variable to 'FC'

Adam Shaw 10 years ago
parent
commit
9c787c2fb1

+ 6 - 6
src/Calendar.js

@@ -1,5 +1,5 @@
 
-var Calendar = fc.Calendar = Class.extend({
+var Calendar = FC.Calendar = Class.extend({
 
 	dirDefaults: null, // option defaults related to LTR or RTL
 	langDefaults: null, // option defaults related to current locale
@@ -78,7 +78,7 @@ var Calendar = fc.Calendar = Class.extend({
 
 			// put views that have buttons first. there will be duplicates, but oh well
 			viewTypes = this.header.getViewsWithButtons();
-			$.each(fc.views, function(viewType) { // all views
+			$.each(FC.views, function(viewType) { // all views
 				viewTypes.push(viewType);
 			});
 
@@ -347,18 +347,18 @@ function Calendar_constructor(element, overrides) {
 		var mom;
 
 		if (options.timezone === 'local') {
-			mom = fc.moment.apply(null, arguments);
+			mom = FC.moment.apply(null, arguments);
 
-			// Force the moment to be local, because fc.moment doesn't guarantee it.
+			// Force the moment to be local, because FC.moment doesn't guarantee it.
 			if (mom.hasTime()) { // don't give ambiguously-timed moments a local zone
 				mom.local();
 			}
 		}
 		else if (options.timezone === 'UTC') {
-			mom = fc.moment.utc.apply(null, arguments); // process as UTC
+			mom = FC.moment.utc.apply(null, arguments); // process as UTC
 		}
 		else {
-			mom = fc.moment.parseZone.apply(null, arguments); // let the input decide the zone
+			mom = FC.moment.parseZone.apply(null, arguments); // let the input decide the zone
 		}
 
 		if ('_locale' in mom) { // moment 2.8 and above

+ 4 - 4
src/EventManager.js

@@ -1,6 +1,6 @@
 
-fc.sourceNormalizers = [];
-fc.sourceFetchers = [];
+FC.sourceNormalizers = [];
+FC.sourceFetchers = [];
 
 var ajaxDefaults = {
 	dataType: 'json',
@@ -118,7 +118,7 @@ function EventManager(options) { // assumed to be a calendar
 	
 	function _fetchEventSource(source, callback) {
 		var i;
-		var fetchers = fc.sourceFetchers;
+		var fetchers = FC.sourceFetchers;
 		var res;
 
 		for (i=0; i<fetchers.length; i++) {
@@ -242,7 +242,7 @@ function EventManager(options) { // assumed to be a calendar
 
 
 	function buildEventSource(sourceInput) { // will return undefined if invalid source
-		var normalizers = fc.sourceNormalizers;
+		var normalizers = FC.sourceNormalizers;
 		var source;
 		var i;
 

+ 1 - 1
src/agenda/AgendaView.js

@@ -4,7 +4,7 @@
 // Is a manager for the TimeGrid subcomponent and possibly the DayGrid subcomponent (if allDaySlot is on).
 // Responsible for managing width/height.
 
-var AgendaView = fc.AgendaView = View.extend({
+var AgendaView = FC.AgendaView = View.extend({
 
 	timeGridClass: TimeGrid, // class used to instantiate the timeGrid. subclasses can override
 	timeGrid: null, // the main time-grid subcomponent of this view

+ 1 - 1
src/basic/BasicView.js

@@ -4,7 +4,7 @@
 // It is a manager for a DayGrid subcomponent, which does most of the heavy lifting.
 // It is responsible for managing width/height.
 
-var BasicView = fc.BasicView = View.extend({
+var BasicView = FC.BasicView = View.extend({
 
 	dayGridClass: DayGrid, // class the dayGrid will be instantiated from (overridable by subclasses)
 	dayGrid: null, // the main subcomponent that does most of the heavy lifting

+ 1 - 1
src/basic/MonthView.js

@@ -2,7 +2,7 @@
 /* A month view with day cells running in rows (one-per-week) and columns
 ----------------------------------------------------------------------------------------------------------------------*/
 
-var MonthView = fc.MonthView = BasicView.extend({
+var MonthView = FC.MonthView = BasicView.extend({
 
 	// Produces information about what range to display
 	computeRange: function(date) {

+ 1 - 1
src/common/Class.js

@@ -1,5 +1,5 @@
 
-fc.Class = Class; // export
+FC.Class = Class; // export
 
 // class that all other classes will inherit from
 function Class() { }

+ 1 - 1
src/common/CoordCache.js

@@ -8,7 +8,7 @@ options:
 - isHorizontal
 - isVertical
 */
-var CoordCache = fc.CoordCache = Class.extend({
+var CoordCache = FC.CoordCache = Class.extend({
 
 	els: null, // jQuery set (assumed to be siblings)
 	origin: null, // {left,top} position of offsetParent of els

+ 1 - 1
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 = Grid.extend($.extend({}, DayTableMixin, {
+var DayGrid = FC.DayGrid = Grid.extend($.extend({}, DayTableMixin, {
 
 	numbersVisible: false, // should render a row for day/week numbers? set by outside view. TODO: make internal
 	bottomCoordPadding: 0, // hack for extending the hit area for the last row of the coordinate grid

+ 1 - 1
src/common/DayTableMixin.js

@@ -3,7 +3,7 @@
 A set of rendering and date-related methods for a visual component comprised of one or more rows of day columns.
 Prerequisite: the object being mixed into needs to be a *Grid*
 */
-var DayTableMixin = fc.DayTableMixin = {
+var DayTableMixin = FC.DayTableMixin = {
 
 	breakOnWeeks: false, // should create a new row for each week?
 	dayDates: null, // whole-day dates for each column. left to right

+ 1 - 1
src/common/DragListener.js

@@ -3,7 +3,7 @@
 ----------------------------------------------------------------------------------------------------------------------*/
 // TODO: use Emitter
 
-var DragListener = fc.DragListener = Class.extend({
+var DragListener = FC.DragListener = Class.extend({
 
 	options: null,
 

+ 1 - 1
src/common/Emitter.js

@@ -1,5 +1,5 @@
 
-var Emitter = fc.Emitter = Class.extend({
+var Emitter = FC.Emitter = Class.extend({
 
 	callbackHash: null,
 

+ 2 - 2
src/common/Grid.events.js

@@ -975,13 +975,13 @@ function compareNormalRanges(range1, range2) {
 
 // Require all HTML5 data-* attributes used by FullCalendar to have this prefix.
 // A value of '' will query attributes like data-event. A value of 'fc' will query attributes like data-fc-event.
-fc.dataAttrPrefix = '';
+FC.dataAttrPrefix = '';
 
 // Given a jQuery element that might represent a dragged FullCalendar event, returns an intermediate data structure
 // to be used for Event Object creation.
 // A defined `.eventProps`, even when empty, indicates that an event should be created.
 function getDraggedElMeta(el) {
-	var prefix = fc.dataAttrPrefix;
+	var prefix = FC.dataAttrPrefix;
 	var eventProps; // properties for creating the event, not related to date/time
 	var startTime; // a Duration
 	var duration;

+ 1 - 1
src/common/Grid.js

@@ -2,7 +2,7 @@
 /* An abstract class comprised of a "grid" of areas that each represent a specific datetime
 ----------------------------------------------------------------------------------------------------------------------*/
 
-var Grid = fc.Grid = Class.extend({
+var Grid = FC.Grid = Class.extend({
 
 	view: null, // a View object
 	isRTL: null, // shortcut to the view's isRTL option

+ 1 - 1
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 = Grid.extend($.extend({}, DayTableMixin, {
+var TimeGrid = FC.TimeGrid = Grid.extend($.extend({}, DayTableMixin, {
 
 	slotDuration: null, // duration of a "slot", a distinct time segment on given day, visualized by lines
 	snapDuration: null, // granularity of time for dragging and selecting

+ 1 - 1
src/common/View.js

@@ -2,7 +2,7 @@
 /* An abstract class from which other views inherit from
 ----------------------------------------------------------------------------------------------------------------------*/
 
-var View = fc.View = Class.extend({
+var View = FC.View = Class.extend({
 
 	type: null, // subclass' view name (string)
 	name: null, // deprecated. use `type` instead

+ 3 - 3
src/date-formatting.js

@@ -74,8 +74,8 @@ function formatDateWithChunk(date, chunk) {
 function formatRange(date1, date2, formatStr, separator, isRTL) {
 	var localeData;
 
-	date1 = fc.moment.parseZone(date1);
-	date2 = fc.moment.parseZone(date2);
+	date1 = FC.moment.parseZone(date1);
+	date2 = FC.moment.parseZone(date2);
 
 	localeData = (date1.localeData || date1.lang).call(date1); // works with moment-pre-2.8
 
@@ -94,7 +94,7 @@ function formatRange(date1, date2, formatStr, separator, isRTL) {
 		isRTL
 	);
 }
-fc.formatRange = formatRange; // expose
+FC.formatRange = formatRange; // expose
 
 
 function formatRangeWithChunks(date1, date2, chunks, separator, isRTL) {

+ 5 - 5
src/gcal/gcal.js

@@ -18,11 +18,11 @@
 
 
 var API_BASE = 'https://www.googleapis.com/calendar/v3/calendars';
-var fc = $.fullCalendar;
-var applyAll = fc.applyAll;
+var FC = $.fullCalendar;
+var applyAll = FC.applyAll;
 
 
-fc.sourceNormalizers.push(function(sourceOptions) {
+FC.sourceNormalizers.push(function(sourceOptions) {
 	var googleCalendarId = sourceOptions.googleCalendarId;
 	var url = sourceOptions.url;
 	var match;
@@ -64,7 +64,7 @@ fc.sourceNormalizers.push(function(sourceOptions) {
 });
 
 
-fc.sourceFetchers.push(function(sourceOptions, start, end, timezone) {
+FC.sourceFetchers.push(function(sourceOptions, start, end, timezone) {
 	if (sourceOptions.googleCalendarId) {
 		return transformOptions(sourceOptions, start, end, timezone, this); // `this` is the calendar
 	}
@@ -86,7 +86,7 @@ function transformOptions(sourceOptions, start, end, timezone, calendar) {
 		(calendar.options.googleCalendarError || $.noop).apply(calendar, errorObjs);
 
 		// print error to debug console
-		fc.warn.apply(null, [ message ].concat(apiErrorObjs || []));
+		FC.warn.apply(null, [ message ].concat(apiErrorObjs || []));
 	}
 
 	if (!apiKey) {

+ 4 - 4
src/lang.js

@@ -1,5 +1,5 @@
 
-var langOptionHash = fc.langs = {}; // initialize and expose
+var langOptionHash = FC.langs = {}; // initialize and expose
 
 
 // TODO: document the structure and ordering of a FullCalendar lang file
@@ -8,7 +8,7 @@ var langOptionHash = fc.langs = {}; // initialize and expose
 
 // Initialize jQuery UI datepicker translations while using some of the translations
 // Will set this as the default language for datepicker.
-fc.datepickerLang = function(langCode, dpLangCode, dpOptions) {
+FC.datepickerLang = function(langCode, dpLangCode, dpOptions) {
 
 	// get the FullCalendar internal option hash for this language. create if necessary
 	var fcOptions = langOptionHash[langCode] || (langOptionHash[langCode] = {});
@@ -43,7 +43,7 @@ fc.datepickerLang = function(langCode, dpLangCode, dpOptions) {
 
 
 // Sets FullCalendar-specific translations. Will set the language as the global default.
-fc.lang = function(langCode, newFcOptions) {
+FC.lang = function(langCode, newFcOptions) {
 	var fcOptions;
 	var momOptions;
 
@@ -197,4 +197,4 @@ function getMomentLocaleData(langCode) {
 
 // Initialize English by forcing computation of moment-derived options.
 // Also, sets it as the default.
-fc.lang('en', Calendar.englishDefaults);
+FC.lang('en', Calendar.englishDefaults);

+ 2 - 2
src/main.js

@@ -1,6 +1,6 @@
 
-var fc = $.fullCalendar = { version: "<%= meta.version %>" };
-var fcViews = fc.views = {};
+var FC = $.fullCalendar = { version: "<%= meta.version %>" };
+var fcViews = FC.views = {};
 
 
 $.fn.fullCalendar = function(options) {

+ 7 - 7
src/moment-ext.js

@@ -16,12 +16,12 @@ var setLocalValues; // function defined below
 // extra features (ambiguous time, enhanced formatting). When given an existing moment,
 // it will function as a clone (and retain the zone of the moment). Anything else will
 // result in a moment in the local zone.
-fc.moment = function() {
+FC.moment = function() {
 	return makeMoment(arguments);
 };
 
-// Sames as fc.moment, but forces the resulting moment to be in the UTC timezone.
-fc.moment.utc = function() {
+// Sames as FC.moment, but forces the resulting moment to be in the UTC timezone.
+FC.moment.utc = function() {
 	var mom = makeMoment(arguments, true);
 
 	// Force it into UTC because makeMoment doesn't guarantee it
@@ -33,9 +33,9 @@ fc.moment.utc = function() {
 	return mom;
 };
 
-// Same as fc.moment, but when given an ISO8601 string, the timezone offset is preserved.
+// Same as FC.moment, but when given an ISO8601 string, the timezone offset is preserved.
 // ISO8601 strings with no timezone offset will become ambiguously zoned.
-fc.moment.parseZone = function() {
+FC.moment.parseZone = function() {
 	return makeMoment(arguments, true, true);
 };
 
@@ -378,7 +378,7 @@ newMomentProto.isSame = function(input, units) {
 		return oldMomentProto.isSame.call(a[0], a[1], units);
 	}
 	else {
-		input = fc.moment.parseZone(input); // normalize input
+		input = FC.moment.parseZone(input); // normalize input
 		return oldMomentProto.isSame.call(this, input) &&
 			Boolean(this._ambigTime) === Boolean(input._ambigTime) &&
 			Boolean(this._ambigZone) === Boolean(input._ambigZone);
@@ -422,7 +422,7 @@ function commonlyAmbiguate(inputs, preserveTime) {
 	for (i = 0; i < len; i++) {
 		mom = inputs[i];
 		if (!moment.isMoment(mom)) {
-			mom = fc.moment.parseZone(mom);
+			mom = FC.moment.parseZone(mom);
 		}
 		anyAmbigTime = anyAmbigTime || mom._ambigTime;
 		anyAmbigZone = anyAmbigZone || mom._ambigZone;

+ 1 - 1
src/outro.js

@@ -1,3 +1,3 @@
 
-return fc; // export for Node/CommonJS
+return FC; // export for Node/CommonJS
 });

+ 25 - 25
src/util.js

@@ -1,13 +1,13 @@
 
 // exports
-fc.intersectionToSeg = intersectionToSeg;
-fc.applyAll = applyAll;
-fc.debounce = debounce;
-fc.isInt = isInt;
-fc.htmlEscape = htmlEscape;
-fc.cssToStr = cssToStr;
-fc.proxy = proxy;
-fc.capitaliseFirstLetter = capitaliseFirstLetter;
+FC.intersectionToSeg = intersectionToSeg;
+FC.applyAll = applyAll;
+FC.debounce = debounce;
+FC.isInt = isInt;
+FC.htmlEscape = htmlEscape;
+FC.cssToStr = cssToStr;
+FC.proxy = proxy;
+FC.capitaliseFirstLetter = capitaliseFirstLetter;
 
 
 /* FullCalendar-specific DOM Utilities
@@ -163,10 +163,10 @@ function unsetScroller(containerEl) {
 /* General DOM Utilities
 ----------------------------------------------------------------------------------------------------------------------*/
 
-fc.getOuterRect = getOuterRect;
-fc.getClientRect = getClientRect;
-fc.getContentRect = getContentRect;
-fc.getScrollbarWidths = getScrollbarWidths;
+FC.getOuterRect = getOuterRect;
+FC.getClientRect = getClientRect;
+FC.getContentRect = getContentRect;
+FC.getScrollbarWidths = getScrollbarWidths;
 
 
 // borrowed from https://github.com/jquery/jquery-ui/blob/1.11.0/ui/core.js#L51
@@ -299,7 +299,7 @@ function isPrimaryMouseButton(ev) {
 /* Geometry
 ----------------------------------------------------------------------------------------------------------------------*/
 
-fc.intersectRects = intersectRects;
+FC.intersectRects = intersectRects;
 
 // Returns a new rectangle that is the intersection of the two rectangles. If they don't intersect, returns false
 function intersectRects(rect1, rect2) {
@@ -347,10 +347,10 @@ function diffPoints(point1, point2) {
 /* Object Ordering by Field
 ----------------------------------------------------------------------------------------------------------------------*/
 
-fc.parseFieldSpecs = parseFieldSpecs;
-fc.compareByFieldSpecs = compareByFieldSpecs;
-fc.compareByFieldSpec = compareByFieldSpec;
-fc.flexibleCompare = flexibleCompare;
+FC.parseFieldSpecs = parseFieldSpecs;
+FC.compareByFieldSpecs = compareByFieldSpecs;
+FC.compareByFieldSpec = compareByFieldSpec;
+FC.flexibleCompare = flexibleCompare;
 
 
 function parseFieldSpecs(input) {
@@ -476,11 +476,11 @@ function intersectionToSeg(subjectRange, constraintRange) {
 /* Date Utilities
 ----------------------------------------------------------------------------------------------------------------------*/
 
-fc.computeIntervalUnit = computeIntervalUnit;
-fc.divideRangeByDuration = divideRangeByDuration;
-fc.divideDurationByDuration = divideDurationByDuration;
-fc.multiplyDuration = multiplyDuration;
-fc.durationHasTime = durationHasTime;
+FC.computeIntervalUnit = computeIntervalUnit;
+FC.divideRangeByDuration = divideRangeByDuration;
+FC.divideDurationByDuration = divideDurationByDuration;
+FC.multiplyDuration = multiplyDuration;
+FC.durationHasTime = durationHasTime;
 
 var dayIDs = [ 'sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat' ];
 var intervalUnits = [ 'year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond' ];
@@ -620,7 +620,7 @@ function isTimeString(str) {
 /* Logging and Debug
 ----------------------------------------------------------------------------------------------------------------------*/
 
-fc.log = function() {
+FC.log = function() {
 	var console = window.console;
 
 	if (console && console.log) {
@@ -628,14 +628,14 @@ fc.log = function() {
 	}
 };
 
-fc.warn = function() {
+FC.warn = function() {
 	var console = window.console;
 
 	if (console && console.warn) {
 		return console.warn.apply(console, arguments);
 	}
 	else {
-		return fc.log.apply(fc, arguments);
+		return FC.log.apply(FC, arguments);
 	}
 };