Bug 432224 - Remove more obsolete event dialog files. patch=mschroeder r=sipaq

git-svn-id: svn://10.0.0.236/trunk@251424 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mschroeder%mozilla.x-home.org 2008-05-08 22:00:54 +00:00
parent 65aaca746b
commit cc5993f9ee
11 changed files with 7 additions and 1198 deletions

View File

@ -1,362 +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 Calendar attendee code.
-
- The Initial Developer of the Original Code is
- Mozilla Corp
- Portions created by the Initial Developer are Copyright (C) 2006
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Joey Minta <jminta@gmail.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 id="calendar-attendee-bindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="calendar-attendee-list"
extends="chrome://global/content/bindings/richlistbox.xml#richlistbox" xbl:inherits="flex">
<implementation>
<!-- The listitem that is currently blank. (There should always be one
- and only one.)
-->
<field name="mBlankAttendee">null</field>
<!-- we should ignore focus events during this -->
<field name="mLoading">null</field>
<!-- An array of calIAttendees objects-->
<property name="attendees">
<getter><![CDATA[
var atts = new Array();
for (var i = 0; i < this.childNodes.length; i++) {
// Filter out blank rows, which have null ids.
if (this.childNodes[i].attendee.id) {
atts.push(this.childNodes[i].attendee);
}
}
return atts;
]]></getter>
<setter><![CDATA[
this.mLoading = true;
while (this.lastChild) {
this.removeChild(this.lastChild);
}
for each (att in val) {
this.addAttendee(att);
}
// Add our blank attendee
this.addAttendee(null, true);
this.mLoading = false;
return val;
]]></setter>
</property>
<!-- Called to add a new row to the listbox. If aAttendee is non-null
- then we will populate the textbox of that row with that attendee's
- information. if it is null, we simply create a blank textbox. If
- aDontFocus is false (or null/undefined) then we will also focus
- the box we create.
-->
<method name="addAttendee">
<parameter name="aAttendee"/>
<parameter name="aDontFocus"/>
<body><![CDATA[
if (!aAttendee && this.mBlankAttendee) {
this.mBlankAttendee.focusText();
return;
}
var attElem = document.createElement("calendar-attendee-item");
this.appendChild(attElem);
if (aAttendee) {
attElem.attendee = aAttendee;
} else {
attElem.attendee = Components.classes["@mozilla.org/calendar/attendee;1"]
.createInstance(Components.interfaces.calIAttendee);
this.mBlankAttendee = attElem;
}
if (!aDontFocus) {
attElem.focusText();
}
]]></body>
</method>
<!-- Removes the row in the listbox whose attendee has the same id as
- aAttendee
-->
<method name="removeAttendee">
<parameter name="aAttendee"/>
<body><![CDATA[
for (var i = this.childNodes.length; i >= 0; i--) {
if (this.childNodes[i].id == aAttendee.id) {
this.removeChild(this.childNodes[i]);
}
}
]]></body>
</method>
<!-- Call this if you are in doubt about whether or not there is still
- a blank row in the listbox. (There should always be one, so that
- a user can easily add a new attendee.) If there isn't such a row
- this function will add it for you.
-->
<method name="checkBlankAttendee">
<parameter name="aDontFocus"/>
<body><![CDATA[
if (this.mLoading) {
return;
}
var blankAtts = new Array();
for (var i = 0; i < this.childNodes.length; i++) {
if (!this.childNodes[i].attendee.id) {
blankAtts.push(this.childNodes[i]);
}
}
if (blankAtts.length == 0) {
// add a new blank attendee
this.mBlankAttendee = null;
this.addAttendee(null, aDontFocus);
} else if (blankAtts.length > 1) {
for (var i = 1; i < blankAtts.length; i++) {
this.removeChild(blankAtts[i]);
}
this.mBlankAttendee = blankAtts[0];
}
]]></body>
</method>
</implementation>
</binding>
<binding id="calendar-attendee-item"
extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
<content>
<xul:hbox align="center" flex="1">
<xul:textbox anonid="attendee-textbox" flex="1"
class="attendee-textbox"
oninput="adjustId(this.value)"
onkeypress="checkEnter(event)"/>
</xul:hbox>
</content>
<implementation>
<!-- This is a list of objects corresponding to the event listeners that
- we're going to add to the textbox. We need references to them so
- that we can remove them later.
-->
<field name="mListenerMap">null</field>
<field name="mAttendee">null</field>
<field name="mShowingInstructions">false</field>
<constructor><![CDATA[
var textbox = document.getAnonymousElementByAttribute(this, "anonid", "attendee-textbox");
// It should come as no surprise to everyone familiar with mozilla that
// focus code sucks. Work around some scoping tricks here. (Listening
// for an event gives you a |this| object that corresponds to the
// textbox, not the richlistitem, so things like mShowingInstructions
// will be undefined, which is bad.)
var attElem = this;
// The first time we get focus, gecko actually sends us a focus *and*
// a blur event, which is really bad. This is a horrible hack to fix
// that.
var ignoreFirst = true;
function clear() {
attElem.clearInstructions.call(attElem);
}
function show() {
if (ignoreFirst) {
ignoreFirst = false;
// Ending up here is very very bad. It means the textbox has
// been blurred! Refocus, after the app has time to get its
// head on straight.
function reFocus() {
textbox.focus();
}
setTimeout(reFocus, 0);
return;
}
attElem.showInstructions.call(attElem);
attElem.finishTyping.call(attElem);
}
this.mListenerMap = [{event:"focus", func: clear},
{event:"blur", func: show}];
for each (var listener in this.mListenerMap) {
textbox.addEventListener(listener.event, listener.func, true);
}
]]></constructor>
<destructor><![CDATA[
var textbox = document.getAnonymousElementByAttribute(this, "anonid", "attendee-textbox");
for each (var listener in this.mListenerMap) {
textbox.removeEventListener(listener.event, listener.func, true);
}
]]></destructor>
<!-- The calIAttendee object associated with this listitem -->
<property name="attendee">
<getter><![CDATA[
return this.mAttendee;
]]></getter>
<setter><![CDATA[
var textbox = document.getAnonymousElementByAttribute(this, "anonid", "attendee-textbox");
if (val.id) {
if (val.id.toLowerCase().substr(0, 7) == "mailto:") {
textbox.value = val.id.toLowerCase().split("mailto:")[1];
} else {
textbox.value = val.id;
}
} else {
this.showInstructions();
}
var myAttendee;
if (!val.isMutable) {
myAttendee = val.clone();
} else {
myAttendee = val;
}
this.mAttendee = myAttendee;
return val;
]]></setter>
</property>
<!-- check whether the latest keypress is 'enter', and if so, move to the
- next row.
-->
<method name="checkEnter">
<parameter name="aEvent"/>
<body><![CDATA[
var textbox = document.getAnonymousElementByAttribute(this, "anonid", "attendee-textbox");
this.adjustId(textbox.value);
// Go to the next attendee on enter
if (aEvent.keyCode != Components.interfaces.nsIDOMKeyEvent.DOM_VK_RETURN) {
return;
}
// Don't let the outer dialog that we're likely contained in close.
aEvent.preventDefault();
// Focus the next listitem
document.commandDispatcher.advanceFocus();
]]></body>
</method>
<!-- Set the id of the calIAttendee object associated with this listitem
- according to the current textbox value.
-->
<method name="adjustId">
<parameter name="aValue"/>
<body><![CDATA[
if (!aValue || aValue == "") {
this.mAttendee.id = null;
return;
}
if (aValue.toLowerCase().indexOf("mailto:") == -1) {
aValue = "mailto:"+aValue;
}
this.mAttendee.id = aValue;
this.finishTyping();
]]></body>
</method>
<!-- Focus the textbox of this item -->
<method name="focusText">
<body><![CDATA[
var textbox = document.getAnonymousElementByAttribute(this, "anonid", "attendee-textbox");
textbox.focus();
]]></body>
</method>
<!-- Call this to when the user is no longer typing in the textbox. If
- the textbox is blank, we'll restore the original grey instructions.
-->
<method name="showInstructions">
<body><![CDATA[
if (this.mShowingInstructions) {
return;
}
var textbox = document.getAnonymousElementByAttribute(this, "anonid", "attendee-textbox");
if (textbox.value && textbox.value != "") {
return;
}
this.mShowingInstructions = true;
textbox.value = calGetString("calendar", "attendeeInstructions");
textbox.setAttribute("instructions", "true");
]]></body>
</method>
<!-- Call this when a user starts paying attention to this textbox.
- (onfocus). We'll remove the grey instructions so they can type.
-->
<method name="clearInstructions">
<body><![CDATA[
if (!this.mShowingInstructions || this.mAttendee.id) {
return;
}
var textbox = document.getAnonymousElementByAttribute(this, "anonid", "attendee-textbox");
textbox.value = "";
textbox.removeAttribute("instructions");
// It's important that we don't set this until here, since setting the
// the textbox's value actually focuses it.
this.mShowingInstructions = false;
]]></body>
</method>
<!-- Called when a user stops caring about this textbox (onblur) to check
- if we're still blank or not, and update the entire list as needed.
-->
<method name="finishTyping">
<parameter name="aDontFocus"/>
<body><![CDATA[
if (aDontFocus == undefined) {
aDontFocus = true;
}
// Mild assumption about our place in the DOM
this.parentNode.checkBlankAttendee(aDontFocus);
]]></body>
</method>
</implementation>
</binding>
</bindings>

View File

@ -1,58 +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 Calendar view code.
*
* The Initial Developer of the Original Code is
* Oracle Corporation
* Portions created by the Initial Developer are Copyright (C) 2005
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Stuart Parmenter <stuart.parmenter@oracle.com>
* Joey Minta <jminta@gmail.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 ***** */
calendar-attendee-list {
-moz-binding: url(chrome://calendar/content/calendar-attendee-list.xml#calendar-attendee-list);
background: white;
-moz-user-focus: normal;
-moz-margin-start: 2px;
border: 1px solid black;
}
calendar-attendee-item {
-moz-binding: url(chrome://calendar/content/calendar-attendee-list.xml#calendar-attendee-item);
-moz-user-focus: normal;
}
.attendee-textbox[instructions="true"] {
color: grey;
}
.warning-text-class {
color : red;
}

View File

@ -1,394 +0,0 @@
/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** 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 Oracle Corporation code.
*
* The Initial Developer of the Original Code is Oracle Corporation
* Portions created by the Initial Developer are Copyright (C) 2005
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Stuart Parmenter <stuart.parmenter@oracle.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 ***** */
/* dialog stuff */
function onLoad()
{
var args = window.arguments[0];
window.onAcceptCallback = args.onOk;
window.calendarEvent = args.calendarEvent;
window.originalRecurrenceInfo = args.recurrenceInfo;
window.startDate = args.startDate;
loadDialog();
updateDeck();
updateDuration();
updateAccept();
opener.setCursor("auto");
self.focus();
}
function onAccept()
{
var event = window.calendarEvent;
var recurrenceInfo = saveDialog();
window.onAcceptCallback(recurrenceInfo);
return true;
}
function onCancel()
{
}
function loadDialog()
{
// Start with setting some labels, that depend on the (start)date of the item
// Those labels are for the monthly recurrence deck.
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService);
var props = sbs.createBundle("chrome://calendar/locale/dateFormat.properties");
// Set label to '15th day of the month'
var nthstr = props.GetStringFromName("ordinal.suffix."+window.startDate.day);
var str = props.formatStringFromName("recurNthDay", [window.startDate.day, nthstr], 2);
document.getElementById("monthly-nth-day").label = str;
// Set label to 'second week of the month'
// Note that the date here needs to be 0 based to work properly
var monthWeekNum = Math.floor((window.startDate.day - 1) / 7) + 1;
// In order to remain somewhat sane for l10n, turns a number into a word
var numWordMap = ["", "first", "second", "third", "fourth", "fifth"];
var numDayMap = ["sunday", "monday", "tuesday", "wednesday",
"thursday", "friday", "saturday"];
str = calGetString("dateFormat",
"recur." + numWordMap[monthWeekNum] + "." +
numDayMap[window.startDate.weekday]);
document.getElementById("monthly-nth-week").label = str;
// Set two values needed to create the real rrule later
document.getElementById("monthly-nth-week").day = window.startDate.weekday;
document.getElementById("monthly-nth-week").week = monthWeekNum;
// If this is the last friday of the month, set label to 'last friday of the month'
// (Or any other day, ofcourse.) Otherwise, hide last option
var monthLength = window.startDate.endOfMonth.day;
var isLastWeek = (monthLength - window.startDate.day) < 7;
document.getElementById("monthly-last-week").hidden = !isLastWeek;
var isLastDay = (monthLength == window.startDate.day);
document.getElementById("monthly-last-day").hidden = !isLastDay;
if (isLastWeek) {
str = calGetString("dateFormat", "recur.last." + numDayMap[window.startDate.weekday]);
document.getElementById("monthly-last-week").label = str;
}
document.getElementById("monthly-last-week").day = window.startDate.weekday;
if (!window.originalRecurrenceInfo)
return;
/* split out rules and exceptions */
var rrules = splitRecurrenceRules(window.originalRecurrenceInfo);
var rules = rrules[0];
var exceptions = rrules[1];
/* deal with the rules */
if (rules.length > 0) {
// we only handle 1 rule currently
var rule = rules[0];
if (rule instanceof Components.interfaces.calIRecurrenceRule) {
switch(rule.type) {
case "DAILY":
document.getElementById("period-list").selectedIndex = 0;
setElementValue("daily-days", rule.interval);
break;
case "WEEKLY":
document.getElementById("period-list").selectedIndex = 1;
setElementValue("weekly-weeks", rule.interval);
const byDayTable = { 1 : "sun", 2 : "mon", 3 : "tue", 4 : "wed",
5 : "thu", 6 : "fri", 7: "sat" };
for each (var i in rule.getComponent("BYDAY", {})) {
setElementValue("weekly-" + byDayTable[i], "true", "checked");
}
break;
case "MONTHLY":
document.getElementById("period-list").selectedIndex = 2;
// XXX This code ignores a lot of monthly recurrence rules that
// can come in from external sources. There just is no UI to
// show them
setElementValue("monthly-months", rule.interval);
var days = rule.getComponent("BYMONTHDAY", {});
if (days.length > 0 && days[0]) {
if (days[0] == -1) {
calRadioGroupSelectItem("monthly-type", "monthly-last-day");
} else {
calRadioGroupSelectItem("monthly-type", "monthly-nth-day");
}
}
days = rule.getComponent("BYDAY", {}) ;
if (days.length > 0 && days[0] > 0) {
calRadioGroupSelectItem("monthly-type", "monthly-nth-week");
}
if (days.length > 0 && days[0] < 0) {
calRadioGroupSelectItem("monthly-type", "monthly-last-week");
}
break;
case "YEARLY":
document.getElementById("period-list").selectedIndex = 3;
break;
default:
dump("unable to handle your rule type!\n");
break;
}
/* load up the duration of the event radiogroup */
if (rule.isByCount) {
if (rule.count == -1) {
setElementValue("recurrence-duration", "forever");
} else {
setElementValue("recurrence-duration", "ntimes");
setElementValue("repeat-ntimes-count", rule.count );
}
} else {
var endDate = rule.endDate;
if (!endDate) {
setElementValue("recurrence-duration", "forever");
} else {
// rule.endDate is a floating datetime, however per RFC2445
// it must be in UTC. Since we want the datepicker to show
// the date based on our _local_ timezone, we must first
// "pin" the floating datetime to UTC, and then convert
// from UTC to our local timezone. We _can't_ simply
// convert directly from floating to our local timezone.
endDate = endDate.getInTimezone("UTC");
endDate = endDate.getInTimezone(calendarDefaultTimezone());
setElementValue("recurrence-duration", "until");
setElementValue("repeat-until-date", endDate.jsDate);
}
}
}
}
}
function saveDialog()
{
// This works, but if we ever support more complex recurrence,
// e.g. recurrence for Martians, then we're going to want to
// not clone and just recreate the recurrenceInfo each time.
// The reason is that the order of items (rules/dates/datesets)
// matters, so we can't always just append at the end. This
// code here always inserts a rule first, because all our
// exceptions should come afterward.
var deckNumber = Number(getElementValue("period-list"));
var recurrenceInfo = null;
if (window.originalRecurrenceInfo) {
recurrenceInfo = window.originalRecurrenceInfo.clone();
var rrules = splitRecurrenceRules(recurrenceInfo);
if (rrules[0].length > 0)
recurrenceInfo.deleteRecurrenceItem(rrules[0][0]);
} else {
recurrenceInfo = createRecurrenceInfo(window.calendarEvent);
}
var recRule = createRecurrenceRule();
switch (deckNumber) {
case 0:
recRule.type = "DAILY";
var ndays = Number(getElementValue("daily-days"));
recRule.interval = ndays;
break;
case 1:
recRule.type = "WEEKLY";
recRule.interval = getElementValue("weekly-weeks");
var onDays = [];
["sun", "mon", "tue", "wed", "thu", "fri", "sat"].
forEach(function(d)
{
var elem = document.getElementById("weekly-" + d);
if (elem.checked) {
onDays.push(elem.getAttribute("value"));
}
});
if (onDays.length > 0)
recRule.setComponent("BYDAY", onDays.length, onDays);
break;
case 2:
recRule.type = "MONTHLY";
recRule.interval = getElementValue("monthly-months");
var recurtype = getElementValue("monthly-type");
switch (recurtype) {
case "nth-day":
recRule.setComponent("BYMONTHDAY", 1, [window.startDate.day]);
break;
case "nth-week":
var el = document.getElementById('monthly-nth-week');
// For more info on where this magic formula comes from, see icalrecur.c,
// icalrecurrencetype_day_day_of_week()
recRule.setComponent("BYDAY", 1, [el.week*8 + el.day+1]);
break;
case "last-week":
el = document.getElementById('monthly-last-week');
recRule.setComponent("BYDAY", 1, [(-1)*(8+Number(el.day)+1)]);
break;
case "last-day":
recRule.setComponent("BYMONTHDAY", 1, [-1]);
break;
}
break;
case 3:
recRule.type = "YEARLY";
var nyears = Number(getElementValue("yearly-years"));
if (nyears == "")
nyears = 1;
recRule.interval = nyears;
break;
}
/* figure out how long this event is supposed to last */
switch(document.getElementById("recurrence-duration").selectedItem.value) {
case "forever":
recRule.count = -1;
break;
case "ntimes":
recRule.count = Math.max(1, getElementValue("repeat-ntimes-count"));
break;
case "until":
// get the datetime from the control (which is in localtime),
// set the time to 23:59:99 and convert that to UTC time.
var endDate = getElementValue("repeat-until-date")
endDate.setHours(23);
endDate.setMinutes(59);
endDate.setSeconds(59);
endDate.setMilliseconds(999);
endDate = jsDateToDateTime(endDate);
recRule.endDate = endDate;
break;
}
recurrenceInfo.insertRecurrenceItemAt(recRule, 0);
return recurrenceInfo;
}
function updateDeck()
{
document.getElementById("period-deck").selectedIndex = Number(getElementValue("period-list"));
updateAccept();
}
function updateDuration()
{
var durationSelection = document.getElementById("recurrence-duration").selectedItem.value;
if (durationSelection == "forever") {
}
if (durationSelection == "ntimes") {
setElementValue("repeat-ntimes-count", false, "disabled");
} else {
setElementValue("repeat-ntimes-count", "true", "disabled");
}
if (durationSelection == "until") {
setElementValue("repeat-until-date", false, "disabled");
} else {
setElementValue("repeat-until-date", "true", "disabled");
}
}
function updateAccept()
{
var acceptButton = document.getElementById("calendar-recurrence-dialog").getButton("accept");
acceptButton.removeAttribute("disabled", "true");
document.getElementById("repeat-interval-warning").setAttribute("hidden", true);
document.getElementById("repeat-numberoftimes-warning").setAttribute("hidden", true);
var interval;
switch (Number(getElementValue("period-list"))) {
case 0: // daily
interval = Number(getElementValue("daily-days"));
break;
case 1: // weekly
interval = Number(getElementValue("weekly-weeks"));
break;
case 2: // monthly
interval = Number(getElementValue("monthly-months"));
break;
case 3: // yearly
interval = Number(getElementValue("yearly-years"));
break;
}
if (interval == "" || interval < 1) {
document.getElementById("repeat-interval-warning").removeAttribute("hidden");
acceptButton.setAttribute("disabled", "true");
}
if (document.getElementById("recurrence-duration").selectedItem.value == "ntimes") {
var ntimes = getElementValue("repeat-ntimes-count");
if (ntimes == "" || ntimes < 1) {
document.getElementById("repeat-numberoftimes-warning").removeAttribute("hidden");
acceptButton.setAttribute("disabled", "true");
}
}
this.sizeToContent();
}
function splitRecurrenceRules(recurrenceInfo)
{
var ritems = recurrenceInfo.getRecurrenceItems({});
var rules = [];
var exceptions = [];
for each (var r in ritems) {
if (r.isNegative)
exceptions.push(r);
else
rules.push(r);
}
return [rules, exceptions];
}

View File

@ -1,212 +0,0 @@
<?xml version="1.0"?>
<!-- -*- Mode: xml; indent-tabs-mode: nil; -*- -->
<!--
- ***** 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 calendar views.
-
- The Initial Developer of the Original Code is Oracle Corporation
- Portions created by the Initial Developer are Copyright (C) 2005
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Stuart Parmenter <stuart.parmenter@oracle.com>
- Simon Paquet <bugzilla@babylonsounds.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 ***** -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/content/widgets/calendar-widget-bindings.css" ?>
<?xml-stylesheet href="chrome://calendar/content/calendar-event-dialog.css" type="text/css"?>
<!DOCTYPE dialog
[
<!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
<!ENTITY % calendar-recurrence-dialogDTD SYSTEM "chrome://calendar/locale/calendar-recurrence-dialog.dtd">
%calendar-recurrence-dialogDTD;
]>
<dialog
id="calendar-recurrence-dialog"
title="&newevent.recurrence.title;"
buttons="accept,cancel"
ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();"
onload="onLoad()"
persist="screenX screenY"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://calendar/content/calendar-recurrence-dialog.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendar-dialog-utils.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calUtils.js"/>
<vbox>
<grid flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<label value="&newevent.recurrence.occurs.label;" control="period-list"/>
<menulist id="period-list" oncommand="updateDeck();">
<menupopup>
<menuitem label="&newevent.recurrence.day.label;" value="0"/>
<menuitem label="&newevent.recurrence.week.label;" value="1"/>
<menuitem label="&newevent.recurrence.month.label;" value="2"/>
<menuitem label="&newevent.recurrence.year.label;" value="3"/>
</menupopup>
</menulist>
</row>
<row>
<spacer/>
<label id="repeat-interval-warning"
class="warning-text-class"
value="&newevent.recurinterval.warning;"
hidden="true"/>
</row>
<row>
<spacer/>
<deck id="period-deck">
<!-- Daily -->
<vbox>
<hbox align="center">
<label value="&newevent.recurrence.every.label;" control="daily-days"/>
<textbox id="daily-days" value="1" size="3" oninput="validateIntegerRange(event, 1, 0x7FFF); updateAccept();"/>
<label value="&repeat.units.days;"/>
<spacer flex="1"/>
</hbox>
<spacer flex="1"/>
</vbox>
<!-- Weekly -->
<vbox>
<hbox align="center">
<label value="&newevent.recurrence.every.label;" control="weekly-weeks"/>
<textbox id="weekly-weeks" value="1" size="3"
oninput="validateIntegerRange(event, 1, 0x7FFF); updateAccept();"/>
<label value="&newevent.recurrence.weeks.label;"/>
</hbox>
<hbox>
<vbox>
<checkbox id="weekly-mon" label="&day.2.name;" value="2"/>
<checkbox id="weekly-tue" label="&day.3.name;" value="3"/>
<checkbox id="weekly-wed" label="&day.4.name;" value="4"/>
<checkbox id="weekly-thu" label="&day.5.name;" value="5"/>
</vbox>
<vbox>
<checkbox id="weekly-fri" label="&day.6.name;" value="6"/>
<checkbox id="weekly-sat" label="&day.7.name;" value="7"/>
<checkbox id="weekly-sun" label="&day.1.name;" value="1"/>
</vbox>
</hbox>
</vbox>
<!-- Monthly -->
<vbox>
<hbox align="center">
<label value="&newevent.recurrence.every.label;" control="monthly-months"/>
<textbox id="monthly-months" value="1" size="3"
oninput="validateIntegerRange(event, 1, 0x7FFF); updateAccept();"/>
<label value="&newevent.recurrence.months.label;"/>
</hbox>
<radiogroup id="monthly-type">
<radio id="monthly-nth-day" value="nth-day"/>
<radio id="monthly-nth-week" value="nth-week"/>
<radio id="monthly-last-week" hidden="true" value="last-week"/>
<radio id="monthly-last-day" label="&newevent.recurrence.lastday.label;" hidden="true" value="last-day"/>
</radiogroup>
</vbox>
<!-- Yearly -->
<vbox>
<hbox align="center">
<label value="&newevent.recurrence.every.label;" control="yearly-years"/>
<textbox id="yearly-years" value="1" size="3"
oninput="validateIntegerRange(event, 1, 0x7FFF); updateAccept();"/>
<label value="&repeat.units.years;"/>
<spacer flex="1"/>
</hbox>
<spacer flex="1"/>
</vbox>
</deck>
</row>
</rows>
</grid>
</vbox>
<spacer flex="1"/>
<vbox>
<radiogroup id="recurrence-duration" oncommand="updateDuration()">
<grid flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows equalsize="always">
<row align="center">
<radio label="&newevent.repeat.forever.label;" value="forever" selected="true"/>
<spacer/>
</row>
<row>
<radio label="&newevent.repeat.for.label;" value="ntimes"/>
<hbox align="center">
<textbox id="repeat-ntimes-count" size="3" value="5" oninput="validateIntegerRange(event, 1, 0x7FFF); updateAccept();"/>
<spacer flex="0.5"/>
<label value="&repeat.units.occurrence.both;"/>
<spacer flex="1"/>
</hbox>
</row>
<row>
<radio label="&newevent.repeat.until.label;" value="until"/>
<hbox>
<datepicker id="repeat-until-date" value=""/>
<spacer flex="1"/>
</hbox>
</row>
</rows>
</grid>
</radiogroup>
</vbox>
<spacer flex="1"/>
<hbox>
<label id="repeat-numberoftimes-warning"
class="warning-text-class"
value="&newevent.recurnumberoftimes.warning;"
hidden="true"/>
</hbox>
</dialog>

View File

@ -9,7 +9,6 @@ calendar.jar:
content/calendar/calendar-alarm-snooze-popup.xul (content/calendar-alarm-snooze-popup.xul)
content/calendar/calendar-alarm-snooze-popup.js (content/calendar-alarm-snooze-popup.js)
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-bindings.css (content/calendar-bindings.css)
content/calendar/calendar-calendars-list.xul (content/calendar-calendars-list.xul)
content/calendar/calendar-chrome-startup.js (content/calendar-chrome-startup.js)
@ -25,7 +24,6 @@ calendar.jar:
content/calendar/calendar-decorated-month-view.xml (content/calendar-decorated-month-view.xml)
content/calendar/calendar-dialog-utils.js (content/calendar-dialog-utils.js)
* content/calendar/calendar-dnd-listener.js (content/calendar-dnd-listener.js)
content/calendar/calendar-event-dialog.css (content/calendar-event-dialog.css)
content/calendar/calendar-item-editing.js (content/calendar-item-editing.js)
content/calendar/calendar-month-view.xml (content/calendar-month-view.xml)
content/calendar/calendar-multiday-view.xml (content/calendar-multiday-view.xml)
@ -51,8 +49,6 @@ calendar.jar:
content/calendar/widgets/minimonth.xml (content/widgets/minimonth.xml)
content/calendar/widgets/calendar-widget-bindings.css (content/widgets/calendar-widget-bindings.css)
content/calendar/calendar-minimonth-busy.js (content/calendar-minimonth-busy.js)
content/calendar/calendar-recurrence-dialog.js (content/calendar-recurrence-dialog.js)
content/calendar/calendar-recurrence-dialog.xul (content/calendar-recurrence-dialog.xul)
content/calendar/calendar-view-bindings.css (content/calendar-view-bindings.css)
content/calendar/calendar-view-core.xml (content/calendar-view-core.xml)
content/calendar/calendar-views.js (content/calendar-views.js)

View File

@ -1,59 +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 OEone Calendar Code, released October 31st, 2001.
-
- The Initial Developer of the Original Code is
- OEone Corporation.
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Cédric Corazza <cedric.corazza@wanadoo.fr>
-
- 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 LGPL or the GPL. 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 ***** -->
<!ENTITY newevent.recurrence.occurs.label "Occurs" >
<!ENTITY newevent.recurrence.day.label "daily" >
<!ENTITY newevent.recurrence.week.label "weekly" >
<!ENTITY newevent.recurrence.month.label "monthly" >
<!ENTITY newevent.recurrence.year.label "annually" >
<!ENTITY newevent.recurrence.every.label "Every:" >
<!ENTITY repeat.units.days "Days" >
<!ENTITY newevent.recurrence.weeks.label "weeks on" >
<!ENTITY newevent.recurrence.months.label "months on the" >
<!ENTITY repeat.units.years "Years" >
<!ENTITY newevent.repeat.forever.label "Repeat forever" >
<!ENTITY newevent.repeat.for.label "Repeat for" >
<!ENTITY repeat.units.occurrence.both "occurrence(s)" >
<!ENTITY newevent.repeat.until.label "Repeat until" >
<!-- Information messages -->
<!ENTITY newevent.recurnumberoftimes.warning "You must specify the number of times to repeat.">
<!ENTITY newevent.recurinterval.warning "You must specify how often to repeat.">
<!ENTITY newevent.recurrence.title "Edit Recurrence" >
<!ENTITY newevent.recurrence.lastday.label "Last day of the month" >

View File

@ -319,8 +319,6 @@ categoryReplaceTitle=Warning: Duplicate name
addCategory=Add Category
newCategory=New Category…
attendeeInstructions=email@example.com
today=Today
tomorrow=Tomorrow
yesterday=Yesterday

View File

@ -18,7 +18,9 @@
# Portions created by OEone Corporation are Copyright (C) 2001
# OEone Corporation. All Rights Reserved.
#
# Contributor(s): Garth Smedley <garths@oeone.com>
# Contributor(s):
# Garth Smedley <garths@oeone.com>
# Martin Schroeder <mschroeder@mozilla.x-home.org>
#
# 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
@ -34,8 +36,6 @@
#
# ***** END LICENSE BLOCK *****
# Month names - Add full names when needed
month.1.Mmm=Jan
month.2.Mmm=Feb
month.3.Mmm=Mar
@ -62,7 +62,6 @@ month.10.name=October
month.11.name=November
month.12.name=December
#Don't change this without notifying people in calendar first.
day.1.name=Sunday
day.2.name=Monday
day.3.name=Tuesday
@ -88,106 +87,7 @@ day.5.short=Th
day.6.short=Fr
day.7.short=Sa
am-string=AM
pm-string=PM
noon=Noon
midnight=Midnight
AllDay=All Day
# Added to support localization of messages within calendar-event-dialog.js
# Day ordinals imply order within a list.
ordinal.suffix.1=st
ordinal.suffix.2=nd
ordinal.suffix.3=rd
ordinal.suffix.4=th
ordinal.suffix.5=th
ordinal.suffix.6=th
ordinal.suffix.7=th
ordinal.suffix.8=th
ordinal.suffix.9=th
ordinal.suffix.10=th
ordinal.suffix.11=th
ordinal.suffix.12=th
ordinal.suffix.13=th
ordinal.suffix.14=th
ordinal.suffix.15=th
ordinal.suffix.16=th
ordinal.suffix.17=th
ordinal.suffix.18=th
ordinal.suffix.19=th
ordinal.suffix.20=th
ordinal.suffix.21=st
ordinal.suffix.22=nd
ordinal.suffix.23=rd
ordinal.suffix.24=th
ordinal.suffix.25=th
ordinal.suffix.26=th
ordinal.suffix.27=th
ordinal.suffix.28=th
ordinal.suffix.29=th
ordinal.suffix.30=th
ordinal.suffix.31=st
ordinal.name.last=Last
ordinal.name.1=First
ordinal.name.2=Second
ordinal.name.3=Third
ordinal.name.4=Fourth
ordinal.name.5=Fifth
# For the recurrence dialog
#
recur.first.sunday = First Sunday of the month
recur.second.sunday = Second Sunday of the month
recur.third.sunday = Third Sunday of the month
recur.fourth.sunday = Fourth Sunday of the month
recur.fifth.sunday = Fifth Sunday of the month
recur.last.sunday = Last Sunday of the month
recur.first.monday = First Monday of the month
recur.second.monday = Second Monday of the month
recur.third.monday = Third Monday of the month
recur.fourth.monday = Fourth Monday of the month
recur.fifth.monday = Fifth Monday of the month
recur.last.monday = Last Monday of the month
recur.first.tuesday = First Tuesday of the month
recur.second.tuesday = Second Tuesday of the month
recur.third.tuesday = Third Tuesday of the month
recur.fourth.tuesday = Fourth Tuesday of the month
recur.fifth.tuesday = Fifth Tuesday of the month
recur.last.tuesday = Last Tuesday of the month
recur.first.wednesday = First Wednesday of the month
recur.second.wednesday = Second Wednesday of the month
recur.third.wednesday = Third Wednesday of the month
recur.fourth.wednesday = Fourth Wednesday of the month
recur.fifth.wednesday = Fifth Wednesday of the month
recur.last.wednesday = Last Wednesday of the month
recur.first.thursday = First Thursday of the month
recur.second.thursday = Second Thursday of the month
recur.third.thursday = Third Thursday of the month
recur.fourth.thursday = Fourth Thursday of the month
recur.fifth.thursday = Fifth Thursday of the month
recur.last.thursday = Last Thursday of the month
recur.first.friday = First Friday of the month
recur.second.friday = Second Friday of the month
recur.third.friday = Third Friday of the month
recur.fourth.friday = Fourth Friday of the month
recur.fifth.friday = Fifth Friday of the month
recur.last.friday = Last Friday of the month
recur.first.saturday = First Saturday of the month
recur.second.saturday = Second Saturday of the month
recur.third.saturday = Third Saturday of the month
recur.fourth.saturday = Fourth Saturday of the month
recur.fifth.saturday = Fifth Saturday of the month
recur.last.saturday = Last Saturday of the month
# Will be subsituted with day and one of ordinal.suffix.N
# 15th day of the month
recurNthDay=%1$S%2$S day of the month

View File

@ -21,6 +21,7 @@
- Michael Büttner <michael.buettner@sun.com>
- Philipp Kewisch <mozilla@kewis.ch>
- Stefan Sitter <ssitter@gmail.com>
- Martin Schroeder <mschroeder@mozilla.x-home.org>
-
- 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
@ -263,6 +264,7 @@
<!ENTITY event.freebusy.legend.busy "Busy" >
<!ENTITY event.freebusy.legend.unknown "No information" >
<!ENTITY repeat.units.days.both "Day(s)" >
<!ENTITY repeat.units.weeks.both "Week(s)" >
<!ENTITY repeat.units.months.both "Month(s)" >
<!ENTITY repeat.units.years.both "Year(s)" >

View File

@ -6,7 +6,6 @@ calendar-@AB_CD@.jar:
locale/@AB_CD@/calendar/calendarCreation.dtd (%chrome/calendar/calendarCreation.dtd)
locale/@AB_CD@/calendar/calendar.properties (%chrome/calendar/calendar.properties)
locale/@AB_CD@/calendar/calendar-event-dialog.dtd (%chrome/calendar/calendar-event-dialog.dtd)
locale/@AB_CD@/calendar/calendar-recurrence-dialog.dtd (%chrome/calendar/calendar-recurrence-dialog.dtd)
locale/@AB_CD@/calendar/categories.properties (%chrome/calendar/categories.properties)
locale/@AB_CD@/calendar/wcap.properties (%chrome/calendar/providers/wcap/wcap.properties)
locale/@AB_CD@/calendar/dateFormat.properties (%chrome/calendar/dateFormat.properties)

View File

@ -20,6 +20,7 @@
-
- Contributor(s):
- Michael Buettner <michael.buettner@sun.com>
- Martin Schroeder <mschroeder@mozilla.x-home.org>
-
- 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
@ -43,11 +44,9 @@
<!DOCTYPE dialog [
<!ENTITY % globalDTD SYSTEM "chrome://calendar/locale/global.dtd">
<!ENTITY % sunDialogDTD SYSTEM "chrome://calendar/locale/sun-calendar-event-dialog.dtd">
<!ENTITY % recurrenceDTD SYSTEM "chrome://calendar/locale/calendar-recurrence-dialog.dtd">
<!ENTITY % dialogDTD SYSTEM "chrome://calendar/locale/calendar-event-dialog.dtd">
%globalDTD;
%sunDialogDTD;
%recurrenceDTD;
%dialogDTD;
]>
@ -122,7 +121,7 @@
disable-on-readonly="true"
disable-on-occurrence="true"/>
<label id="daily-group-every-units-label"
value="&repeat.units.days;"
value="&repeat.units.days.both;"
disable-on-readonly="true"
disable-on-occurrence="true"/>
<spacer id="daily-group-spacer" flex="1"/>