Skip to content

Commit

Permalink
Merge branch 'master' into 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ericf committed Nov 6, 2012
2 parents d70bb7d + 0404035 commit 4c8a5af
Show file tree
Hide file tree
Showing 11 changed files with 562 additions and 493 deletions.
676 changes: 342 additions & 334 deletions build/calendar-base/calendar-base-coverage.js

Large diffs are not rendered by default.

24 changes: 15 additions & 9 deletions build/calendar-base/calendar-base-debug.js
Expand Up @@ -367,6 +367,8 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* Selects a given date or array of dates.
* @method selectDates
* @param {Date|Array} dates A `Date` or `Array` of `Date`s.
* @return {CalendarBase} A reference to this object
* @chainable
*/
selectDates : function (dates) {
if (ydate.isValidDate(dates)) {
Expand All @@ -375,6 +377,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
else if (L.isArray(dates)) {
this._addDatesToSelection(dates);
}
return this;
},

/**
Expand All @@ -383,6 +386,8 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @method deselectDates
* @param {Date|Array} [dates] A `Date` or `Array` of `Date`s, or no
* argument if all dates should be deselected.
* @return {CalendarBase} A reference to this object
* @chainable
*/
deselectDates : function (dates) {
if (!dates) {
Expand All @@ -394,6 +399,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
else if (L.isArray(dates)) {
this._removeDatesFromSelection(dates);
}
return this;
},

/**
Expand Down Expand Up @@ -620,7 +626,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @method _renderSelectedDates
* @private
*/
_renderSelectedDates : function () {
_renderSelectedDates : function () {
this.get("contentBox").all("." + CAL_DAY_SELECTED).removeClass(CAL_DAY_SELECTED).setAttribute("aria-selected", false);

for (var paneNum = 0; paneNum < this._paneNumber; paneNum++) {
Expand All @@ -642,7 +648,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @return {Node} The node wrapping the DOM element of the cell the date
* corresponds to.
*/
_dateToNode : function (oDate) {
_dateToNode : function (oDate) {
var day = oDate.getDate(),
col = 0,
daymod = day%7,
Expand Down Expand Up @@ -715,7 +721,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @protected
* @return {Date} The date corresponding to the DOM element that the given node wraps.
*/
_nodeToDate : function (oNode) {
_nodeToDate : function (oNode) {

var idParts = oNode.get("id").split("_").reverse(),
paneNum = parseInt(idParts[2], 10),
Expand All @@ -733,7 +739,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @method _bindCalendarEvents
* @protected
*/
_bindCalendarEvents : function () {
_bindCalendarEvents : function () {

},

Expand Down Expand Up @@ -948,7 +954,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @method _afterHeaderRendererChange
* @private
*/
_afterHeaderRendererChange : function () {
_afterHeaderRendererChange : function () {
var headerCell = this.get("contentBox").one("." + CAL_HD_LABEL);
headerCell.setContent(this._updateCalendarHeader(this.get('date')));
},
Expand All @@ -970,7 +976,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @method _afterDateChange
* @private
*/
_afterDateChange : function () {
_afterDateChange : function () {

var contentBox = this.get('contentBox'),
headerCell = contentBox.one("." + CAL_HD).one("." + CAL_HD_LABEL),
Expand Down Expand Up @@ -1008,7 +1014,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* element ids in the given pane.
* @private
*/
_initCalendarPane : function (baseDate, pane_id) {
_initCalendarPane : function (baseDate, pane_id) {
// Initialize final output HTML string
var calString = '',
// Get a list of short weekdays from the internationalization package, or else use default English ones.
Expand Down Expand Up @@ -1115,7 +1121,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @param {Node} pane The node corresponding to the calendar pane to be rerenders.
* @private
*/
_rerenderCalendarPane : function (newDate, pane) {
_rerenderCalendarPane : function (newDate, pane) {

// Get the first day of the week from the internationalization package, or else use Sunday as default.
var firstday = this.get('strings.first_weekday') || 0,
Expand Down Expand Up @@ -1252,7 +1258,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @param {Date} baseDate The date with which to initialize the calendar.
* @private
*/
_initCalendarHTML : function (baseDate) {
_initCalendarHTML : function (baseDate) {
// Instantiate the partials holder
var partials = {},
// Counter for iterative template replacement.
Expand Down
2 changes: 1 addition & 1 deletion build/calendar-base/calendar-base-min.js

Large diffs are not rendered by default.

24 changes: 15 additions & 9 deletions build/calendar-base/calendar-base.js
Expand Up @@ -367,6 +367,8 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* Selects a given date or array of dates.
* @method selectDates
* @param {Date|Array} dates A `Date` or `Array` of `Date`s.
* @return {CalendarBase} A reference to this object
* @chainable
*/
selectDates : function (dates) {
if (ydate.isValidDate(dates)) {
Expand All @@ -375,6 +377,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
else if (L.isArray(dates)) {
this._addDatesToSelection(dates);
}
return this;
},

/**
Expand All @@ -383,6 +386,8 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @method deselectDates
* @param {Date|Array} [dates] A `Date` or `Array` of `Date`s, or no
* argument if all dates should be deselected.
* @return {CalendarBase} A reference to this object
* @chainable
*/
deselectDates : function (dates) {
if (!dates) {
Expand All @@ -394,6 +399,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
else if (L.isArray(dates)) {
this._removeDatesFromSelection(dates);
}
return this;
},

/**
Expand Down Expand Up @@ -620,7 +626,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @method _renderSelectedDates
* @private
*/
_renderSelectedDates : function () {
_renderSelectedDates : function () {
this.get("contentBox").all("." + CAL_DAY_SELECTED).removeClass(CAL_DAY_SELECTED).setAttribute("aria-selected", false);

for (var paneNum = 0; paneNum < this._paneNumber; paneNum++) {
Expand All @@ -642,7 +648,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @return {Node} The node wrapping the DOM element of the cell the date
* corresponds to.
*/
_dateToNode : function (oDate) {
_dateToNode : function (oDate) {
var day = oDate.getDate(),
col = 0,
daymod = day%7,
Expand Down Expand Up @@ -715,7 +721,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @protected
* @return {Date} The date corresponding to the DOM element that the given node wraps.
*/
_nodeToDate : function (oNode) {
_nodeToDate : function (oNode) {

var idParts = oNode.get("id").split("_").reverse(),
paneNum = parseInt(idParts[2], 10),
Expand All @@ -733,7 +739,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @method _bindCalendarEvents
* @protected
*/
_bindCalendarEvents : function () {
_bindCalendarEvents : function () {

},

Expand Down Expand Up @@ -948,7 +954,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @method _afterHeaderRendererChange
* @private
*/
_afterHeaderRendererChange : function () {
_afterHeaderRendererChange : function () {
var headerCell = this.get("contentBox").one("." + CAL_HD_LABEL);
headerCell.setContent(this._updateCalendarHeader(this.get('date')));
},
Expand All @@ -970,7 +976,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @method _afterDateChange
* @private
*/
_afterDateChange : function () {
_afterDateChange : function () {

var contentBox = this.get('contentBox'),
headerCell = contentBox.one("." + CAL_HD).one("." + CAL_HD_LABEL),
Expand Down Expand Up @@ -1008,7 +1014,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* element ids in the given pane.
* @private
*/
_initCalendarPane : function (baseDate, pane_id) {
_initCalendarPane : function (baseDate, pane_id) {
// Initialize final output HTML string
var calString = '',
// Get a list of short weekdays from the internationalization package, or else use default English ones.
Expand Down Expand Up @@ -1115,7 +1121,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @param {Node} pane The node corresponding to the calendar pane to be rerenders.
* @private
*/
_rerenderCalendarPane : function (newDate, pane) {
_rerenderCalendarPane : function (newDate, pane) {

// Get the first day of the week from the internationalization package, or else use Sunday as default.
var firstday = this.get('strings.first_weekday') || 0,
Expand Down Expand Up @@ -1252,7 +1258,7 @@ Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {
* @param {Date} baseDate The date with which to initialize the calendar.
* @private
*/
_initCalendarHTML : function (baseDate) {
_initCalendarHTML : function (baseDate) {
// Instantiate the partials holder
var partials = {},
// Counter for iterative template replacement.
Expand Down
106 changes: 61 additions & 45 deletions build/calendar/calendar-coverage.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions build/calendar/calendar-debug.js
Expand Up @@ -371,45 +371,57 @@ Y.Calendar = Y.extend(Calendar, Y.CalendarBase, {
/**
* Subtracts one month from the current calendar view.
* @method subtractMonth
* @return {Calendar} A reference to this object
* @chainable
*/
subtractMonth : function (e) {
this.set("date", ydate.addMonths(this.get("date"), -1));
if (e) {
e.halt();
}
return this;
},

/**
* Subtracts one year from the current calendar view.
* @method subtractYear
* @return {Calendar} A reference to this object
* @chainable
*/
subtractYear : function (e) {
this.set("date", ydate.addYears(this.get("date"), -1));
if (e) {
e.halt();
}
return this;
},

/**
* Adds one month to the current calendar view.
* @method addMonth
* @return {Calendar} A reference to this object
* @chainable
*/
addMonth : function (e) {
this.set("date", ydate.addMonths(this.get("date"), 1));
if (e) {
e.halt();
}
return this;
},

/**
* Adds one year to the current calendar view.
* @method addYear
* @return {Calendar} A reference to this object
* @chainable
*/
addYear : function (e) {
this.set("date", ydate.addYears(this.get("date"), 1));
if (e) {
e.halt();
}
return this;
}
},

Expand Down

0 comments on commit 4c8a5af

Please sign in to comment.