Fix bug 416802 - Add additional properties to allow easy customization of days in the views. r=berend
git-svn-id: svn://10.0.0.236/trunk@245821 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
e156454e0b
commit
1e6ab834fb
@ -1298,12 +1298,7 @@
|
||||
}
|
||||
|
||||
var dateBoxes = [];
|
||||
|
||||
// clear out the old today
|
||||
var oldToday = document.getAnonymousElementByAttribute(this, "today", "true");
|
||||
if (oldToday) {
|
||||
oldToday.removeAttribute("today");
|
||||
}
|
||||
var today = this.today();
|
||||
|
||||
// This gets set to true, telling us to collapse the rest of the rows
|
||||
var finished = false;
|
||||
@ -1347,6 +1342,19 @@
|
||||
boxClass = "calendar-month-day-box-day-off " + boxClass;
|
||||
}
|
||||
|
||||
// Set up date relations
|
||||
switch (date.compare(today)) {
|
||||
case -1:
|
||||
daybox.setAttribute("relation", "past");
|
||||
break;
|
||||
case 0:
|
||||
daybox.setAttribute("relation", "today");
|
||||
break;
|
||||
case 1:
|
||||
daybox.setAttribute("relation", "future");
|
||||
break;
|
||||
}
|
||||
|
||||
daybox.setAttribute("class", boxClass);
|
||||
|
||||
daybox.setDate(date);
|
||||
@ -1386,7 +1394,6 @@
|
||||
this.hideDaysOff();
|
||||
|
||||
// Highlight today, if it's in the range of the view
|
||||
var today = this.today();
|
||||
if (today.compare(dateList[0]) != -1 &&
|
||||
today.compare(dateList[dateList.length-1]) != 1) {
|
||||
this.findBoxForDate(today).box.setAttribute("today", "true");
|
||||
|
||||
@ -65,11 +65,43 @@
|
||||
<field name="mPixPerMin">0.6</field>
|
||||
<field name="mStartMin">0*60</field>
|
||||
<field name="mEndMin">24*60</field>
|
||||
<field name="mDayStartHour">0</field>
|
||||
<field name="mDayEndHour">24</field>
|
||||
|
||||
<constructor>
|
||||
this.relayout();
|
||||
</constructor>
|
||||
|
||||
<method name="setDayStartEndHours">
|
||||
<parameter name="aDayStartHour"/>
|
||||
<parameter name="aDayEndHour"/>
|
||||
<body><![CDATA[
|
||||
if (aDayStartHour * 60 < this.mStartMin ||
|
||||
aDayStartHour > aDayEndHour ||
|
||||
aDayEndHour * 60 > this.mEndMin) {
|
||||
throw Components.results.NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
if (this.mDayStartHour != aDayStartHour ||
|
||||
this.mDayEndHour != aDayEndHour) {
|
||||
this.mDayEndHour = aDayEndHour;
|
||||
this.mDayStartHour = aDayStartHour;
|
||||
|
||||
var topbox = document.getAnonymousElementByAttribute(this, "anonid", "topbox");
|
||||
if (topbox.childNodes.length) {
|
||||
// This only needs to be done if the initial relayout has
|
||||
// already happened, otherwise it will be done then.
|
||||
for (var hour = this.mStartMin / 60; hour < this.mEndMin / 60; hour++) {
|
||||
if (hour < this.mDayStartHour || hour > this.mDayEndHour) {
|
||||
topbox.childNodes[hour].setAttribute("off-time", "true");
|
||||
} else {
|
||||
topbox.childNodes[hour].removeAttribute("off-time");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="setAttribute">
|
||||
<parameter name="aAttr"/>
|
||||
<parameter name="aVal"/>
|
||||
@ -165,6 +197,11 @@
|
||||
box = makeTimeBox(timeString, durPix);
|
||||
}
|
||||
|
||||
// Set up workweek hours
|
||||
if (theHour < this.mDayStartHour || theHour >= this.mDayEndHour) {
|
||||
box.setAttribute("off-time", "true");
|
||||
}
|
||||
|
||||
box.setAttribute("class", "calendar-time-bar-box-" + (theHour % 2 == 0 ? "even" : "odd"));
|
||||
topbox.appendChild(box);
|
||||
|
||||
@ -395,17 +432,6 @@
|
||||
readonly="true"
|
||||
onget="return this.methods"/>
|
||||
|
||||
<field name="mToday">false</field>
|
||||
<property name="today">
|
||||
<getter><![CDATA[
|
||||
return this.mToday;
|
||||
]]></getter>
|
||||
<setter><![CDATA[
|
||||
this.mToday = val;
|
||||
return val;
|
||||
]]></setter>
|
||||
</property>
|
||||
|
||||
<field name="mDayOff">false</field>
|
||||
<property name="dayOff">
|
||||
<getter><![CDATA[
|
||||
@ -658,9 +684,6 @@
|
||||
if (this.mSelected) {
|
||||
box.setAttribute("selected", "true");
|
||||
}
|
||||
if (this.mToday) {
|
||||
box.setAttribute("today", "true");
|
||||
}
|
||||
if (this.mDayOff) {
|
||||
box.setAttribute("weekend", "true");
|
||||
}
|
||||
@ -668,6 +691,9 @@
|
||||
box.setAttribute("off-time", "true");
|
||||
}
|
||||
|
||||
// Carry forth the day relation
|
||||
box.setAttribute("relation", this.getAttribute("relation"));
|
||||
|
||||
// calculate duration pixel as the difference between
|
||||
// start pixel and end pixel to avoid rounding errors.
|
||||
var startPix = Math.round(theMin * this.mPixPerMin);
|
||||
@ -2371,8 +2397,8 @@
|
||||
|
||||
<field name="mStartMin">0*60</field>
|
||||
<field name="mEndMin">24*60</field>
|
||||
<field name="mDayStartMin">8*60</field>
|
||||
<field name="mDayEndMin">17*60</field>
|
||||
<field name="mDayStartMin">0</field>
|
||||
<field name="mDayEndMin">0</field>
|
||||
<field name="mVisibleMinutes">9*60</field>
|
||||
<field name="mTasksInView">false</field>
|
||||
<field name="mShowCompleted">false</field>
|
||||
@ -3226,7 +3252,7 @@
|
||||
var dayEventsBox;
|
||||
if (counter < dayboxkids.length) {
|
||||
dayEventsBox = dayboxkids[counter];
|
||||
dayEventsBox.today = false;
|
||||
dayEventsBox.removeAttribute("relation");
|
||||
dayEventsBox.mEvents = new Array();
|
||||
} else {
|
||||
dayEventsBox = createXULElement("calendar-event-column");
|
||||
@ -3260,10 +3286,22 @@
|
||||
dayHeaderBox.removeAttribute("weekend");
|
||||
}
|
||||
|
||||
// highlight today
|
||||
if (this.numVisibleDates > 1 && d.compare(today) == 0) {
|
||||
dayEventsBox.today = true;
|
||||
dayHeaderBox.setAttribute("today", "true");
|
||||
// Set attributes for date relations.
|
||||
if (this.numVisibleDates > 1) {
|
||||
switch (d.compare(today)) {
|
||||
case -1:
|
||||
dayHeaderBox.setAttribute("relation", "past");
|
||||
dayEventsBox.setAttribute("relation", "past");
|
||||
break;
|
||||
case 0:
|
||||
dayHeaderBox.setAttribute("relation", "today");
|
||||
dayEventsBox.setAttribute("relation", "today");
|
||||
break;
|
||||
case 1:
|
||||
dayHeaderBox.setAttribute("relation", "future");
|
||||
dayEventsBox.setAttribute("relation", "future");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var labelbox;
|
||||
@ -3593,9 +3631,16 @@
|
||||
}
|
||||
if (this.mDayStartMin != aDayStartMin ||
|
||||
this.mDayEndMin != aDayEndMin) {
|
||||
|
||||
this.mDayStartMin = aDayStartMin;
|
||||
this.mDayEndMin = aDayEndMin;
|
||||
|
||||
// Also update on the time-bar
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "timebar")
|
||||
.setDayStartEndHours(this.mDayStartMin / 60,
|
||||
this.mDayEndMin / 60);
|
||||
}
|
||||
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
/* Multiday view */
|
||||
calendar-event-column {
|
||||
background: #FFFFFF;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
calendar-event-column[orient="horizontal"] {
|
||||
@ -52,7 +52,7 @@ calendar-event-column[orient="vertical"] {
|
||||
}
|
||||
|
||||
calendar-header-container {
|
||||
background: #FFFFFF;
|
||||
background-color: #FFFFFF;
|
||||
border-left: 1px solid #3F7D91;
|
||||
border-top: 1px solid #3F7D91;
|
||||
}
|
||||
@ -60,29 +60,29 @@ calendar-header-container {
|
||||
calendar-header-container[weekend="true"],
|
||||
.calendar-event-column-linebox[weekend="true"],
|
||||
.calendar-event-column-linebox[off-time="true"] {
|
||||
background: #f4f4f4;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
calendar-header-container[today="true"],
|
||||
.calendar-event-column-linebox[today="true"] {
|
||||
background: #dfeaf4;
|
||||
calendar-header-container[relation="today"],
|
||||
.calendar-event-column-linebox[relation="today"] {
|
||||
background-color: #dfeaf4;
|
||||
}
|
||||
|
||||
calendar-header-container[selected="true"],
|
||||
.calendar-event-column-linebox[selected="true"] {
|
||||
background: #ffe79c;
|
||||
background-color: #ffe79c;
|
||||
}
|
||||
|
||||
calendar-header-container[weekend="true"][today="true"],
|
||||
.calendar-event-column-linebox[weekend="true"][today="true"],
|
||||
.calendar-event-column-linebox[off-time="true"][today="true"] {
|
||||
background: #d6dfe9;
|
||||
calendar-header-container[weekend="true"][relation="today"],
|
||||
.calendar-event-column-linebox[weekend="true"][relation="today"],
|
||||
.calendar-event-column-linebox[off-time="true"][relation="today"] {
|
||||
background-color: #d6dfe9;
|
||||
}
|
||||
|
||||
calendar-header-container[weekend="true"][selected="true"],
|
||||
.calendar-event-column-linebox[weekend="true"][selected="true"],
|
||||
.calendar-event-column-linebox[off-time="true"][selected="true"] {
|
||||
background: #f5dd92;
|
||||
background-color: #f5dd92;
|
||||
}
|
||||
|
||||
.calendar-event-column-linebox[orient="horizontal"] {
|
||||
@ -134,7 +134,7 @@ calendar-header-container[weekend="true"][selected="true"],
|
||||
|
||||
.fgdragbox[dragging="true"] {
|
||||
display: -moz-box;
|
||||
background: blue;
|
||||
background-color: blue;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ calendar-header-container[weekend="true"][selected="true"],
|
||||
|
||||
textbox.editable-label {
|
||||
font-size: x-small;
|
||||
background: transparent !important;
|
||||
background-color: transparent !important;
|
||||
border: none;
|
||||
padding: 0px;
|
||||
-moz-appearance: none;
|
||||
@ -186,7 +186,7 @@ textbox.editable-label {
|
||||
|
||||
calendar-event-box[selected="true"] .calendar-event-selection {
|
||||
color: #000000 !important;
|
||||
background: #ffdb67 !important;
|
||||
background-color: #ffdb67 !important;
|
||||
}
|
||||
|
||||
calendar-event-gripbar {
|
||||
@ -241,7 +241,7 @@ calendar-time-bar[anonid="timebar"][orient="horizontal"] {
|
||||
.calendar-time-bar-box-odd,
|
||||
.calendar-time-bar-box-even {
|
||||
color: #3F7D91;
|
||||
background: #E7EEEC;
|
||||
background-color: #E7EEEC;
|
||||
text-align: right;
|
||||
overflow: hidden;
|
||||
}
|
||||
@ -259,7 +259,7 @@ calendar-time-bar[anonid="timebar"][orient="horizontal"] {
|
||||
}
|
||||
|
||||
calendar-multiday-view {
|
||||
background: #FFFFFF;
|
||||
background-color: #FFFFFF;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
@ -269,7 +269,7 @@ calendar-multiday-view[hidden="true"] {
|
||||
|
||||
calendar-day-label {
|
||||
color: #3F7D91;
|
||||
background: #E7EEEC;
|
||||
background-color: #E7EEEC;
|
||||
border-top: 1px solid #3F7D91;
|
||||
border-left: 1px solid #3F7D91;
|
||||
}
|
||||
@ -287,7 +287,7 @@ calendar-day-label {
|
||||
|
||||
/* Month View */
|
||||
calendar-month-view {
|
||||
background: #FFFFFF;
|
||||
background-color: #FFFFFF;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
@ -308,28 +308,28 @@ calendar-month-day-box {
|
||||
}
|
||||
|
||||
.calendar-month-day-box-current-month {
|
||||
background: #FFFFFF;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.calendar-month-day-box-day-off {
|
||||
background: #FFF9E7;
|
||||
background-color: #FFF9E7;
|
||||
}
|
||||
|
||||
.calendar-month-day-box-other-month {
|
||||
background: #E7EEEC;
|
||||
background-color: #E7EEEC;
|
||||
}
|
||||
|
||||
.calendar-month-day-box-current-month[today="true"],
|
||||
.calendar-month-day-box-day-off[today="true"],
|
||||
.calendar-month-day-box-other-month[today="true"] {
|
||||
background: #dfeaf4;
|
||||
.calendar-month-day-box-current-month[relation="today"],
|
||||
.calendar-month-day-box-day-off[relation="today"],
|
||||
.calendar-month-day-box-other-month[relation="today"] {
|
||||
background-color: #dfeaf4;
|
||||
border: 2px solid #1D7AB5 !important;
|
||||
}
|
||||
|
||||
.calendar-month-day-box-current-month[selected="true"],
|
||||
.calendar-month-day-box-day-off[selected="true"],
|
||||
.calendar-month-day-box-other-month[selected="true"] {
|
||||
background: #ffe79c;
|
||||
background-color: #ffe79c;
|
||||
border: 1px solid #1D7AB5;
|
||||
}
|
||||
|
||||
@ -347,7 +347,7 @@ calendar-month-day-box-item {
|
||||
|
||||
calendar-month-day-box-item[selected="true"] .calendar-event-selection {
|
||||
color: #000000 !important;
|
||||
background: #ffdb67 !important;
|
||||
background-color: #ffdb67 !important;
|
||||
}
|
||||
|
||||
.calendar-month-day-box-item-label {
|
||||
@ -377,7 +377,7 @@ calendar-month-day-box-item[selected="true"] .calendar-event-selection {
|
||||
|
||||
calendar-month-view-column-header {
|
||||
color: #3F7D91;
|
||||
background: #E7EEEC;
|
||||
background-color: #E7EEEC;
|
||||
font-weight:bold;
|
||||
border-left: 1px solid #3F7D91;
|
||||
border-right: 1px solid #3F7D91;
|
||||
@ -397,11 +397,11 @@ calendar-month-view-column-header {
|
||||
|
||||
calendar-editable-item[selected="true"] .calendar-event-selection {
|
||||
color: #000000 !important;
|
||||
background: #ffdb67 !important;
|
||||
background-color: #ffdb67 !important;
|
||||
}
|
||||
|
||||
box[dropbox="true"] {
|
||||
background: blue !important;
|
||||
background-color: blue !important;
|
||||
height: 1.2em;
|
||||
margin: 1px;
|
||||
padding: 0px 1px 0px 1px;
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
/* Multiday view */
|
||||
calendar-event-column {
|
||||
background: #FFFFFF;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
calendar-event-column[orient="horizontal"] {
|
||||
@ -52,7 +52,7 @@ calendar-event-column[orient="vertical"] {
|
||||
}
|
||||
|
||||
calendar-header-container {
|
||||
background: #FFFFFF;
|
||||
background-color: #FFFFFF;
|
||||
border-left: 1px solid #3F7D91;
|
||||
border-top: 1px solid #3F7D91;
|
||||
}
|
||||
@ -60,29 +60,29 @@ calendar-header-container {
|
||||
calendar-header-container[weekend="true"],
|
||||
.calendar-event-column-linebox[weekend="true"],
|
||||
.calendar-event-column-linebox[off-time="true"] {
|
||||
background: #f4f4f4;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
calendar-header-container[today="true"],
|
||||
.calendar-event-column-linebox[today="true"] {
|
||||
background: #dfeaf4;
|
||||
calendar-header-container[relation="today"],
|
||||
.calendar-event-column-linebox[relation="today"] {
|
||||
background-color: #dfeaf4;
|
||||
}
|
||||
|
||||
calendar-header-container[selected="true"],
|
||||
.calendar-event-column-linebox[selected="true"] {
|
||||
background: #ffe79c;
|
||||
background-color: #ffe79c;
|
||||
}
|
||||
|
||||
calendar-header-container[weekend="true"][today="true"],
|
||||
.calendar-event-column-linebox[weekend="true"][today="true"],
|
||||
.calendar-event-column-linebox[off-time="true"][today="true"] {
|
||||
background: #d6dfe9;
|
||||
calendar-header-container[weekend="true"][relation="today"],
|
||||
.calendar-event-column-linebox[weekend="true"][relation="today"],
|
||||
.calendar-event-column-linebox[off-time="true"][relation="today"] {
|
||||
background-color: #d6dfe9;
|
||||
}
|
||||
|
||||
calendar-header-container[weekend="true"][selected="true"],
|
||||
.calendar-event-column-linebox[weekend="true"][selected="true"],
|
||||
.calendar-event-column-linebox[off-time="true"][selected="true"] {
|
||||
background: #f5dd92;
|
||||
background-color: #f5dd92;
|
||||
}
|
||||
|
||||
.calendar-event-column-linebox[orient="horizontal"] {
|
||||
@ -134,7 +134,7 @@ calendar-header-container[weekend="true"][selected="true"],
|
||||
|
||||
.fgdragbox[dragging="true"] {
|
||||
display: -moz-box;
|
||||
background: blue;
|
||||
background-color: blue;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ calendar-header-container[weekend="true"][selected="true"],
|
||||
|
||||
textbox.editable-label {
|
||||
font-size: x-small;
|
||||
background: transparent !important;
|
||||
background-color: transparent !important;
|
||||
border: none;
|
||||
padding: 0px;
|
||||
-moz-appearance: none;
|
||||
@ -186,7 +186,7 @@ textbox.editable-label {
|
||||
|
||||
calendar-event-box[selected="true"] .calendar-event-selection {
|
||||
color: #000000 !important;
|
||||
background: #ffdb67 !important;
|
||||
background-color: #ffdb67 !important;
|
||||
}
|
||||
|
||||
calendar-event-gripbar {
|
||||
@ -241,7 +241,7 @@ calendar-time-bar[anonid="timebar"][orient="horizontal"] {
|
||||
.calendar-time-bar-box-odd,
|
||||
.calendar-time-bar-box-even {
|
||||
color: #3F7D91;
|
||||
background: #E7EEEC;
|
||||
background-color: #E7EEEC;
|
||||
text-align: right;
|
||||
overflow: hidden;
|
||||
}
|
||||
@ -259,7 +259,7 @@ calendar-time-bar[anonid="timebar"][orient="horizontal"] {
|
||||
}
|
||||
|
||||
calendar-multiday-view {
|
||||
background: #FFFFFF;
|
||||
background-color: #FFFFFF;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
@ -269,7 +269,7 @@ calendar-multiday-view[hidden="true"] {
|
||||
|
||||
calendar-day-label {
|
||||
color: #3F7D91;
|
||||
background: #E7EEEC;
|
||||
background-color: #E7EEEC;
|
||||
border-top: 1px solid #3F7D91;
|
||||
border-left: 1px solid #3F7D91;
|
||||
}
|
||||
@ -287,7 +287,7 @@ calendar-day-label {
|
||||
|
||||
/* Month View */
|
||||
calendar-month-view {
|
||||
background: #FFFFFF;
|
||||
background-color: #FFFFFF;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
@ -308,28 +308,28 @@ calendar-month-day-box {
|
||||
}
|
||||
|
||||
.calendar-month-day-box-current-month {
|
||||
background: #FFFFFF;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.calendar-month-day-box-day-off {
|
||||
background: #FFF9E7;
|
||||
background-color: #FFF9E7;
|
||||
}
|
||||
|
||||
.calendar-month-day-box-other-month {
|
||||
background: #E7EEEC;
|
||||
background-color: #E7EEEC;
|
||||
}
|
||||
|
||||
.calendar-month-day-box-current-month[today="true"],
|
||||
.calendar-month-day-box-day-off[today="true"],
|
||||
.calendar-month-day-box-other-month[today="true"] {
|
||||
background: #dfeaf4;
|
||||
.calendar-month-day-box-current-month[relation="today"],
|
||||
.calendar-month-day-box-day-off[relation="today"],
|
||||
.calendar-month-day-box-other-month[relation="today"] {
|
||||
background-color: #dfeaf4;
|
||||
border: 2px solid #1D7AB5 !important;
|
||||
}
|
||||
|
||||
.calendar-month-day-box-current-month[selected="true"],
|
||||
.calendar-month-day-box-day-off[selected="true"],
|
||||
.calendar-month-day-box-other-month[selected="true"] {
|
||||
background: #ffe79c;
|
||||
background-color: #ffe79c;
|
||||
border: 1px solid #1D7AB5;
|
||||
}
|
||||
|
||||
@ -347,7 +347,7 @@ calendar-month-day-box-item {
|
||||
|
||||
calendar-month-day-box-item[selected="true"] .calendar-event-selection {
|
||||
color: #000000 !important;
|
||||
background: #ffdb67 !important;
|
||||
background-color: #ffdb67 !important;
|
||||
}
|
||||
|
||||
.calendar-month-day-box-item-label {
|
||||
@ -377,7 +377,7 @@ calendar-month-day-box-item[selected="true"] .calendar-event-selection {
|
||||
|
||||
calendar-month-view-column-header {
|
||||
color: #3F7D91;
|
||||
background: #E7EEEC;
|
||||
background-color: #E7EEEC;
|
||||
font-weight:bold;
|
||||
border-left: 1px solid #3F7D91;
|
||||
border-right: 1px solid #3F7D91;
|
||||
@ -397,11 +397,11 @@ calendar-month-view-column-header {
|
||||
|
||||
calendar-editable-item[selected="true"] .calendar-event-selection {
|
||||
color: #000000 !important;
|
||||
background: #ffdb67 !important;
|
||||
background-color: #ffdb67 !important;
|
||||
}
|
||||
|
||||
box[dropbox="true"] {
|
||||
background: blue !important;
|
||||
background-color: blue !important;
|
||||
height: 1.2em;
|
||||
margin: 1px;
|
||||
padding: 0px 1px 0px 1px;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user