зеркало из https://github.com/mozilla/pjs.git
Reformatting.
This commit is contained in:
Родитель
dc5d534dae
Коммит
d3cfa1b26f
|
@ -215,11 +215,9 @@ function MonthView( calendarWindow )
|
||||||
MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
|
MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
|
||||||
{
|
{
|
||||||
// get this month's events and display them
|
// get this month's events and display them
|
||||||
|
|
||||||
var monthEventList = this.calendarWindow.eventSource.getEventsForMonth( this.calendarWindow.getSelectedDate() );
|
var monthEventList = this.calendarWindow.eventSource.getEventsForMonth( this.calendarWindow.getSelectedDate() );
|
||||||
|
|
||||||
// remove old event boxes
|
// remove old event boxes
|
||||||
|
|
||||||
var eventBoxList = document.getElementsByAttribute( "eventbox", "monthview" );
|
var eventBoxList = document.getElementsByAttribute( "eventbox", "monthview" );
|
||||||
|
|
||||||
var eventBox = null;
|
var eventBox = null;
|
||||||
|
@ -227,20 +225,16 @@ MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
|
||||||
for( var eventBoxIndex = 0; eventBoxIndex < eventBoxList.length; ++eventBoxIndex )
|
for( var eventBoxIndex = 0; eventBoxIndex < eventBoxList.length; ++eventBoxIndex )
|
||||||
{
|
{
|
||||||
eventBox = eventBoxList[ eventBoxIndex ];
|
eventBox = eventBoxList[ eventBoxIndex ];
|
||||||
|
|
||||||
eventBox.parentNode.removeChild( eventBox );
|
eventBox.parentNode.removeChild( eventBox );
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear calendarEvent counts, we only display 3 events per day
|
// clear calendarEvent counts, we only display 3 events per day
|
||||||
// count them by adding a property to the dayItem, which is zeroed here
|
// count them by adding a property to the dayItem, which is zeroed here
|
||||||
|
|
||||||
for( var dayItemIndex = 0; dayItemIndex < this.dayBoxItemArray.length; ++dayItemIndex )
|
for( var dayItemIndex = 0; dayItemIndex < this.dayBoxItemArray.length; ++dayItemIndex )
|
||||||
{
|
{
|
||||||
var dayItem = this.dayBoxItemArray[ dayItemIndex ];
|
var dayItem = this.dayBoxItemArray[ dayItemIndex ];
|
||||||
|
|
||||||
dayItem.numEvents = 0;
|
dayItem.numEvents = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.kungFooDeathGripOnEventBoxes = new Array();
|
this.kungFooDeathGripOnEventBoxes = new Array();
|
||||||
|
|
||||||
// add each calendarEvent
|
// add each calendarEvent
|
||||||
|
@ -315,9 +309,7 @@ MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
|
||||||
{
|
{
|
||||||
//make one
|
//make one
|
||||||
dotBoxHolder = document.createElement( "hbox" );
|
dotBoxHolder = document.createElement( "hbox" );
|
||||||
|
|
||||||
dotBoxHolder.setAttribute( "id", "dotboxholder"+calendarEventDisplay.event.start.day );
|
dotBoxHolder.setAttribute( "id", "dotboxholder"+calendarEventDisplay.event.start.day );
|
||||||
|
|
||||||
dotBoxHolder.setAttribute( "eventbox", "monthview" );
|
dotBoxHolder.setAttribute( "eventbox", "monthview" );
|
||||||
|
|
||||||
//add the box to the day.
|
//add the box to the day.
|
||||||
|
@ -326,9 +318,7 @@ MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//otherwise, get the box
|
//otherwise, get the box
|
||||||
|
|
||||||
dotBoxHolder = document.getElementById( "dotboxholder"+calendarEventDisplay.event.start.day );
|
dotBoxHolder = document.getElementById( "dotboxholder"+calendarEventDisplay.event.start.day );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( dotBoxHolder.childNodes.length < kMAX_NUMBER_OF_DOTS_IN_MONTH_VIEW )
|
if( dotBoxHolder.childNodes.length < kMAX_NUMBER_OF_DOTS_IN_MONTH_VIEW )
|
||||||
|
@ -340,24 +330,18 @@ MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
|
||||||
|
|
||||||
//NOTE: This variable is named eventBox because it needs the same name as
|
//NOTE: This variable is named eventBox because it needs the same name as
|
||||||
// the regular boxes, for the next part of the function!
|
// the regular boxes, for the next part of the function!
|
||||||
|
|
||||||
eventBox = document.createElement( "image" );
|
eventBox = document.createElement( "image" );
|
||||||
|
|
||||||
eventBox.setAttribute( "class", "month-view-event-dot-class" );
|
eventBox.setAttribute( "class", "month-view-event-dot-class" );
|
||||||
|
|
||||||
eventBox.setAttribute( "id", "month-view-event-box-"+calendarEventDisplay.event.id );
|
eventBox.setAttribute( "id", "month-view-event-box-"+calendarEventDisplay.event.id );
|
||||||
eventBox.setAttribute( "name", "month-view-event-box-"+calendarEventDisplay.event.id );
|
eventBox.setAttribute( "name", "month-view-event-box-"+calendarEventDisplay.event.id );
|
||||||
|
|
||||||
eventBox.calendarEventDisplay = calendarEventDisplay;
|
eventBox.calendarEventDisplay = calendarEventDisplay;
|
||||||
|
|
||||||
this.kungFooDeathGripOnEventBoxes.push( eventBox );
|
|
||||||
|
|
||||||
eventBox.setAttribute( "onmouseover", "gCalendarWindow.changeMouseOverInfo( calendarEventDisplay, event )" );
|
eventBox.setAttribute( "onmouseover", "gCalendarWindow.changeMouseOverInfo( calendarEventDisplay, event )" );
|
||||||
eventBox.setAttribute( "onclick", "monthEventBoxClickEvent( this, event )" );
|
eventBox.setAttribute( "onclick", "monthEventBoxClickEvent( this, event )" );
|
||||||
eventBox.setAttribute( "ondblclick", "monthEventBoxDoubleClickEvent( this, event )" );
|
eventBox.setAttribute( "ondblclick", "monthEventBoxDoubleClickEvent( this, event )" );
|
||||||
|
|
||||||
eventBox.setAttribute( "tooltip", "eventTooltip" );
|
eventBox.setAttribute( "tooltip", "eventTooltip" );
|
||||||
|
|
||||||
|
this.kungFooDeathGripOnEventBoxes.push( eventBox );
|
||||||
|
|
||||||
//add the dot to the extra box.
|
//add the dot to the extra box.
|
||||||
eventDotBox.appendChild( eventBox );
|
eventDotBox.appendChild( eventBox );
|
||||||
dotBoxHolder.appendChild( eventDotBox );
|
dotBoxHolder.appendChild( eventDotBox );
|
||||||
|
@ -367,7 +351,6 @@ MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
|
||||||
}
|
}
|
||||||
|
|
||||||
// mark the box as selected, if the event is
|
// mark the box as selected, if the event is
|
||||||
|
|
||||||
if( this.calendarWindow.EventSelection.isSelectedEvent( calendarEventDisplay.event ) )
|
if( this.calendarWindow.EventSelection.isSelectedEvent( calendarEventDisplay.event ) )
|
||||||
{
|
{
|
||||||
this.selectBoxForEvent( calendarEventDisplay.event );
|
this.selectBoxForEvent( calendarEventDisplay.event );
|
||||||
|
|
|
@ -215,11 +215,9 @@ function MonthView( calendarWindow )
|
||||||
MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
|
MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
|
||||||
{
|
{
|
||||||
// get this month's events and display them
|
// get this month's events and display them
|
||||||
|
|
||||||
var monthEventList = this.calendarWindow.eventSource.getEventsForMonth( this.calendarWindow.getSelectedDate() );
|
var monthEventList = this.calendarWindow.eventSource.getEventsForMonth( this.calendarWindow.getSelectedDate() );
|
||||||
|
|
||||||
// remove old event boxes
|
// remove old event boxes
|
||||||
|
|
||||||
var eventBoxList = document.getElementsByAttribute( "eventbox", "monthview" );
|
var eventBoxList = document.getElementsByAttribute( "eventbox", "monthview" );
|
||||||
|
|
||||||
var eventBox = null;
|
var eventBox = null;
|
||||||
|
@ -227,20 +225,16 @@ MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
|
||||||
for( var eventBoxIndex = 0; eventBoxIndex < eventBoxList.length; ++eventBoxIndex )
|
for( var eventBoxIndex = 0; eventBoxIndex < eventBoxList.length; ++eventBoxIndex )
|
||||||
{
|
{
|
||||||
eventBox = eventBoxList[ eventBoxIndex ];
|
eventBox = eventBoxList[ eventBoxIndex ];
|
||||||
|
|
||||||
eventBox.parentNode.removeChild( eventBox );
|
eventBox.parentNode.removeChild( eventBox );
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear calendarEvent counts, we only display 3 events per day
|
// clear calendarEvent counts, we only display 3 events per day
|
||||||
// count them by adding a property to the dayItem, which is zeroed here
|
// count them by adding a property to the dayItem, which is zeroed here
|
||||||
|
|
||||||
for( var dayItemIndex = 0; dayItemIndex < this.dayBoxItemArray.length; ++dayItemIndex )
|
for( var dayItemIndex = 0; dayItemIndex < this.dayBoxItemArray.length; ++dayItemIndex )
|
||||||
{
|
{
|
||||||
var dayItem = this.dayBoxItemArray[ dayItemIndex ];
|
var dayItem = this.dayBoxItemArray[ dayItemIndex ];
|
||||||
|
|
||||||
dayItem.numEvents = 0;
|
dayItem.numEvents = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.kungFooDeathGripOnEventBoxes = new Array();
|
this.kungFooDeathGripOnEventBoxes = new Array();
|
||||||
|
|
||||||
// add each calendarEvent
|
// add each calendarEvent
|
||||||
|
@ -315,9 +309,7 @@ MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
|
||||||
{
|
{
|
||||||
//make one
|
//make one
|
||||||
dotBoxHolder = document.createElement( "hbox" );
|
dotBoxHolder = document.createElement( "hbox" );
|
||||||
|
|
||||||
dotBoxHolder.setAttribute( "id", "dotboxholder"+calendarEventDisplay.event.start.day );
|
dotBoxHolder.setAttribute( "id", "dotboxholder"+calendarEventDisplay.event.start.day );
|
||||||
|
|
||||||
dotBoxHolder.setAttribute( "eventbox", "monthview" );
|
dotBoxHolder.setAttribute( "eventbox", "monthview" );
|
||||||
|
|
||||||
//add the box to the day.
|
//add the box to the day.
|
||||||
|
@ -326,9 +318,7 @@ MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//otherwise, get the box
|
//otherwise, get the box
|
||||||
|
|
||||||
dotBoxHolder = document.getElementById( "dotboxholder"+calendarEventDisplay.event.start.day );
|
dotBoxHolder = document.getElementById( "dotboxholder"+calendarEventDisplay.event.start.day );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( dotBoxHolder.childNodes.length < kMAX_NUMBER_OF_DOTS_IN_MONTH_VIEW )
|
if( dotBoxHolder.childNodes.length < kMAX_NUMBER_OF_DOTS_IN_MONTH_VIEW )
|
||||||
|
@ -340,24 +330,18 @@ MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
|
||||||
|
|
||||||
//NOTE: This variable is named eventBox because it needs the same name as
|
//NOTE: This variable is named eventBox because it needs the same name as
|
||||||
// the regular boxes, for the next part of the function!
|
// the regular boxes, for the next part of the function!
|
||||||
|
|
||||||
eventBox = document.createElement( "image" );
|
eventBox = document.createElement( "image" );
|
||||||
|
|
||||||
eventBox.setAttribute( "class", "month-view-event-dot-class" );
|
eventBox.setAttribute( "class", "month-view-event-dot-class" );
|
||||||
|
|
||||||
eventBox.setAttribute( "id", "month-view-event-box-"+calendarEventDisplay.event.id );
|
eventBox.setAttribute( "id", "month-view-event-box-"+calendarEventDisplay.event.id );
|
||||||
eventBox.setAttribute( "name", "month-view-event-box-"+calendarEventDisplay.event.id );
|
eventBox.setAttribute( "name", "month-view-event-box-"+calendarEventDisplay.event.id );
|
||||||
|
|
||||||
eventBox.calendarEventDisplay = calendarEventDisplay;
|
eventBox.calendarEventDisplay = calendarEventDisplay;
|
||||||
|
|
||||||
this.kungFooDeathGripOnEventBoxes.push( eventBox );
|
|
||||||
|
|
||||||
eventBox.setAttribute( "onmouseover", "gCalendarWindow.changeMouseOverInfo( calendarEventDisplay, event )" );
|
eventBox.setAttribute( "onmouseover", "gCalendarWindow.changeMouseOverInfo( calendarEventDisplay, event )" );
|
||||||
eventBox.setAttribute( "onclick", "monthEventBoxClickEvent( this, event )" );
|
eventBox.setAttribute( "onclick", "monthEventBoxClickEvent( this, event )" );
|
||||||
eventBox.setAttribute( "ondblclick", "monthEventBoxDoubleClickEvent( this, event )" );
|
eventBox.setAttribute( "ondblclick", "monthEventBoxDoubleClickEvent( this, event )" );
|
||||||
|
|
||||||
eventBox.setAttribute( "tooltip", "eventTooltip" );
|
eventBox.setAttribute( "tooltip", "eventTooltip" );
|
||||||
|
|
||||||
|
this.kungFooDeathGripOnEventBoxes.push( eventBox );
|
||||||
|
|
||||||
//add the dot to the extra box.
|
//add the dot to the extra box.
|
||||||
eventDotBox.appendChild( eventBox );
|
eventDotBox.appendChild( eventBox );
|
||||||
dotBoxHolder.appendChild( eventDotBox );
|
dotBoxHolder.appendChild( eventDotBox );
|
||||||
|
@ -367,7 +351,6 @@ MonthView.prototype.refreshEvents = function monthView_refreshEvents( )
|
||||||
}
|
}
|
||||||
|
|
||||||
// mark the box as selected, if the event is
|
// mark the box as selected, if the event is
|
||||||
|
|
||||||
if( this.calendarWindow.EventSelection.isSelectedEvent( calendarEventDisplay.event ) )
|
if( this.calendarWindow.EventSelection.isSelectedEvent( calendarEventDisplay.event ) )
|
||||||
{
|
{
|
||||||
this.selectBoxForEvent( calendarEventDisplay.event );
|
this.selectBoxForEvent( calendarEventDisplay.event );
|
||||||
|
|
Загрузка…
Ссылка в новой задаче