378172-[Proto] Recurrence dialog: datepickers need a facelift;r=mickey
git-svn-id: svn://10.0.0.236/trunk@238241 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -9,6 +9,7 @@ calendar.jar:
|
||||
content/calendar/calendar-alarm-widget.xml (content/calendar-alarm-widget.xml)
|
||||
content/calendar/calendar-attendee-list.xml (content/calendar-attendee-list.xml)
|
||||
content/calendar/calendar-calendars-list.xul (content/calendar-calendars-list.xul)
|
||||
content/calendar/calendar-daypicker.xml (content/calendar-daypicker.xml)
|
||||
content/calendar/calendar-decorated-base.xml (content/calendar-decorated-base.xml)
|
||||
content/calendar/calendar-decorated-multiday-base-view.xml (content/calendar-decorated-multiday-base-view.xml)
|
||||
content/calendar/calendar-decorated-day-view.xml (content/calendar-decorated-day-view.xml)
|
||||
@@ -62,8 +63,6 @@ calendar.jar:
|
||||
content/calendar/sun-calendar-event-dialog-freebusy.xml (/calendar/prototypes/wcap/sun-calendar-event-dialog-freebusy.xml)
|
||||
content/calendar/sun-calendar-event-dialog-recurrence.xul (/calendar/prototypes/wcap/sun-calendar-event-dialog-recurrence.xul)
|
||||
content/calendar/sun-calendar-event-dialog-recurrence.js (/calendar/prototypes/wcap/sun-calendar-event-dialog-recurrence.js)
|
||||
content/calendar/sun-calendar-event-dialog-recurrence-daypicker.css (/calendar/prototypes/wcap/sun-calendar-event-dialog-recurrence-daypicker.css)
|
||||
content/calendar/sun-calendar-event-dialog-recurrence-daypicker.xml (/calendar/prototypes/wcap/sun-calendar-event-dialog-recurrence-daypicker.xml)
|
||||
content/calendar/sun-calendar-event-dialog-recurrence-preview.xml (/calendar/prototypes/wcap/sun-calendar-event-dialog-recurrence-preview.xml)
|
||||
content/calendar/sun-calendar-event-dialog-reminder.js (/calendar/prototypes/wcap/sun-calendar-event-dialog-reminder.js)
|
||||
content/calendar/sun-calendar-event-dialog-reminder.xul (/calendar/prototypes/wcap/sun-calendar-event-dialog-reminder.xul)
|
||||
@@ -74,6 +73,7 @@ calendar.jar:
|
||||
% skin calendar classic/1.0 %skin/classic/calendar/
|
||||
skin/classic/calendar/abcard.png (themes/common/abcard.png)
|
||||
#expand skin/classic/calendar/cal-icon32.png (themes/__THEME__/cal-icon32.png)
|
||||
#expand skin/classic/calendar/daypicker-background.png (/calendar/base/themes/common/daypicker-background.png)
|
||||
#expand skin/classic/calendar/calendar-toolbar.css (themes/__THEME__/calendar-toolbar.css)
|
||||
#expand skin/classic/calendar/today-pane.css (themes/__THEME__/today-pane.css)
|
||||
#expand skin/classic/calendar/calendar-event-dialog.css (themes/__THEME__/calendar-event-dialog.css)
|
||||
@@ -83,6 +83,7 @@ calendar.jar:
|
||||
#expand skin/classic/calendar/toolbar-small.png (themes/__THEME__/toolbar-small.png)
|
||||
#expand skin/classic/calendar/mode-switch-icons.png (themes/__THEME__/mode-switch-icons.png)
|
||||
#expand skin/classic/calendar/calendar-management.css (themes/__THEME__/calendar-management.css)
|
||||
#expand skin/classic/calendar/calendar-daypicker.css (themes/__THEME__/calendar-daypicker.css)
|
||||
skin/classic/calendar/event-grippy-bottom.png (themes/common/event-grippy-bottom.png)
|
||||
skin/classic/calendar/event-grippy-left.png (themes/common/event-grippy-left.png)
|
||||
skin/classic/calendar/event-grippy-right.png (themes/common/event-grippy-right.png)
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Sun Microsystems code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Sun Microsystems
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Michael Buettner <michael.buettner@sun.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
.daypicker-weekday-mainbox {
|
||||
background-color: #FFFFFF;
|
||||
border: 1px outset #FFFFFF;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.daypicker-monthday-mainbox {
|
||||
background-color: #FFFFFF;
|
||||
border: 1px outset #FFFFFF;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.daypicker-box {
|
||||
font-family: Arial;
|
||||
border: 1px solid transparent;
|
||||
text-align: center;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.daypicker-box:hover {
|
||||
cursor: pointer;
|
||||
border: 1px solid Highlight;
|
||||
}
|
||||
|
||||
.daypicker-box[selected="true"] {
|
||||
background-color: Highlight;
|
||||
color: HighlightText;
|
||||
}
|
||||
|
||||
.daypicker-box[othermonth="true"] {
|
||||
font-family: Arial;
|
||||
border: 1px solid transparent;
|
||||
text-align: center;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.daypicker-box[disabled="true"] {
|
||||
color: GrayText !important;
|
||||
border: 1px solid transparent;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.daypicker-row {
|
||||
}
|
||||
@@ -1,308 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- The contents of this file are subject to the Mozilla Public License Version
|
||||
- 1.1 (the "License"); you may not use this file except in compliance with
|
||||
- the License. You may obtain a copy of the License at
|
||||
- http://www.mozilla.org/MPL/
|
||||
-
|
||||
- Software distributed under the License is distributed on an "AS IS" basis,
|
||||
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
- for the specific language governing rights and limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is Sun Microsystems code.
|
||||
-
|
||||
- The Initial Developer of the Original Code is Sun Microsystems.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2006
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Michael Buettner <michael.buettner@sun.com>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
- in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
- of those above. If you wish to allow use of your version of this file only
|
||||
- under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
- use your version of this file under the terms of the MPL, indicate your
|
||||
- decision by deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this file under
|
||||
- the terms of any one of the MPL, the GPL or the LGPL.
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<!--
|
||||
########################################################################
|
||||
## daypicker-box
|
||||
########################################################################
|
||||
-->
|
||||
|
||||
<binding id="daypicker-box" extends="xul:text">
|
||||
<handlers>
|
||||
<handler event="click" action="if (event.button == 0) this.calendar.dayClicked(this)"/>
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
<!--
|
||||
########################################################################
|
||||
## daypicker-weekday
|
||||
########################################################################
|
||||
-->
|
||||
|
||||
<binding id="daypicker-weekday" extends="xul:box">
|
||||
<resources>
|
||||
<stylesheet src="chrome://calendar/content/sun-calendar-event-dialog-recurrence-daypicker.css"/>
|
||||
</resources>
|
||||
|
||||
<content>
|
||||
<xul:hbox anonid="mainbox" class="daypicker-weekday-mainbox" equalsize="always" flex="1">
|
||||
<xul:text class="daypicker-box" flex="1"/>
|
||||
<xul:text class="daypicker-box" flex="1"/>
|
||||
<xul:text class="daypicker-box" flex="1"/>
|
||||
<xul:text class="daypicker-box" flex="1"/>
|
||||
<xul:text class="daypicker-box" flex="1"/>
|
||||
<xul:text class="daypicker-box" flex="1"/>
|
||||
<xul:text class="daypicker-box" flex="1"/>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
|
||||
<implementation>
|
||||
<!--
|
||||
The weekday-picker manages an array of selected days of the week and
|
||||
the 'days' property is the interface to this array. the expected argument is
|
||||
an array containing integer elements, where each element represents a selected
|
||||
day of the week, starting with SUNDAY=1.
|
||||
-->
|
||||
<property name="days">
|
||||
<setter><![CDATA[
|
||||
var mainbox =
|
||||
document.getAnonymousElementByAttribute(
|
||||
this, "anonid", "mainbox");
|
||||
var numChilds = mainbox.childNodes.length;
|
||||
for (var i = 0; i < numChilds; i++) {
|
||||
var child = mainbox.childNodes[i];
|
||||
child.removeAttribute("selected");
|
||||
}
|
||||
for (i = 0; i < val.length; i++) {
|
||||
var index = val[i] - 1 - this.weekStartOffset;
|
||||
if (index < 0) {
|
||||
index += 7;
|
||||
}
|
||||
mainbox.childNodes[index].setAttribute("selected", "true");
|
||||
}
|
||||
return val;
|
||||
]]></setter>
|
||||
<getter><![CDATA[
|
||||
var mainbox =
|
||||
document.getAnonymousElementByAttribute(
|
||||
this, "anonid", "mainbox");
|
||||
var numChilds = mainbox.childNodes.length;
|
||||
var days = [];
|
||||
for (var i = 0; i < numChilds; i++) {
|
||||
var child = mainbox.childNodes[i];
|
||||
if (child.hasAttribute("selected")) {
|
||||
var index = i + this.weekStartOffset;
|
||||
if (index >= 7)
|
||||
index -= 7;
|
||||
days.push(index + 1);
|
||||
}
|
||||
}
|
||||
return days;
|
||||
]]></getter>
|
||||
</property>
|
||||
|
||||
<constructor><![CDATA[
|
||||
var pb2 = Components.classes[
|
||||
"@mozilla.org/preferences-service;1"]
|
||||
.getService(
|
||||
Components.interfaces.nsIPrefBranch2);
|
||||
this.weekStartOffset = 0;
|
||||
try {
|
||||
this.weekStartOffset =
|
||||
pb2.getIntPref("calendar.week.start");
|
||||
} catch (ex) {
|
||||
}
|
||||
var sbs = Components.classes[
|
||||
"@mozilla.org/intl/stringbundle;1"]
|
||||
.getService(
|
||||
Components.interfaces.nsIStringBundleService);
|
||||
var props =
|
||||
sbs.createBundle(
|
||||
"chrome://calendar/locale/dateFormat.properties");
|
||||
var mainbox =
|
||||
document.getAnonymousElementByAttribute(
|
||||
this, "anonid", "mainbox");
|
||||
var numChilds = mainbox.childNodes.length;
|
||||
for (var i = 0; i < numChilds; i++) {
|
||||
var child = mainbox.childNodes[i];
|
||||
var dow = i + this.weekStartOffset;
|
||||
if (dow >= 7) {
|
||||
dow -= 7;
|
||||
}
|
||||
var day = props.GetStringFromName("day." + (dow + 1) + ".Mmm");
|
||||
child.setAttribute("value", day);
|
||||
child.calendar = this;
|
||||
}
|
||||
]]></constructor>
|
||||
|
||||
<method name="dayClicked">
|
||||
<parameter name="aDay"/>
|
||||
<body><![CDATA[
|
||||
if (aDay.hasAttribute("selected")) {
|
||||
aDay.removeAttribute("selected");
|
||||
} else {
|
||||
aDay.setAttribute("selected", "true");
|
||||
}
|
||||
var event = document.createEvent('Events');
|
||||
event.initEvent('select', true, true);
|
||||
this.dispatchEvent(event);
|
||||
]]></body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
<!--
|
||||
########################################################################
|
||||
## daypicker-monthday
|
||||
########################################################################
|
||||
-->
|
||||
|
||||
<binding id="daypicker-monthday" extends="xul:box">
|
||||
<resources>
|
||||
<stylesheet src="chrome://calendar/content/sun-calendar-event-dialog-recurrence-daypicker.css"/>
|
||||
</resources>
|
||||
|
||||
<content>
|
||||
<xul:vbox anonid="mainbox" class="daypicker-monthday-mainbox" equalsize="always" flex="1">
|
||||
<xul:hbox class="daypicker-row" equalsize="always">
|
||||
<xul:text class="daypicker-box" flex="1" value="1" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="2" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="3" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="4" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="5" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="6" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="7" xbl:inherits="disabled"/>
|
||||
</xul:hbox>
|
||||
<xul:hbox class="daypicker-row" equalsize="always">
|
||||
<xul:text class="daypicker-box" flex="1" value="8" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="9" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="10" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="11" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="12" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="13" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="14" xbl:inherits="disabled"/>
|
||||
</xul:hbox>
|
||||
<xul:hbox class="daypicker-row" equalsize="always">
|
||||
<xul:text class="daypicker-box" flex="1" value="15" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="16" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="17" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="18" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="19" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="20" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="21" xbl:inherits="disabled"/>
|
||||
</xul:hbox>
|
||||
<xul:hbox class="daypicker-row" equalsize="always">
|
||||
<xul:text class="daypicker-box" flex="1" value="22" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="23" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="24" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="25" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="26" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="27" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="28" xbl:inherits="disabled"/>
|
||||
</xul:hbox>
|
||||
<xul:hbox class="daypicker-row" equalsize="always">
|
||||
<xul:text class="daypicker-box" flex="1" value="29" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="30" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" value="31" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" othermonth="true" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" othermonth="true" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" othermonth="true" xbl:inherits="disabled"/>
|
||||
<xul:text class="daypicker-box" flex="1" othermonth="true" xbl:inherits="disabled"/>
|
||||
</xul:hbox>
|
||||
</xul:vbox>
|
||||
</content>
|
||||
|
||||
<implementation>
|
||||
<property name="days">
|
||||
<setter><![CDATA[
|
||||
var mainbox =
|
||||
document.getAnonymousElementByAttribute(
|
||||
this, "anonid", "mainbox");
|
||||
var numRows = mainbox.childNodes.length;
|
||||
var days = [];
|
||||
for (var i = 0; i < numRows; i++) {
|
||||
var row = mainbox.childNodes[i];
|
||||
var numChilds = row.childNodes.length;
|
||||
for (var j = 0; j < numChilds; j++) {
|
||||
var child = row.childNodes[j];
|
||||
child.removeAttribute("selected");
|
||||
days.push(child);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < val.length; i++) {
|
||||
days[val[i] - 1].setAttribute("selected", "true");
|
||||
}
|
||||
return val;
|
||||
]]></setter>
|
||||
<getter><![CDATA[
|
||||
var mainbox =
|
||||
document.getAnonymousElementByAttribute(
|
||||
this, "anonid", "mainbox");
|
||||
var numRows = mainbox.childNodes.length;
|
||||
var days = [];
|
||||
for (var i = 0; i < numRows; i++) {
|
||||
var row = mainbox.childNodes[i];
|
||||
var numChilds = row.childNodes.length;
|
||||
for (var j = 0; j < numChilds; j++) {
|
||||
var child = row.childNodes[j];
|
||||
if (child.hasAttribute("selected")) {
|
||||
days.push(Number(child.getAttribute("value")));
|
||||
}
|
||||
}
|
||||
}
|
||||
return days;
|
||||
]]></getter>
|
||||
</property>
|
||||
|
||||
<constructor><![CDATA[
|
||||
var mainbox =
|
||||
document.getAnonymousElementByAttribute(
|
||||
this, "anonid", "mainbox");
|
||||
var numRows = mainbox.childNodes.length;
|
||||
for (var i = 0; i < numRows; i++) {
|
||||
var row = mainbox.childNodes[i];
|
||||
var numChilds = row.childNodes.length;
|
||||
for (var j = 0; j < numChilds; j++) {
|
||||
var child = row.childNodes[j];
|
||||
child.calendar = this;
|
||||
}
|
||||
}
|
||||
]]></constructor>
|
||||
|
||||
<method name="dayClicked">
|
||||
<parameter name="aDay"/>
|
||||
<body><![CDATA[
|
||||
if (!aDay.hasAttribute("disabled") ||
|
||||
!aDay.getAttribute("disabled")) {
|
||||
if (aDay.hasAttribute("selected")) {
|
||||
aDay.removeAttribute("selected");
|
||||
} else {
|
||||
aDay.setAttribute("selected", "true");
|
||||
}
|
||||
}
|
||||
var event = document.createEvent('Events');
|
||||
event.initEvent('select', true, true);
|
||||
this.dispatchEvent(event);
|
||||
]]></body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
</bindings>
|
||||
@@ -53,17 +53,15 @@ label.label {
|
||||
/****************************************************************************************/
|
||||
|
||||
daypicker-weekday {
|
||||
-moz-binding: url(chrome://calendar/content/sun-calendar-event-dialog-recurrence-daypicker.xml#daypicker-weekday);
|
||||
-moz-binding: url(chrome://calendar/content/calendar-daypicker.xml#daypicker-weekday);
|
||||
-moz-user-focus: normal;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
daypicker-monthday {
|
||||
-moz-binding: url(chrome://calendar/content/sun-calendar-event-dialog-recurrence-daypicker.xml#daypicker-monthday);
|
||||
-moz-binding: url(chrome://calendar/content/calendar-daypicker.xml#daypicker-monthday);
|
||||
-moz-user-focus: normal;
|
||||
}
|
||||
|
||||
.daypicker-box {
|
||||
-moz-binding: url(chrome://calendar/content/sun-calendar-event-dialog-recurrence-daypicker.xml#daypicker-box);
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
recurrence-preview {
|
||||
|
||||
Reference in New Issue
Block a user