Bug 362938 - Attendee Dialog: No borders between days in free/busy grid. r=philipp
This commit is contained in:
Родитель
9cf5031986
Коммит
6841ecc253
|
@ -39,24 +39,6 @@ function onLoad() {
|
|||
|
||||
onChangeCalendar(calendar);
|
||||
|
||||
// we need to enforce several layout constraints which can't be modelled
|
||||
// with plain xul and css, at least as far as i know.
|
||||
const kStylesheet = "chrome://calendar/skin/calendar-event-dialog.css";
|
||||
for each (var stylesheet in document.styleSheets) {
|
||||
if (stylesheet.href == kStylesheet) {
|
||||
// make the dummy-spacer #1 [top] the same height as the timebar
|
||||
var timebar = document.getElementById("timebar");
|
||||
stylesheet.insertRule(
|
||||
".attendee-spacer-top { height: "
|
||||
+ timebar.boxObject.height+"px; }", 0);
|
||||
// make the dummy-spacer #2 [bottom] the same height as the scrollbar
|
||||
var scrollbar = document.getElementById("horizontal-scrollbar");
|
||||
stylesheet.insertRule(
|
||||
".attendee-spacer-bottom { height: "
|
||||
+ scrollbar.boxObject.height+"px; }", 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
let zoom = document.getElementById("zoom-menulist");
|
||||
let zoomOut = document.getElementById("zoom-out-button");
|
||||
|
@ -89,6 +71,25 @@ function onLoad() {
|
|||
|
||||
updateButtons();
|
||||
|
||||
// we need to enforce several layout constraints which can't be modelled
|
||||
// with plain xul and css, at least as far as i know.
|
||||
const kStylesheet = "chrome://calendar/skin/calendar-event-dialog.css";
|
||||
for each (var stylesheet in document.styleSheets) {
|
||||
if (stylesheet.href == kStylesheet) {
|
||||
// make the dummy-spacer #1 [top] the same height as the timebar
|
||||
var timebar = document.getElementById("timebar");
|
||||
stylesheet.insertRule(
|
||||
".attendee-spacer-top { height: "
|
||||
+ timebar.boxObject.height+"px; }", 0);
|
||||
// make the dummy-spacer #2 [bottom] the same height as the scrollbar
|
||||
var scrollbar = document.getElementById("horizontal-scrollbar");
|
||||
stylesheet.insertRule(
|
||||
".attendee-spacer-bottom { height: "
|
||||
+ scrollbar.boxObject.height+"px; }", 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// attach an observer to get notified of changes
|
||||
// that are relevant to this dialog.
|
||||
var prefObserver = {
|
||||
|
|
|
@ -68,9 +68,7 @@
|
|||
<xul:text class="freebusy-timebar-title"
|
||||
style="font-weight:bold;"
|
||||
anonid="day"/>
|
||||
<xul:box equalsize="always" anonid="hours">
|
||||
<xul:text class="freebusy-timebar-hour"/>
|
||||
</xul:box>
|
||||
<xul:box equalsize="always" anonid="hours"/>
|
||||
</xul:box>
|
||||
</content>
|
||||
|
||||
|
@ -89,12 +87,8 @@
|
|||
]]></getter>
|
||||
<setter><![CDATA[
|
||||
this.mZoomFactor = val;
|
||||
var hours =
|
||||
document.getAnonymousElementByAttribute(
|
||||
this, "anonid", "hours");
|
||||
while (hours.childNodes.length > 1) {
|
||||
hours.removeChild(hours.lastChild);
|
||||
}
|
||||
let hours = document.getAnonymousElementByAttribute(this, "anonid", "hours");
|
||||
removeChildren(hours);
|
||||
return val;
|
||||
]]></setter>
|
||||
</property>
|
||||
|
@ -107,13 +101,8 @@
|
|||
this.mForce24Hours = val;
|
||||
this.initTimeRange();
|
||||
|
||||
var hours =
|
||||
document.getAnonymousElementByAttribute(
|
||||
this, "anonid", "hours");
|
||||
while (hours.childNodes.length > 1) {
|
||||
hours.removeChild(hours.lastChild);
|
||||
}
|
||||
|
||||
let hours = document.getAnonymousElementByAttribute(this, "anonid", "hours");
|
||||
removeChildren(hours);
|
||||
return val;
|
||||
]]></setter>
|
||||
</property>
|
||||
|
@ -191,20 +180,27 @@
|
|||
document.getAnonymousElementByAttribute(
|
||||
this, "anonid", "hours");
|
||||
date.hour = this.mStartHour;
|
||||
if (hours.childNodes.length <= 1) {
|
||||
var template = hours.childNodes[0];
|
||||
var time = this.mDateFormatter.formatTime(date);
|
||||
template.setAttribute("value", time);
|
||||
date.minute += step_in_minutes;
|
||||
if (hours.childNodes.length <= 0) {
|
||||
var template = createXULElement("text");
|
||||
template.className = "freebusy-timebar-hour";
|
||||
var count = Math.ceil(
|
||||
(this.mEndHour - this.mStartHour) * 60 / step_in_minutes);
|
||||
var remain = count - 1;
|
||||
var remain = count;
|
||||
let first = true;
|
||||
while (remain--) {
|
||||
var newNode = template.cloneNode(false);
|
||||
var value = this.mDateFormatter.formatTime(date);
|
||||
if (first) {
|
||||
newNode.className += " first-in-day";
|
||||
first = false;
|
||||
}
|
||||
newNode.setAttribute("value", value);
|
||||
hours.appendChild(newNode);
|
||||
date.minute += step_in_minutes;
|
||||
|
||||
if (remain == 0) {
|
||||
newNode.className += " last-in-day"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -230,7 +226,9 @@
|
|||
<xul:listcols>
|
||||
<xul:listcol anonid="day-column" flex="1"/>
|
||||
</xul:listcols>
|
||||
<xul:listitem anonid="item" allowevents="true">
|
||||
<xul:listitem anonid="item"
|
||||
class="freebusy-listitem"
|
||||
allowevents="true">
|
||||
<xul:listcell >
|
||||
<xul:scroll-container anonid="container">
|
||||
<xul:freebusy-day anonid="template"/>
|
||||
|
@ -537,9 +535,7 @@
|
|||
<binding id="freebusy-row" extends="xul:box">
|
||||
<content>
|
||||
<xul:scroll-container flex="1" anonid="container">
|
||||
<xul:box equalsize="always" anonid="hours">
|
||||
<xul:text class="freebusy-grid"/>
|
||||
</xul:box>
|
||||
<xul:box equalsize="always" anonid="hours"/>
|
||||
</xul:scroll-container>
|
||||
</content>
|
||||
|
||||
|
@ -562,13 +558,8 @@
|
|||
<setter><![CDATA[
|
||||
this.mZoomFactor = val;
|
||||
|
||||
var hours =
|
||||
document.getAnonymousElementByAttribute(
|
||||
this, "anonid", "hours");
|
||||
while (hours.childNodes.length > 1) {
|
||||
hours.removeChild(hours.lastChild);
|
||||
}
|
||||
|
||||
let hours = document.getAnonymousElementByAttribute(this, "anonid", "hours");
|
||||
removeChildren(hours);
|
||||
this.onLoad();
|
||||
|
||||
return val;
|
||||
|
@ -583,13 +574,8 @@
|
|||
this.mForce24Hours = val;
|
||||
this.initTimeRange();
|
||||
|
||||
var hours =
|
||||
document.getAnonymousElementByAttribute(
|
||||
this, "anonid", "hours");
|
||||
while (hours.childNodes.length > 1) {
|
||||
hours.removeChild(hours.lastChild);
|
||||
}
|
||||
|
||||
let hours = document.getAnonymousElementByAttribute(this, "anonid", "hours");
|
||||
removeChildren(hours);
|
||||
this.onLoad();
|
||||
|
||||
return val;
|
||||
|
@ -714,23 +700,31 @@
|
|||
let hours =
|
||||
document.getAnonymousElementByAttribute(
|
||||
this, "anonid", "hours");
|
||||
if (hours.childNodes.length <= 1) {
|
||||
let template = hours.childNodes[0];
|
||||
let time = formatter.formatTime(date);
|
||||
template.setAttribute("value", time);
|
||||
date.minute += step_in_minutes;
|
||||
if (hours.childNodes.length <= 0) {
|
||||
let template = createXULElement("text");
|
||||
template.className = "freebusy-grid";
|
||||
// TODO: hardcoded value
|
||||
let num_days = Math.max(2, 4 * this.mZoomFactor / 100);
|
||||
let count = Math.ceil(
|
||||
(this.mEndHour - this.mStartHour) * 60 / step_in_minutes);
|
||||
let remain = count - 1;
|
||||
let remain = count;
|
||||
for (let day = 1; day <= num_days; day++) {
|
||||
let first = true;
|
||||
while (remain--) {
|
||||
let newNode = template.cloneNode(false);
|
||||
let value = formatter.formatTime(date);
|
||||
if (first) {
|
||||
newNode.className += " first-in-day";
|
||||
first = false;
|
||||
}
|
||||
|
||||
newNode.setAttribute("value", value);
|
||||
hours.appendChild(newNode);
|
||||
date.minute += step_in_minutes;
|
||||
|
||||
if (remain == 0) {
|
||||
newNode.className += " last-in-day"
|
||||
}
|
||||
}
|
||||
date.hour = this.mStartHour;
|
||||
date.day++;
|
||||
|
|
|
@ -163,8 +163,32 @@ daypicker-monthday {
|
|||
*-------------------------------------------------------------------*/
|
||||
|
||||
.listbox-noborder {
|
||||
-moz-appearance: none;
|
||||
margin: 0px 0px;
|
||||
border-style: none;
|
||||
border: 1px solid #8D8E90;
|
||||
}
|
||||
|
||||
dialog[systemcolors] .listbox-noborder {
|
||||
border: 1px solid ThreeDShadow;
|
||||
}
|
||||
|
||||
#timebar > .listbox-noborder {
|
||||
border-bottom-style: none;
|
||||
}
|
||||
|
||||
#freebusy-grid > .listbox-noborder {
|
||||
border-top-color: transparent;
|
||||
}
|
||||
|
||||
/* remove on Windows the double border with the splitter */
|
||||
@media (-moz-windows-theme) {
|
||||
#attendees-list > .listbox-noborder {
|
||||
-moz-border-end-style: none;
|
||||
}
|
||||
#timebar > .listbox-noborder,
|
||||
#freebusy-grid > .listbox-noborder {
|
||||
-moz-border-start-style: none;
|
||||
}
|
||||
}
|
||||
|
||||
.selection-bar {
|
||||
|
@ -179,19 +203,55 @@ daypicker-monthday {
|
|||
clip: rect(0px 0px 0px 0px);
|
||||
}
|
||||
|
||||
.freebusy-listitem {
|
||||
border-width: 0px;
|
||||
}
|
||||
|
||||
freebusy-day {
|
||||
-moz-margin-end: 2px;
|
||||
-moz-border-start: 1px solid #8D8E90;
|
||||
-moz-border-end: 1px solid #8D8E90;
|
||||
border-bottom: 1px solid #8D8E90;
|
||||
}
|
||||
|
||||
dialog[systemcolors] freebusy-day {
|
||||
-moz-border-start: 1px solid ThreeDShadow;
|
||||
-moz-border-end: 1px solid ThreeDShadow;
|
||||
border-bottom: 1px solid ThreeDShadow;
|
||||
}
|
||||
|
||||
freebusy-day:first-child,
|
||||
dialog[systemcolors] freebusy-day:first-child {
|
||||
-moz-border-start: 1px solid transparent;
|
||||
}
|
||||
|
||||
freebusy-day:last-child,
|
||||
dialog[systemcolors] freebusy-day:last-child {
|
||||
-moz-border-end: 1px solid transparent;
|
||||
}
|
||||
|
||||
/* negative margins to clear freebusy-day's border and margin */
|
||||
freebusy-day > box {
|
||||
-moz-margin-start: -1px;
|
||||
-moz-margin-end: -3px;
|
||||
}
|
||||
|
||||
.freebusy-content {
|
||||
overflow: hidden;
|
||||
clip: rect(0px 0px 0px 0px);
|
||||
}
|
||||
|
||||
/* -moz-margin-end 1px is needed to take border-right from the grid elements into account */
|
||||
/* -moz-margin-end 2px is needed to take border-right from the grid elements into account */
|
||||
.freebusy-timebar-title {
|
||||
-moz-margin-end: 1px;
|
||||
-moz-margin-end: 2px;
|
||||
-moz-padding-start: 2px;
|
||||
}
|
||||
|
||||
.freebusy-timebar-hour {
|
||||
-moz-margin-end: 1px;
|
||||
margin-bottom: 5px;
|
||||
-moz-padding-start: 2px;
|
||||
-moz-padding-end: 3px;
|
||||
margin-top: 2px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.freebusy-timebar-hour[scheduled="true"] {
|
||||
|
@ -205,10 +265,15 @@ daypicker-monthday {
|
|||
}
|
||||
|
||||
.freebusy-grid {
|
||||
border-right: 1px solid #BDBEC0;
|
||||
-moz-border-start: 1px solid #BDBEC0;
|
||||
background-color: #E09EBD;
|
||||
color: #E09EBD;
|
||||
min-height: 16px;
|
||||
-moz-padding-start: 1px;
|
||||
}
|
||||
|
||||
dialog[systemcolors] .freebusy-grid {
|
||||
-moz-border-start: 1px solid ThreeDShadow;
|
||||
}
|
||||
|
||||
.freebusy-grid[state="busy"] {
|
||||
|
@ -231,6 +296,20 @@ daypicker-monthday {
|
|||
color: #EBEBE4;
|
||||
}
|
||||
|
||||
.freebusy-grid:first-child,
|
||||
dialog[systemcolors] .freebusy-grid:first-child {
|
||||
-moz-border-start: 1px solid transparent;
|
||||
}
|
||||
|
||||
.freebusy-grid.last-in-day {
|
||||
-moz-border-end: 1px solid #8D8E90;
|
||||
-moz-margin-end: 2px;
|
||||
}
|
||||
|
||||
dialog[systemcolors] .freebusy-grid.last-in-day {
|
||||
-moz-border-end: 1px solid ThreeDShadow;
|
||||
}
|
||||
|
||||
#dialog-box {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 10px;
|
||||
|
@ -267,13 +346,16 @@ daypicker-monthday {
|
|||
padding: 0px;
|
||||
}
|
||||
|
||||
dialog[systemcolors] .addressingWidgetCell {
|
||||
border-bottom: 1px solid ThreeDShadow;
|
||||
}
|
||||
|
||||
.addressingWidgetCell:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.dummy-row-cell:first-child {
|
||||
border-top: none;
|
||||
border-bottom: 1px solid #CACAFF;
|
||||
}
|
||||
|
||||
.person-icon {
|
||||
|
|
Загрузка…
Ссылка в новой задаче