Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #26037 from millermedeiros/1095738-rename-months-day
Browse files Browse the repository at this point in the history
Bug 1095738 - [Calendar] rename the MonthsDay view r=gaye
  • Loading branch information
millermedeiros committed Nov 12, 2014
2 parents 9518153 + 46c20dc commit d81db9c
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion apps/calendar/build/calendar.build.js
Expand Up @@ -88,7 +88,7 @@
exclude: ['main']
},
{
name: 'views/months_day',
name: 'views/month_day_agenda',
exclude: ['main']
},
{
Expand Down
2 changes: 1 addition & 1 deletion apps/calendar/index.html
Expand Up @@ -83,7 +83,7 @@ <h1 id="current-month-year"></h1>
When a day is selected you have
access to the details here
-->
<section id="months-day-view" role="tabpanel">
<section id="month-day-agenda" role="tabpanel">
<div id="event-list-date"></div>
<div id="empty-message" data-l10n-id="no-events" class="active">No Events</div>
<section id="event-list" class="day-events" role="listbox" aria-labelledby="event-list-date">
Expand Down
2 changes: 1 addition & 1 deletion apps/calendar/js/app.js
Expand Up @@ -178,7 +178,7 @@ module.exports = {
/* routes */
this.state('/week/', 'Week');
this.state('/day/', 'Day');
this.state('/month/', ['Month', 'MonthsDay']);
this.state('/month/', ['Month', 'MonthDayAgenda']);
this.modifier('/settings/', 'Settings', { clear: false });
this.modifier('/advanced-settings/', 'AdvancedSettings');

Expand Down
10 changes: 5 additions & 5 deletions apps/calendar/js/performance.js
Expand Up @@ -8,7 +8,7 @@ require('shared/performance_testing_helper');
// race conditions and the app contains way too many async operations during
// startup and no simple way to listen to these events.

exports._isMonthsDayInteractive = false;
exports._isMonthAgendaInteractive = false;
exports._isMonthReady = false;
exports._isVisuallyActive = false;
exports._isPendingReady = false;
Expand Down Expand Up @@ -44,11 +44,11 @@ exports.chromeInteractive = function() {
* rendered all the busytimes for that day.
*/
exports.monthsDayReady = function() {
if (exports._isMonthsDayInteractive) {
if (exports._isMonthAgendaInteractive) {
return;
}

exports._isMonthsDayInteractive = true;
exports._isMonthAgendaInteractive = true;
dispatchVisuallyCompleteAndInteractive();
};

Expand All @@ -72,7 +72,7 @@ exports.monthReady = function() {
*/
function dispatchVisuallyCompleteAndInteractive() {
if (exports._isVisuallyActive ||
!exports._isMonthsDayInteractive ||
!exports._isMonthAgendaInteractive ||
!exports._isMonthReady) {
return;
}
Expand Down Expand Up @@ -107,7 +107,7 @@ exports.pendingReady = function() {
};

/**
* App is only considered "loaded" after the MonthView and MonthsDayView
* App is only considered "loaded" after the MonthView and MonthDayAgenda
* are "ready" and the first pending operations batch is completed (loading
* events from DB and recurring events expansion).
*/
Expand Down
Expand Up @@ -4,7 +4,7 @@ define(function(require, exports, module) {
var DateSpan = require('./date_span');
var create = require('template').create;

var MonthsDay = create({
var MonthDayAgenda = create({
event: function() {
var calendarId = this.h('calendarId');
var busytimeId = this.h('busytimeId');
Expand Down Expand Up @@ -48,7 +48,7 @@ var MonthsDay = create({
</a>`;
}
});
module.exports = MonthsDay;
module.exports = MonthDayAgenda;

function formatTime(time) {
return DateSpan.time.render({
Expand Down
Expand Up @@ -7,22 +7,22 @@ var dateFormat = require('date_format');
var dayObserver = require('day_observer');
var isAllDay = require('calc').isAllDay;
var performance = require('performance');
var template = require('templates/months_day');
var template = require('templates/month_day_agenda');

function MonthsDay() {
function MonthDayAgenda() {
Parent.apply(this, arguments);
this._render = this._render.bind(this);
this.controller = this.app.timeController;
}
module.exports = MonthsDay;
module.exports = MonthDayAgenda;

MonthsDay.prototype = {
MonthDayAgenda.prototype = {
__proto__: Parent.prototype,

date: null,

selectors: {
element: '#months-day-view',
element: '#month-day-agenda',
events: '.day-events',
currentDate: '#event-list-date',
emptyMessage: '#empty-message'
Expand Down
48 changes: 24 additions & 24 deletions apps/calendar/style/month.css
Expand Up @@ -6,7 +6,7 @@
height: auto;
}

#time-views #months-day-view {
#time-views #month-day-agenda {
background-color: #F8F8F8;
flex: 1;
}
Expand Down Expand Up @@ -147,10 +147,10 @@ section.month .icon-calendar-dot:before {
margin-left: calc(50% - 1.8rem);
}

/* months-day-view
/* month-day-agenda
* =============== */

#months-day-view {
#month-day-agenda {
margin-bottom: 4.5rem;
overflow-x: hidden;
overflow-y: auto;
Expand Down Expand Up @@ -184,43 +184,43 @@ section.month .icon-calendar-dot:before {
width: 100%;
}

#months-day-view .event {
#month-day-agenda .event {
display: block;
height: 6rem;
margin: 0;
position: relative;
padding: 0 1.5rem;
}

#months-day-view .event:active,
#months-day-view .event:focus {
#month-day-agenda .event:active,
#month-day-agenda .event:focus {
outline: none;
}

#months-day-view .container {
#month-day-agenda .container {
height: 100%;
padding: 0 1.5rem;
border-bottom: 0.1rem solid #E5E5E5;
}

/* The last month day event doesn't need a bottom border. */
#months-day-view .event:last-child > .container {
#month-day-agenda .event:last-child > .container {
border-bottom: none;
}

#months-day-view .container.has-alarm {
#month-day-agenda .container.has-alarm {
padding-right: 3rem;
}

#months-day-view .icon-calendar-alarm {
#month-day-agenda .icon-calendar-alarm {
position: absolute;
top: 0.2rem;
right: 0;
width: 3rem;
height: 3rem;
}

#months-day-view .event-title {
#month-day-agenda .event-title {
min-height: 1.5rem;
font-size: 1.4rem;
font-weight: 500;
Expand All @@ -231,7 +231,7 @@ section.month .icon-calendar-dot:before {
color: #333;
}

#months-day-view .event-location {
#month-day-agenda .event-location {
display: block;
top: 2.8rem;
min-height: 2.1rem;
Expand All @@ -244,19 +244,19 @@ section.month .icon-calendar-dot:before {
font-weight: 400;
}

#months-day-view .icon-calendar-dot {
#month-day-agenda .icon-calendar-dot {
position: absolute;
height: 3rem;
left: -1.4rem;
top: 50%;
margin-top: -3rem;
}

#months-day-view .icon-calendar-dot:before {
#month-day-agenda .icon-calendar-dot:before {
font-size: 6rem;
}

#months-day-view .event-time {
#month-day-agenda .event-time {
color: #657073;
display: flex;
flex-direction: column;
Expand All @@ -266,19 +266,19 @@ section.month .icon-calendar-dot:before {
justify-content: center;
}

#months-day-view .event-time .all-day {
#month-day-agenda .event-time .all-day {
white-space: normal;
line-height: 1.4;
width: 7rem;
}

#months-day-view .start-time,
#months-day-view .end-time {
#month-day-agenda .start-time,
#month-day-agenda .end-time {
height: 2.5rem;
line-height: 2.5rem;
}

#months-day-view .event-details {
#month-day-agenda .event-details {
align-items: center;
display: flex;
flex-direction: column;
Expand All @@ -290,7 +290,7 @@ section.month .icon-calendar-dot:before {
width: 17rem;
}

#months-day-view .event-details > h5 {
#month-day-agenda .event-details > h5 {
color: #252525;
font-size: 1.9rem;
font-weight: normal;
Expand All @@ -302,27 +302,27 @@ section.month .icon-calendar-dot:before {
width: 100%;
}

#months-day-view .details {
#month-day-agenda .details {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}

#months-day-view .location {
#month-day-agenda .location {
color: #A2A2A2;
font-size: 1.4rem;
height: 2.5rem;
line-height: 2.5rem;
width: 100%;
}

#months-day-view .icon-calendar-alarm {
#month-day-agenda .icon-calendar-alarm {
display: none;
}

#months-day-view .has-alarms .icon-calendar-alarm {
#month-day-agenda .has-alarms .icon-calendar-alarm {
display: block;
height: 6rem;
line-height: 6rem;
Expand Down
4 changes: 2 additions & 2 deletions apps/calendar/test/marionette/lib/views/month_day.js
Expand Up @@ -11,7 +11,7 @@ module.exports = MonthDay;
MonthDay.prototype = {
__proto__: View.prototype,

selector: '#months-day-view',
selector: '#month-day-agenda',

get container() {
return this.findElement('#event-list');
Expand Down Expand Up @@ -40,7 +40,7 @@ MonthDay.prototype = {
}

event.scriptWith(function(element) {
var container = document.getElementById('months-day-view');
var container = document.getElementById('month-day-agenda');
container.scrollTop = element.offsetTop;
});
}
Expand Down
2 changes: 1 addition & 1 deletion apps/calendar/test/marionette/month_view_test.js
Expand Up @@ -25,7 +25,7 @@ marionette('month view', function() {
app.launch();
});

test('#months-day-view scroll', function() {
test('#month-day-agenda scroll', function() {
// Create a lot of events so we can scroll so fun!
for (var i = 0; i < 5; i++) {
app.createEvent({
Expand Down
@@ -1,11 +1,11 @@
define(function(require) {
'use strict';

var MonthsDay = require('templates/months_day');
var MonthDayAgenda = require('templates/month_day_agenda');

suite('templates/months_day', function() {
suite('templates/month_day_agenda', function() {
function renderHTML(type, options) {
return MonthsDay[type].render(options);
return MonthDayAgenda[type].render(options);
}

suite('#event', function() {
Expand Down
@@ -1,12 +1,12 @@
define(function(require) {
'use strict';

var MonthsDay = require('views/months_day');
var MonthDayAgenda = require('views/month_day_agenda');
var dateFormat = require('date_format');
var dayObserver = require('day_observer');
var template = require('templates/months_day');
var template = require('templates/month_day_agenda');

suite('Views.MonthsDay', function() {
suite('Views.MonthDayAgenda', function() {
var subject,
app;

Expand All @@ -21,15 +21,15 @@ suite('Views.MonthsDay', function() {
var div = document.createElement('div');
div.id = 'test';
div.innerHTML = [
'<div id="months-day-view">',
'<div id="month-day-agenda">',
'<div class="day-events"></div>',
'</div>'
].join(' ');

document.body.appendChild(div);

app = testSupport.calendar.app();
subject = new MonthsDay({ app: app });
subject = new MonthDayAgenda({ app: app });
app.db.open(done);
});

Expand Down
6 changes: 3 additions & 3 deletions tests/python/gaia-ui-tests/gaiatest/apps/calendar/app.py
Expand Up @@ -17,7 +17,7 @@ class Calendar(Base):
name = 'Calendar'

_current_month_year_locator = (By.ID, 'current-month-year')
_current_months_day_locator = (By.ID, 'months-day-view')
_current_month_day_agenda_locator = (By.ID, 'month-day-agenda')
_current_monthly_calendar_locator = (By.ID, 'month-view')
_add_event_button_locator = (By.XPATH, "//a[@href='/event/add/']")

Expand Down Expand Up @@ -66,7 +66,7 @@ def current_month_year(self):

@property
def current_month_day(self):
return self.marionette.find_element(*self._current_months_day_locator).get_attribute('data-date')
return self.marionette.find_element(*self._current_month_day_agenda_locator).get_attribute('data-date')

@property
def event_list_date(self):
Expand Down Expand Up @@ -133,7 +133,7 @@ def a11y_click_month_display_button(self):
*self._current_monthly_calendar_locator))))
Wait(self.marionette).until(expected.element_displayed(
Wait(self.marionette).until(expected.element_present(
*self._current_months_day_locator))))
*self._current_month_day_agenda_locator))))

def a11y_click_day_display_button(self):
self.accessibility.click(self.marionette.find_element(*self._day_display_button_locator))
Expand Down
Expand Up @@ -17,7 +17,7 @@ def setUp(self):
self.views = {
'time_views': self.marionette.find_element(*self.calendar._time_views_locator),
'current_day': self.marionette.find_element(
*self.calendar._current_months_day_locator),
*self.calendar._current_month_day_agenda_locator),
'month': self.marionette.find_element(
*self.calendar._current_monthly_calendar_locator),
'day': self.marionette.find_element(*self.calendar._day_view_locator),
Expand Down

0 comments on commit d81db9c

Please sign in to comment.