зеркало из https://github.com/mozilla/pjs.git
Bug 296893 Unify Sunbird and Lightning event dialogs r=pavlov, ui-r=beltzner
This commit is contained in:
Родитель
2334a52d2d
Коммит
edb75cb3aa
|
@ -1,3 +1,7 @@
|
|||
label.label {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.warning-text-class {
|
||||
color : red;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,10 @@
|
|||
|
||||
var gReadOnlyMode = false;
|
||||
|
||||
// If the user clicks 'More', then we set this to true. Otherwise, we don't
|
||||
// load/check the stuff in this area, because it hasn't changed.
|
||||
var gDetailsShown = false;
|
||||
|
||||
/* dialog stuff */
|
||||
function onLoad()
|
||||
{
|
||||
|
@ -72,7 +76,8 @@ function onLoad()
|
|||
updateAccept();
|
||||
|
||||
// update datetime pickers
|
||||
updateDuedate();
|
||||
updateDueDate();
|
||||
updateEntryDate();
|
||||
|
||||
// update datetime pickers
|
||||
updateAllDay();
|
||||
|
@ -80,9 +85,6 @@ function onLoad()
|
|||
// update recurrence button
|
||||
updateRecurrence();
|
||||
|
||||
// update alarm checkbox/label/settings button
|
||||
updateAlarm();
|
||||
|
||||
// update our size!
|
||||
window.sizeToContent();
|
||||
|
||||
|
@ -119,8 +121,6 @@ function loadDialog(item)
|
|||
|
||||
setElementValue("item-title", item.title);
|
||||
setElementValue("item-location", item.getProperty("LOCATION"));
|
||||
setElementValue("item-url", item.getProperty("URL"));
|
||||
setElementValue("item-description", item.getProperty("DESCRIPTION"));
|
||||
|
||||
/* event specific properties */
|
||||
if (isEvent(item)) {
|
||||
|
@ -133,26 +133,23 @@ function loadDialog(item)
|
|||
}
|
||||
setElementValue("event-starttime", startDate.jsDate);
|
||||
setElementValue("event-endtime", endDate.jsDate);
|
||||
document.getElementById("component-type").selectedIndex = 0;
|
||||
}
|
||||
|
||||
/* todo specific properties */
|
||||
if (isToDo(item)) {
|
||||
var hasEntryDate = (item.entryDate != null);
|
||||
setElementValue("todo-has-entrydate", hasEntryDate, "checked");
|
||||
if (hasEntryDate)
|
||||
setElementValue("todo-entrydate", item.entryDate.jsDate);
|
||||
|
||||
var hasDueDate = (item.dueDate != null);
|
||||
setElementValue("todo-has-duedate", hasDueDate, "checked");
|
||||
if (hasDueDate)
|
||||
setElementValue("todo-duedate", item.dueDate.jsDate);
|
||||
setElementValue("todo-completed", item.isCompleted, "checked");
|
||||
document.getElementById("component-type").selectedIndex = 1;
|
||||
}
|
||||
|
||||
/* attendence */
|
||||
var attendeeString = "";
|
||||
for each (var attendee in item.getAttendees({})) {
|
||||
if (attendeeString != "")
|
||||
attendeeString += ",";
|
||||
attendeeString += attendee.id.split("mailto:")[1];
|
||||
}
|
||||
setElementValue("item-attendees", attendeeString);
|
||||
|
||||
/* item default calendar */
|
||||
if (item.calendar) {
|
||||
var calendarList = document.getElementById("item-calendar");
|
||||
|
@ -167,6 +164,51 @@ function loadDialog(item)
|
|||
document.getElementById("item-calendar").selectedIndex = 0;
|
||||
}
|
||||
|
||||
/* Categories */
|
||||
try {
|
||||
var pb2 = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch2);
|
||||
var categoriesString = pb2.getComplexValue("calendar.categories.names",
|
||||
Components.interfaces.nsISupportsString).data;
|
||||
var categoriesList = categoriesString.split( "," );
|
||||
|
||||
// insert the category already in the menulist so it doesn't get lost
|
||||
var itemCategory = item.getProperty("CATEGORIES");
|
||||
if (itemCategory) {
|
||||
if (categoriesString.indexOf(itemCategory) == -1)
|
||||
categoriesList[categoriesList.length] = itemCategory;
|
||||
}
|
||||
categoriesList.sort();
|
||||
|
||||
var oldMenulist = document.getElementById("item-categories");
|
||||
while (oldMenulist.hasChildNodes()) {
|
||||
oldMenulist.removeChild(oldMenulist.lastChild);
|
||||
}
|
||||
|
||||
var categoryMenuList = document.getElementById("item-categories");
|
||||
var indexToSelect = 0;
|
||||
|
||||
// Add a 'none' option to allow users to cancel the category
|
||||
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
|
||||
.getService(Components.interfaces.nsIStringBundleService);
|
||||
var props = sbs.createBundle("chrome://calendar/locale/calendar.properties");
|
||||
var noneItem = categoryMenuList.appendItem(props.GetStringFromName("None"), "NONE");
|
||||
|
||||
for (var i in categoriesList) {
|
||||
var catItem = categoryMenuList.appendItem(categoriesList[i], categoriesList[i]);
|
||||
catItem.value = categoriesList[i];
|
||||
if (itemCategory && categoriesList[i] == itemCategory) {
|
||||
indexToSelect = parseInt(i)+1; // Add 1 because of 'None'
|
||||
}
|
||||
}
|
||||
categoryMenuList.selectedIndex = indexToSelect;
|
||||
|
||||
} catch (ex) {
|
||||
// The app using this dialog doesn't support categories
|
||||
document.getElementById("categories-box").collapsed = true;
|
||||
}
|
||||
|
||||
|
||||
/* recurrence */
|
||||
/* if the item is a proxy occurrence/instance, a few things aren't valid:
|
||||
* - Setting recurrence on the item
|
||||
|
@ -179,15 +221,20 @@ function loadDialog(item)
|
|||
} else if (item.recurrenceInfo)
|
||||
setElementValue("item-recurrence", "true", "checked");
|
||||
|
||||
/* alarms */
|
||||
if (item.alarmTime) {
|
||||
var alarmLength = item.getProperty("alarmLength");
|
||||
if (alarmLength != null) {
|
||||
setElementValue("alarm-length-field", alarmLength);
|
||||
setElementValue("alarm-length-units", event.getProperty("alarmUnits"));
|
||||
setElementValue("alarm-trigger-relation", item.getProperty("alarmRelated"));
|
||||
var detailsButton = document.getElementById("calendar-event-dialog").getButton("disclosure");
|
||||
var detailsElements = document.getElementsByAttribute("details", "true");
|
||||
|
||||
if (document.getElementById("description-row").getAttribute("collapsed") != "true") {
|
||||
detailsButton.setAttribute("label", lessLabel);
|
||||
for each (elem in detailsElements) {
|
||||
elem.collapsed = false;
|
||||
}
|
||||
setElementValue("item-alarm", "custom");
|
||||
loadDetails();
|
||||
} else {
|
||||
for each (elem in detailsElements) {
|
||||
elem.collapsed = true;
|
||||
}
|
||||
detailsButton.setAttribute("label", moreLabel);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,8 +242,6 @@ function saveDialog(item)
|
|||
{
|
||||
setItemProperty(item, "title", getElementValue("item-title"));
|
||||
setItemProperty(item, "LOCATION", getElementValue("item-location"));
|
||||
setItemProperty(item, "URL", getElementValue("item-url"));
|
||||
setItemProperty(item, "DESCRIPTION", getElementValue("item-description"));
|
||||
|
||||
if (isEvent(item)) {
|
||||
var startDate = jsDateToDateTime(getElementValue("event-starttime"));
|
||||
|
@ -216,23 +261,13 @@ function saveDialog(item)
|
|||
}
|
||||
|
||||
if (isToDo(item)) {
|
||||
var entryDate = getElementValue("todo-has-entrydate", "checked") ?
|
||||
jsDateToDateTime(getElementValue("todo-entrydate")) : null;
|
||||
setItemProperty(item, "entryDate", entryDate);
|
||||
|
||||
var dueDate = getElementValue("todo-has-duedate", "checked") ?
|
||||
jsDateToDateTime(getElementValue("todo-duedate")) : null;
|
||||
setItemProperty(item, "dueDate", dueDate);
|
||||
setItemProperty(item, "isCompleted", getElementValue("todo-completed", "checked"));
|
||||
}
|
||||
|
||||
/* attendence */
|
||||
item.removeAllAttendees();
|
||||
var attendees = getElementValue("item-attendees");
|
||||
if (attendees != "") {
|
||||
for each (var addr in attendees.split(",")) {
|
||||
if (addr != "") {
|
||||
var attendee = createAttendee();
|
||||
attendee.id = "mailto:" + addr;
|
||||
item.addAttendee(attendee);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* recurrence */
|
||||
|
@ -244,6 +279,51 @@ function saveDialog(item)
|
|||
item.recurrenceInfo = null;
|
||||
}
|
||||
|
||||
/* Category */
|
||||
var category = getElementValue("item-categories");
|
||||
|
||||
if (category != "NONE") {
|
||||
setItemProperty(item, "CATEGORIES", category);
|
||||
} else {
|
||||
item.deleteProperty("CATEGORIES");
|
||||
}
|
||||
|
||||
if (!gDetailsShown) {
|
||||
// We never showed the items in the 'More' box. That means that clone()
|
||||
// took care of it, so just return now
|
||||
dump(item.icalString + '\n');
|
||||
return;
|
||||
}
|
||||
|
||||
setItemProperty(item, "URL", getElementValue("item-url"));
|
||||
setItemProperty(item, "DESCRIPTION", getElementValue("item-description"));
|
||||
|
||||
var status;
|
||||
if (isEvent(item)) {
|
||||
status = getElementValue("event-status");
|
||||
} else {
|
||||
status = getElementValue("todo-status");
|
||||
}
|
||||
|
||||
setItemProperty(item, "STATUS", status);
|
||||
setItemProperty(item, "PRIORITY", getElementValue("priority-levels"));
|
||||
setItemProperty(item, "CLASS", getElementValue("privacy-menulist"));
|
||||
|
||||
if (item.status == "COMPLETED" && isToDo(item)) {
|
||||
item.completedDate = getElementValue("compeleted-date-picker");
|
||||
}
|
||||
|
||||
setItemProperty(item, "PERCENT-COMPLETE", getElementValue("percent-complete-menulist"));
|
||||
|
||||
/* attendence */
|
||||
item.removeAllAttendees();
|
||||
var attendeeListBox = document.getElementById("attendees-listbox");
|
||||
for each (kid in attendeeListBox.childNodes) {
|
||||
if (kid.attendee) {
|
||||
item.addAttendee(kid.attendee);
|
||||
}
|
||||
}
|
||||
|
||||
/* alarms */
|
||||
var hasAlarm = (getElementValue("item-alarm") != "none");
|
||||
if (!hasAlarm) {
|
||||
|
@ -263,9 +343,15 @@ function saveDialog(item)
|
|||
var alarmTime = null;
|
||||
|
||||
if (alarmRelated == "START") {
|
||||
alarmTime = item.startDate.clone();
|
||||
if (isEvent(item))
|
||||
alarmTime = item.startDate.clone();
|
||||
else
|
||||
alarmTime = item.entryDate.clone();
|
||||
} else if (alarmRelated == "END") {
|
||||
alarmTime = item.endDate.clone();
|
||||
if (isEvent(item))
|
||||
alarmTime = item.endDate.clone();
|
||||
else
|
||||
alarmTime = item.dueDate.clone();
|
||||
}
|
||||
|
||||
switch (alarmUnits) {
|
||||
|
@ -305,6 +391,11 @@ function updateTitle()
|
|||
}
|
||||
}
|
||||
|
||||
function updateComponentType() {
|
||||
//XXX We still can't properly convert from event <-> task via QI
|
||||
return;
|
||||
}
|
||||
|
||||
function updateStyle()
|
||||
{
|
||||
const kDialogStylesheet = "chrome://calendar/content/calendar-event-dialog.css";
|
||||
|
@ -331,12 +422,25 @@ function updateAccept()
|
|||
acceptButton.removeAttribute("disabled");
|
||||
|
||||
// don't allow for end dates to be before start dates
|
||||
var startDate = jsDateToDateTime(getElementValue("event-starttime"));
|
||||
var endDate = jsDateToDateTime(getElementValue("event-endtime"));
|
||||
if (endDate.compare(startDate) == -1) {
|
||||
var startDate;
|
||||
var endDate;
|
||||
if (isEvent(window.calendarItem)) {
|
||||
startDate = jsDateToDateTime(getElementValue("event-starttime"));
|
||||
endDate = jsDateToDateTime(getElementValue("event-endtime"));
|
||||
} else {
|
||||
startDate = getElementValue("todo-has-entrydate", "checked") ?
|
||||
jsDateToDateTime(getElementValue("todo-entrydate")) : null;
|
||||
endDate = getElementValue("todo-has-duedate", "checked") ?
|
||||
jsDateToDateTime(getElementValue("todo-duedate")) : null;
|
||||
}
|
||||
|
||||
var timeWarning = document.getElementById("end-time-warning");
|
||||
if (endDate && startDate && endDate.compare(startDate) == -1) {
|
||||
acceptButton.setAttribute("disabled", "true");
|
||||
} else if (acceptButton.getAttribute("disabled")) {
|
||||
timeWarning.removeAttribute("hidden");
|
||||
} else {
|
||||
acceptButton.removeAttribute("disabled");
|
||||
timeWarning.setAttribute("hidden", "true");
|
||||
}
|
||||
|
||||
// can't add/edit items in readOnly calendars
|
||||
|
@ -347,10 +451,14 @@ function updateAccept()
|
|||
if (gReadOnlyMode || cal.readOnly) {
|
||||
acceptButton.setAttribute("disabled", "true");
|
||||
}
|
||||
|
||||
if (!updateTaskAlarmWarnings()) {
|
||||
acceptButton.setAttribute("disabled", "true");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
function updateDuedate()
|
||||
function updateDueDate()
|
||||
{
|
||||
if (!isToDo(window.calendarItem))
|
||||
return;
|
||||
|
@ -359,8 +467,49 @@ function updateDuedate()
|
|||
setElementValue("todo-duedate", getElementValue("todo-duedate"));
|
||||
|
||||
setElementValue("todo-duedate", !getElementValue("todo-has-duedate", "checked"), "disabled");
|
||||
|
||||
updateAccept();
|
||||
}
|
||||
|
||||
function updateEntryDate()
|
||||
{
|
||||
if (!isToDo(window.calendarItem))
|
||||
return;
|
||||
|
||||
// force something to get set if there was nothing there before
|
||||
setElementValue("todo-entrydate", getElementValue("todo-entrydate"));
|
||||
|
||||
setElementValue("todo-entrydate", !getElementValue("todo-has-entrydate", "checked"), "disabled");
|
||||
|
||||
updateAccept();
|
||||
}
|
||||
|
||||
function updateTaskAlarmWarnings() {
|
||||
document.getElementById("alarm-start-warning").setAttribute("hidden", true);
|
||||
document.getElementById("alarm-end-warning").setAttribute("hidden", true);
|
||||
|
||||
var alarmType = getElementValue("item-alarm");
|
||||
if (!gDetailsShown || !isToDo(window.calendarItem) || alarmType == "none") {
|
||||
return true;
|
||||
}
|
||||
|
||||
var hasEntryDate = getElementValue("todo-has-entrydate", "checked");
|
||||
var hasDueDate = getElementValue("todo-has-duedate", "checked");
|
||||
|
||||
var alarmRelated = document.getElementById("alarm-trigger-relation").selectedItem.value;
|
||||
|
||||
if ((alarmType != "custom" || alarmRelated == "START") && !hasEntryDate) {
|
||||
document.getElementById("alarm-start-warning").removeAttribute("hidden");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (alarmRelated == "END" && !hasDueDate) {
|
||||
document.getElementById("alarm-end-warning").removeAttribute("hidden");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function updateAllDay()
|
||||
{
|
||||
|
@ -406,10 +555,10 @@ function updateAlarm()
|
|||
/* restore old values if they're around */
|
||||
setAlarmFields(alarmItem);
|
||||
|
||||
document.getElementById("alarm-details").style.visibility = "visible";
|
||||
document.getElementById("alarm-details").removeAttribute("hidden");
|
||||
break;
|
||||
default:
|
||||
document.getElementById("alarm-details").style.visibility = "hidden";
|
||||
document.getElementById("alarm-details").setAttribute("hidden", true);
|
||||
|
||||
var customItem = document.getElementById("alarm-custom-menuitem");
|
||||
if (prevAlarmItem == customItem) {
|
||||
|
@ -423,6 +572,9 @@ function updateAlarm()
|
|||
}
|
||||
|
||||
prevAlarmItem = alarmItem;
|
||||
updateAccept();
|
||||
|
||||
this.sizeToContent();
|
||||
}
|
||||
|
||||
function editRecurrence()
|
||||
|
@ -462,7 +614,14 @@ function setItemProperty(item, propertyName, value)
|
|||
item.endDate = value;
|
||||
break;
|
||||
|
||||
|
||||
case "entryDate":
|
||||
if (value == item.entryDate)
|
||||
break;
|
||||
if ((value && !item.entryDate) ||
|
||||
(!value && item.entryDate) ||
|
||||
(value.compare(item.entryDate) != 0))
|
||||
item.entryDate = value;
|
||||
break;
|
||||
case "dueDate":
|
||||
if (value == item.dueDate)
|
||||
break;
|
||||
|
@ -495,3 +654,179 @@ function setItemProperty(item, propertyName, value)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function toggleDetails() {
|
||||
var detailsElements = document.getElementsByAttribute("details", "true");
|
||||
var detailsButton = document.getElementById("calendar-event-dialog").getButton("disclosure");
|
||||
|
||||
if (!detailsElements[0].collapsed) {
|
||||
// Hide details
|
||||
for each (elem in detailsElements) {
|
||||
elem.collapsed = true;
|
||||
}
|
||||
detailsButton.setAttribute("label", moreLabel);
|
||||
this.sizeToContent();
|
||||
return;
|
||||
}
|
||||
|
||||
// Display details
|
||||
for each (elem in detailsElements) {
|
||||
elem.collapsed = false;
|
||||
}
|
||||
detailsButton.setAttribute("label", lessLabel);
|
||||
this.sizeToContent();
|
||||
|
||||
if (gDetailsShown) {
|
||||
// We've already loaded this stuff before, so we're done
|
||||
return;
|
||||
}
|
||||
|
||||
loadDetails();
|
||||
}
|
||||
|
||||
function loadDetails() {
|
||||
gDetailsShown = true;
|
||||
var item = window.calendarItem;
|
||||
|
||||
/* attendence */
|
||||
var attendeeString = "";
|
||||
var attendeeListBox = document.getElementById("attendees-listbox");
|
||||
|
||||
var child;
|
||||
while ((child = attendeeListBox.lastChild) && (child.tagName == "listitem")) {
|
||||
attendeeListBox.removeChild(child);
|
||||
}
|
||||
|
||||
for each (var attendee in item.getAttendees({})) {
|
||||
var listItem = document.createElement("listitem");
|
||||
var nameCell = document.createElement("listcell");
|
||||
nameCell.setAttribute("label", attendee.id.split("MAILTO:")[1]);
|
||||
listItem.appendChild(nameCell);
|
||||
|
||||
listItem.attendee = attendee;
|
||||
attendeeListBox.appendChild(listItem);
|
||||
}
|
||||
|
||||
|
||||
/* Status */
|
||||
setElementValue("item-url", item.getProperty("URL"));
|
||||
setElementValue("item-description", item.getProperty("DESCRIPTION"));
|
||||
if (isEvent(item)) {
|
||||
setElementValue("event-status", item.getProperty("STATUS"));
|
||||
} else {
|
||||
setElementValue("todo-status", item.getProperty("STATUS"));
|
||||
}
|
||||
|
||||
/* Task completed date */
|
||||
if (item.completedDate) {
|
||||
updateToDoStatus(item.status, item.completedDate.jsDate);
|
||||
} else {
|
||||
updateToDoStatus(item.status);
|
||||
}
|
||||
|
||||
/* Priority */
|
||||
var priorityInteger = parseInt(item.priority);
|
||||
if (priorityInteger >= 1 && priorityInteger <= 4) {
|
||||
document.getElementById("priority-levels").selectedIndex = 3; // high priority
|
||||
} else if (priorityInteger == 5) {
|
||||
document.getElementById("priority-levels").selectedIndex = 2; // medium priority
|
||||
} else if (priorityInteger >= 6 && priorityInteger <= 9) {
|
||||
document.getElementById("priority-levels").selectedIndex = 1; // low priority
|
||||
} else {
|
||||
document.getElementById("priority-levels").selectedIndex = 0; // not defined
|
||||
}
|
||||
|
||||
/* Privacy */
|
||||
switch (item.privacy) {
|
||||
case "PUBLIC":
|
||||
case "PRIVATE":
|
||||
case "CONFIDENTIAL":
|
||||
setElementValue("privacy-menulist", item.privacy);
|
||||
break;
|
||||
case "":
|
||||
setElementValue("private-menulist", "PUBLIC");
|
||||
break;
|
||||
default: // bogus value
|
||||
dump("ERROR! Event has invalid privacy string: " + item.privacy + "\n");
|
||||
break;
|
||||
}
|
||||
|
||||
/* alarms */
|
||||
if (item.alarmTime) {
|
||||
var alarmLength = item.getProperty("alarmLength");
|
||||
if (alarmLength != null) {
|
||||
setElementValue("alarm-length-field", alarmLength);
|
||||
setElementValue("alarm-length-units", item.getProperty("alarmUnits"));
|
||||
setElementValue("alarm-trigger-relation", item.getProperty("alarmRelated"));
|
||||
}
|
||||
setElementValue("item-alarm", "custom");
|
||||
}
|
||||
|
||||
// update alarm checkbox/label/settings button
|
||||
updateAlarm();
|
||||
|
||||
updateTaskAlarmWarnings();
|
||||
}
|
||||
|
||||
function updateToDoStatus(status, passedInCompletedDate)
|
||||
{
|
||||
// RFC2445 doesn't support completedDates without the todo's status
|
||||
// being "COMPLETED", however twiddling the status menulist shouldn't
|
||||
// destroy that information at this point (in case you change status
|
||||
// back to COMPLETED). When we go to store this VTODO as .ics the
|
||||
// date will get lost.
|
||||
|
||||
var completedDate;
|
||||
if (passedInCompletedDate) {
|
||||
completedDate = passedInCompletedDate;
|
||||
} else {
|
||||
completedDate = null;
|
||||
}
|
||||
|
||||
// remember the original values
|
||||
var oldPercentComplete = getElementValue("percent-complete-menulist");
|
||||
var oldCompletedDate = getElementValue("completed-date-picker");
|
||||
|
||||
switch (status) {
|
||||
case "":
|
||||
case "NONE":
|
||||
document.getElementById("todo-status").selectedIndex = 0;
|
||||
disableElement("percent-complete-menulist");
|
||||
disableElement("percent-complete-label");
|
||||
break;
|
||||
case "CANCELLED":
|
||||
document.getElementById("todo-status").selectedIndex = 4;
|
||||
disableElement("percent-complete-menulist");
|
||||
disableElement("percent-complete-label");
|
||||
break;
|
||||
case "COMPLETED":
|
||||
document.getElementById("todo-status").selectedIndex = 3;
|
||||
enableElement("percent-complete-menulist");
|
||||
enableElement("percent-complete-label");
|
||||
// if there isn't a completedDate, set it to now
|
||||
if (!completedDate)
|
||||
completedDate = new Date();
|
||||
break;
|
||||
case "IN-PROCESS":
|
||||
document.getElementById("todo-status").selectedIndex = 2;
|
||||
disableElement("completed-date-picker");
|
||||
enableElement("percent-complete-menulist");
|
||||
enableElement("percent-complete-label");
|
||||
break;
|
||||
case "NEEDS-ACTION":
|
||||
document.getElementById("todo-status").selectedIndex = 1;
|
||||
enableElement("percent-complete-menulist");
|
||||
enableElement("percent-complete-label");
|
||||
break;
|
||||
}
|
||||
|
||||
if (status == "COMPLETED") {
|
||||
setElementValue("percent-complete-menulist", "100");
|
||||
setElementValue("completed-date-picker", completedDate);
|
||||
enableElement("completed-date-picker");
|
||||
} else {
|
||||
setElementValue("percent-complete-menulist", oldPercentComplete);
|
||||
setElementValue("completed-date-picker", oldCompletedDate);
|
||||
disableElement("completed-date-picker");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,11 +50,12 @@
|
|||
<dialog
|
||||
id="calendar-event-dialog"
|
||||
title="&event.title.label;"
|
||||
buttons="accept,cancel"
|
||||
buttons="accept,cancel,disclosure"
|
||||
ondialogaccept="return onAccept();"
|
||||
ondialogcancel="return onCancel();"
|
||||
ondialogdisclosure="toggleDetails();"
|
||||
onload="onLoad()"
|
||||
persist="screenX screenY"
|
||||
persist="screenX screenY width"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<!-- Javascript includes -->
|
||||
|
@ -62,6 +63,12 @@
|
|||
<script type="application/x-javascript" src="chrome://calendar/content/calendar-dialog-utils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarUtils.js"/>
|
||||
|
||||
<!-- Used for the button to show/hide details -->
|
||||
<script type="application/x-javascript">
|
||||
var moreLabel = "&calendar.more.label; >>";
|
||||
var lessLabel = "<< &calendar.less.label;";
|
||||
</script>
|
||||
|
||||
|
||||
<vbox id="dialog-box" flex="1">
|
||||
<label id="read-only-item" value="&newevent.readonly.item.warning;"
|
||||
|
@ -74,124 +81,250 @@
|
|||
</columns>
|
||||
|
||||
<rows>
|
||||
<rows equalsize="always">
|
||||
<row align="center">
|
||||
<label value="&newevent.title.label;" class="label"/>
|
||||
<textbox id="item-title" oninput="updateAccept();"/>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label value="&newevent.location.label;" class="label"/>
|
||||
<textbox id="item-location"/>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label value="&newevent.title.label;"/>
|
||||
<hbox flex="1" align="center">
|
||||
<textbox id="item-title" oninput="updateAccept();" flex="1"/>
|
||||
<menulist id="component-type" crop="none" disabled="true"
|
||||
oncommand="updateComponentType(this.value)">
|
||||
<menupopup id="component-menulist-menupopup">
|
||||
<menuitem label="&newevent.itemType.event.label;"
|
||||
value="event"/>
|
||||
<menuitem label="&newevent.itemType.todo.label;"
|
||||
value="todo"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<label value="&newevent.uri.label;" class="label"/>
|
||||
<textbox id="item-url"/>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label value="&newevent.location.label;"/>
|
||||
<textbox id="item-location"/>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<label value="&newevent.attendees.label;" class="label"/>
|
||||
<textbox id="item-attendees"/>
|
||||
</row>
|
||||
<row align ="center">
|
||||
<hbox align="center">
|
||||
<label value="&newevent.from.label;" class="event-only"/>
|
||||
<label value="&newevent.date.label;" class="todo-only"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<datetimepicker id="event-starttime" onchange="updateAccept();"
|
||||
class="event-only"/>
|
||||
<checkbox id="event-all-day" oncommand="updateAllDay();"
|
||||
class="event-only" label="&newevent.alldayevent.label;"/>
|
||||
<checkbox id="todo-has-entrydate" oncommand="updateEntryDate();"
|
||||
class="todo-only"/>
|
||||
<datetimepicker id="todo-entrydate" onchange="updateAccept();"
|
||||
class="todo-only"/>
|
||||
<spacer flex="1"/>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<row align="center" class="event-only">
|
||||
<label value="&newevent.alldayevent.label;" class="label"/>
|
||||
<hbox>
|
||||
<checkbox id="event-all-day" oncommand="updateAllDay();"/>
|
||||
<spacer flex="1"/>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<row align="center" class="event-only">
|
||||
<label value="&newevent.from.label;" class="label"/>
|
||||
<datetimepicker id="event-starttime" onchange="updateAccept();"/>
|
||||
</row>
|
||||
|
||||
<row align="center" class="event-only">
|
||||
<label value="&newevent.to.label;" class="label"/>
|
||||
<datetimepicker id="event-endtime" onchange="updateAccept();"/>
|
||||
</row>
|
||||
|
||||
<row align="center" class="todo-only">
|
||||
<label value="&newevent.status.completed.label;" class="label"/>
|
||||
<hbox>
|
||||
<checkbox id="todo-completed"/>
|
||||
<spacer flex="1"/>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<row align="center" class="todo-only">
|
||||
<label value="&newtodo.duedate.label;" class="label"/>
|
||||
<hbox>
|
||||
<checkbox id="todo-has-duedate" oncommand="updateDuedate();"/>
|
||||
<datetimepicker id="todo-duedate"/>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<label value="&newevent.repeat.label2;" class="label"/>
|
||||
<row>
|
||||
<hbox align="center">
|
||||
<label value="&newevent.to.label;" class="event-only"/>
|
||||
<label value="&newtodo.duedate.label;" class="todo-only"/>
|
||||
</hbox>
|
||||
<vbox>
|
||||
<hbox align="center">
|
||||
<checkbox id="item-recurrence" oncommand="updateRecurrence();"/>
|
||||
<spacer flex="1"/>
|
||||
<datetimepicker id="event-endtime" onchange="updateAccept();" class="event-only"/>
|
||||
<checkbox id="todo-has-duedate" oncommand="updateDueDate();" class="todo-only"/>
|
||||
<datetimepicker id="todo-duedate" onchange="updateAccept();" class="todo-only"/>
|
||||
<checkbox id="item-recurrence" oncommand="updateRecurrence();"
|
||||
label="&newevent.repeat.label2;"/>
|
||||
<button id="set-recurrence" label="&newevent.set.label;" oncommand="editRecurrence();"/>
|
||||
</hbox>
|
||||
</row>
|
||||
<label id="end-time-warning" class="warning-text-class"
|
||||
value="&newevent.endtime.warning;"/>
|
||||
</vbox>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<label value="&newevent.server.label;" class="label"/>
|
||||
<hbox>
|
||||
<menulist id="item-calendar"/>
|
||||
<label id="read-only-cal"
|
||||
value="&newevent.readonly.cal.warning;"
|
||||
class="warning-text-class" hidden="true"/>
|
||||
<row>
|
||||
<spacer height="5"/>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<label value="&newevent.server.label;"/>
|
||||
<hbox align="center">
|
||||
<menulist id="item-calendar"/>
|
||||
<label id="read-only-cal"
|
||||
value="&newevent.readonly.cal.warning;"
|
||||
class="warning-text-class" hidden="true"/>
|
||||
<spacer flex="1"/>
|
||||
<hbox id="categories-box">
|
||||
<label value="&newtodo.categories.label;" class="label"/>
|
||||
<menulist id="item-categories"/>
|
||||
</hbox>
|
||||
</row>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<label value="&newevent.alarm.label;" class="label"/>
|
||||
<hbox>
|
||||
<menulist id="item-alarm" oncommand="updateAlarm()">
|
||||
<menupopup>
|
||||
<menuitem label="&newevent.none.label;" value="none" selected="true"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&newevent.15minutes.before.label;" length="15" unit="minutes" relation="START"/>
|
||||
<menuitem label="&newevent.30minutes.before.label;" length="30" unit="minutes" relation="START"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="alarm-custom-menuitem" label="&newevent.custom.label;" value="custom"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<spacer flex="1"/>
|
||||
</hbox>
|
||||
</row>
|
||||
<!-- Details -->
|
||||
|
||||
<row align="center">
|
||||
<spacer/>
|
||||
<hbox align="center" id="alarm-details">
|
||||
<textbox id="alarm-length-field" size="1" oninput="validateIntegers(event);"/>
|
||||
<menulist id="alarm-length-units">
|
||||
<menupopup>
|
||||
<menuitem label="&alarm.units.minutes;" value="minutes" selected="true"/>
|
||||
<menuitem label="&alarm.units.hours;" value="hours"/>
|
||||
<menuitem label="&alarm.units.days;" value="days"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<menulist id="alarm-trigger-relation">
|
||||
<menupopup>
|
||||
<menuitem label="&newevent.before.label;" value="START" selected="true"/>
|
||||
<menuitem label="&newevent.after.label;" value="END"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</row>
|
||||
<row details="true">
|
||||
<spacer height="5"/>
|
||||
</row>
|
||||
|
||||
</rows>
|
||||
<!-- We work off of this row's collapsed state to determine whether or
|
||||
not to show details when loading the dialog -->
|
||||
<row id="description-row" details="true" collapsed="true" persist="collapsed" flex="1">
|
||||
<label value="&newevent.description.label;"/>
|
||||
<textbox id="item-description" multiline="true" rows="4" flex="1"/>
|
||||
</row>
|
||||
|
||||
<textbox id="item-description" multiline="true" rows="4"/>
|
||||
<row details="true">
|
||||
<label value="&newevent.attendees.label;"/>
|
||||
<hbox flex="1">
|
||||
<vbox flex="1">
|
||||
<listbox id="attendees-listbox" rows="5" flex="1"/>
|
||||
<button label="&calendar.edit.attendees;" disabled="true"/>
|
||||
</vbox>
|
||||
|
||||
<spacer width="10"/>
|
||||
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
<column/>
|
||||
</columns>
|
||||
|
||||
<rows>
|
||||
<row align="center">
|
||||
<label value="&newevent.privacy.label;" class="label"/>
|
||||
<menulist id="privacy-menulist" crop="none">
|
||||
<menupopup>
|
||||
<menuitem label="&newevent.public.label;" value="PUBLIC"/>
|
||||
<menuitem label="&newevent.private.label;" value="PRIVATE"/>
|
||||
<menuitem label="&newevent.confidential.label;" value="CONFIDENTIAL"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<label id="priority-label" class="label"
|
||||
value="&newtodo.priority.label;"/>
|
||||
<menulist id="priority-levels">
|
||||
<menupopup>
|
||||
<menuitem label="&priority.level.none;" value="0"/>
|
||||
<menuitem label="&priority.level.low;" value="9"/>
|
||||
<menuitem label="&priority.level.medium;" value="5"/>
|
||||
<menuitem label="&priority.level.high;" value="1"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<label id="status-label" class="event-only"
|
||||
value="&newevent.status.label;"/>
|
||||
<menulist id="event-status" class="event-only">
|
||||
<menupopup>
|
||||
<menuitem label="&priority.level.none;"
|
||||
value="NONE"/>
|
||||
<menuitem label="&newevent.status.tentative.label;"
|
||||
value="TENTATIVE"/>
|
||||
<menuitem label="&newevent.status.confirmed.label;"
|
||||
value="CONFIRMED"/>
|
||||
<menuitem label="&newevent.status.cancelled.label;"
|
||||
value="CANCELLED"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
|
||||
<row align="center">
|
||||
<label value="&newevent.alarm.label;"/>
|
||||
<hbox align="center">
|
||||
<menulist id="item-alarm" oncommand="updateAlarm()">
|
||||
<menupopup>
|
||||
<menuitem label="&newevent.none.label;" value="none" selected="true"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&newevent.15minutes.before.label;" length="15" unit="minutes" relation="START"/>
|
||||
<menuitem label="&newevent.30minutes.before.label;" length="30" unit="minutes" relation="START"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="alarm-custom-menuitem" label="&newevent.custom.label;" value="custom"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<row id="alarm-details">
|
||||
<spacer flex="1"/>
|
||||
<vbox>
|
||||
<hbox>
|
||||
<textbox id="alarm-length-field" size="1" oninput="validateIntegers(event);"/>
|
||||
<menulist id="alarm-length-units">
|
||||
<menupopup>
|
||||
<menuitem label="&alarm.units.minutes;" value="minutes" selected="true"/>
|
||||
<menuitem label="&alarm.units.hours;" value="hours"/>
|
||||
<menuitem label="&alarm.units.days;" value="days"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<menulist id="alarm-trigger-relation" oncommand="updateAccept()">
|
||||
<menupopup>
|
||||
<menuitem label="&newevent.before.label;" value="START" selected="true"/>
|
||||
<menuitem label="&newevent.after.label;" value="END"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
<label id="alarm-start-warning" value="&alarm.start.warning;"
|
||||
class="warning-text-class"/>
|
||||
<label id="alarm-end-warning" value="&alarm.due.warning;"
|
||||
class="warning-text-class"/>
|
||||
</vbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<row details="true">
|
||||
<spacer height="5"/>
|
||||
</row>
|
||||
|
||||
<row align="center" details="true">
|
||||
<label value="&newevent.uri.label;"/>
|
||||
<textbox id="item-url"/>
|
||||
</row>
|
||||
|
||||
<row class="todo-only" details="true">
|
||||
<label id="todo-status-label" value="&newevent.status.label;"/>
|
||||
<hbox align="center">
|
||||
<menulist id="todo-status" class="todo-only"
|
||||
oncommand="updateToDoStatus(this.value);">
|
||||
<menupopup>
|
||||
<menuitem label="&priority.level.none;"
|
||||
value="NONE"/>
|
||||
<menuitem label="&newevent.status.needsaction.label;"
|
||||
value="NEEDS-ACTION"/>
|
||||
<menuitem label="&newevent.status.inprogress.label;"
|
||||
value="IN-PROCESS"/>
|
||||
<menuitem label="&newevent.status.completed.label;"
|
||||
value="COMPLETED"/>
|
||||
<menuitem label="&newevent.status.cancelled.label;"
|
||||
value="CANCELLED"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<datepicker id="completed-date-picker" class="todo-only"
|
||||
value="" disabled="true"/>
|
||||
<menulist id="percent-complete-menulist" class="todo-only">
|
||||
<menupopup>
|
||||
<menuitem label="0" value="0"/>
|
||||
<menuitem label="10" value="10"/>
|
||||
<menuitem label="20" value="20"/>
|
||||
<menuitem label="30" value="30"/>
|
||||
<menuitem label="40" value="40"/>
|
||||
<menuitem label="50" value="50"/>
|
||||
<menuitem label="60" value="60"/>
|
||||
<menuitem label="70" value="70"/>
|
||||
<menuitem label="80" value="80"/>
|
||||
<menuitem label="90" value="90"/>
|
||||
<menuitem label="100" value="100"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<label id="percent-complete-label" class="todo-only"
|
||||
value="&newtodo.percentcomplete.label;"/>
|
||||
</hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<spacer height="10"/>
|
||||
</vbox>
|
||||
|
||||
</dialog>
|
||||
|
||||
|
|
|
@ -37,10 +37,21 @@
|
|||
|
||||
|
||||
/* all params are optional */
|
||||
function createEventWithDialog(calendar, startDate, endDate, summary)
|
||||
function createEventWithDialog(calendar, startDate, endDate, summary, event)
|
||||
{
|
||||
const kDefaultTimezone = calendarDefaultTimezone();
|
||||
var event = createEvent();
|
||||
|
||||
|
||||
var onNewEvent = function(event, calendar, originalEvent) {
|
||||
calendar.addItem(event, null);
|
||||
}
|
||||
|
||||
if (event) {
|
||||
openEventDialog(event, calendar, "new", onNewEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
event = createEvent();
|
||||
|
||||
if (!startDate) {
|
||||
startDate = jsDateToDateTime(new Date());
|
||||
|
@ -84,17 +95,23 @@ function createEventWithDialog(calendar, startDate, endDate, summary)
|
|||
if (summary)
|
||||
event.title = summary;
|
||||
|
||||
var onNewEvent = function(event, calendar, originalEvent) {
|
||||
calendar.addItem(event, null);
|
||||
}
|
||||
|
||||
openEventDialog(event, calendar, "new", onNewEvent);
|
||||
}
|
||||
|
||||
function createTodoWithDialog(calendar, dueDate, summary)
|
||||
function createTodoWithDialog(calendar, dueDate, summary, todo)
|
||||
{
|
||||
const kDefaultTimezone = calendarDefaultTimezone();
|
||||
var todo = createToDo();
|
||||
|
||||
var onNewItem = function(item, calendar, originalItem) {
|
||||
calendar.addItem(item, null);
|
||||
}
|
||||
|
||||
if (todo) {
|
||||
openEventDialog(todo, calendar, "new", onNewItem);
|
||||
return;
|
||||
}
|
||||
|
||||
todo = createToDo();
|
||||
|
||||
if (calendar) {
|
||||
todo.calendar = calendar;
|
||||
|
|
|
@ -52,6 +52,8 @@ function onLoad()
|
|||
|
||||
updateDuration();
|
||||
|
||||
updateAccept();
|
||||
|
||||
opener.setCursor("auto");
|
||||
|
||||
self.focus();
|
||||
|
@ -171,8 +173,6 @@ function saveDialog()
|
|||
case 0:
|
||||
recRule.type = "DAILY";
|
||||
var ndays = Number(getElementValue("daily-days"));
|
||||
if (ndays == "")
|
||||
ndays = 1;
|
||||
recRule.interval = ndays;
|
||||
break;
|
||||
case 1:
|
||||
|
@ -228,6 +228,8 @@ function saveDialog()
|
|||
function updateDeck()
|
||||
{
|
||||
document.getElementById("period-deck").selectedIndex = Number(getElementValue("period-list"));
|
||||
|
||||
updateAccept();
|
||||
}
|
||||
|
||||
function updateDuration()
|
||||
|
@ -251,6 +253,41 @@ function updateDuration()
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
switch (Number(getElementValue("period-list"))) {
|
||||
case 0: // daily
|
||||
var ndays = Number(getElementValue("daily-days"));
|
||||
if (ndays == "" || ndays < 1) {
|
||||
document.getElementById("repeat-interval-warning").removeAttribute("hidden");
|
||||
acceptButton.setAttribute("disabled", "true");
|
||||
}
|
||||
break;
|
||||
case 3: // yearly
|
||||
var nyears = Number(getElementValue("yearly-years"));
|
||||
if (nyears == "" || nyears < 1) {
|
||||
document.getElementById("repeat-interval-warning").removeAttribute("hidden");
|
||||
acceptButton.setAttribute("disabled", "true");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
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 removeSelectedException()
|
||||
{
|
||||
var exceptionList = document.getElementById("recurrence-exceptions-listbox");
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://calendar/content/datetimepickers/datetimepickers.css" ?>
|
||||
<?xml-stylesheet href="chrome://calendar/content/calendar-event-dialog.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE dialog
|
||||
[
|
||||
|
@ -82,6 +83,14 @@
|
|||
</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">
|
||||
|
@ -89,7 +98,7 @@
|
|||
<!-- Daily -->
|
||||
<hbox align="top">
|
||||
<label value="&newevent.recurrence.every.label;"/>
|
||||
<textbox id="daily-days" size="3" oninput="validateIntegers(event);"/>
|
||||
<textbox id="daily-days" value="1" size="3" oninput="validateIntegers(event); updateAccept();"/>
|
||||
<label value="&repeat.units.days;"/>
|
||||
<spacer flex="1"/>
|
||||
</hbox>
|
||||
|
@ -125,13 +134,13 @@
|
|||
|
||||
<hbox>
|
||||
<label value="&newevent.repeat.onthe.label;"/>
|
||||
<textbox value="10,23,29" size="3"/>
|
||||
<textbox value="10,23,29" size="8"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<hbox align="top">
|
||||
<label value="&newevent.recurrence.every.label;"/>
|
||||
<textbox id="yearly-years" size="3" oninput="validateIntegers(event);"/>
|
||||
<textbox id="yearly-years" value="1" size="3" oninput="validateIntegers(event); updateAccept()"/>
|
||||
<label value="&repeat.units.years;"/>
|
||||
<spacer flex="1"/>
|
||||
</hbox>
|
||||
|
@ -160,7 +169,7 @@
|
|||
<row>
|
||||
<radio label="&newevent.repeat.for.label;" value="ntimes"/>
|
||||
<hbox>
|
||||
<textbox id="repeat-ntimes-count" size="3" oninput="validateIntegers(event);"/>
|
||||
<textbox id="repeat-ntimes-count" size="3" value="5" oninput="validateIntegers(event); updateAccept();"/>
|
||||
<spacer flex="0.5"/>
|
||||
<menulist id="repeat-ntimes-units">
|
||||
<menupopup>
|
||||
|
@ -173,6 +182,15 @@
|
|||
<spacer flex="1"/>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<spacer/>
|
||||
<label id="repeat-numberoftimes-warning"
|
||||
class="warning-text-class"
|
||||
value="&newevent.recurnumberoftimes.warning;"
|
||||
hidden="true"/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<radio label="&newevent.repeat.until.label;" value="until"/>
|
||||
<hbox>
|
||||
|
|
|
@ -199,26 +199,6 @@ function launchPreferences()
|
|||
window.openDialog("chrome://calendar/content/pref/prefBird.xul", "PrefWindow", "chrome,titlebar,resizable,modal");
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the new event button is clicked
|
||||
*/
|
||||
var gNewDateVariable = null;
|
||||
|
||||
function newEventCommand( event )
|
||||
{
|
||||
newEvent();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when the new task button is clicked
|
||||
*/
|
||||
|
||||
function newToDoCommand()
|
||||
{
|
||||
newToDo( null, null ); // new task button defaults to undated todo
|
||||
}
|
||||
|
||||
function newCalendarDialog()
|
||||
{
|
||||
openCalendarWizard();
|
||||
|
@ -303,7 +283,7 @@ function newEvent(startDate, endDate, allDay)
|
|||
|
||||
var calendar = getSelectedCalendarOrNull();
|
||||
|
||||
editNewEvent( calendarEvent, calendar );
|
||||
createEventWithDialog(calendar, null, null, null, calendarEvent);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -342,7 +322,7 @@ function newToDo ( startDate, dueDate )
|
|||
|
||||
var calendar = getSelectedCalendarOrNull();
|
||||
|
||||
editNewToDo(calendarToDo, calendar);
|
||||
createTodoWithDialog(calendar, null, null, calendarToDo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -359,133 +339,11 @@ function getSelectedCalendarOrNull()
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch the event dialog to edit a new (created, imported, or pasted) event.
|
||||
* 'calendar' is a calICalendar object.
|
||||
* When the user clicks OK "addEventDialogResponse" is called
|
||||
*/
|
||||
|
||||
function editNewEvent( calendarEvent, calendar )
|
||||
{
|
||||
openEventDialog(calendarEvent,
|
||||
"new",
|
||||
self.addEventDialogResponse,
|
||||
calendar);
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch the todo dialog to edit a new (created, imported, or pasted) ToDo.
|
||||
* 'calendar' is a calICalendar object.
|
||||
* When the user clicks OK "addToDoDialogResponse" is called
|
||||
*/
|
||||
function editNewToDo( calendarToDo, calendar )
|
||||
{
|
||||
openEventDialog(calendarToDo,
|
||||
"new",
|
||||
self.addToDoDialogResponse,
|
||||
calendar);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the user clicks OK in the new event dialog
|
||||
* 'calendar' is a calICalendar object.
|
||||
*
|
||||
* Updates the data source. The unifinder views and the calendar views will be
|
||||
* notified of the change through their respective observers.
|
||||
*/
|
||||
|
||||
function addEventDialogResponse( calendarEvent, calendar )
|
||||
{
|
||||
saveItem( calendarEvent, calendar, "addEvent" );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when the user clicks OK in the new to do item dialog
|
||||
* 'calendar' is a calICalendar object.
|
||||
*/
|
||||
|
||||
function addToDoDialogResponse( calendarToDo, calendar )
|
||||
{
|
||||
addEventDialogResponse(calendarToDo, calendar);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper function to launch the event dialog to edit an event.
|
||||
* When the user clicks OK "modifyEventDialogResponse" is called
|
||||
*/
|
||||
|
||||
function editEvent( calendarEvent )
|
||||
{
|
||||
openEventDialog(calendarEvent,
|
||||
"edit",
|
||||
self.modifyEventDialogResponse,
|
||||
null);
|
||||
}
|
||||
|
||||
function editToDo( calendarTodo )
|
||||
{
|
||||
openEventDialog(calendarTodo,
|
||||
"edit",
|
||||
self.modifyEventDialogResponse,
|
||||
null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the user clicks OK in the edit event dialog
|
||||
* 'calendar' is a calICalendar object.
|
||||
*
|
||||
* Update the data source, the unifinder views and the calendar views will be
|
||||
* notified of the change through their respective observers
|
||||
*/
|
||||
|
||||
function modifyEventDialogResponse( calendarEvent, calendar, originalEvent )
|
||||
{
|
||||
saveItem( calendarEvent, calendar, "modifyEvent", originalEvent );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when the user clicks OK in the edit event dialog
|
||||
* 'calendar' is a calICalendar object.
|
||||
*
|
||||
* Update the data source, the unifinder views and the calendar views will be
|
||||
* notified of the change through their respective observers
|
||||
*/
|
||||
|
||||
function modifyToDoDialogResponse( calendarToDo, calendar, originalToDo )
|
||||
{
|
||||
modifyEventDialogResponse(calendarToDo, calendar, originalToDo);
|
||||
}
|
||||
|
||||
|
||||
/** PRIVATE: open event dialog in mode, and call onOk if ok is clicked.
|
||||
'mode' is "new" or "edit".
|
||||
'calendar' is default calICalendar, typically from getSelectedCalendarOrNull
|
||||
**/
|
||||
function openEventDialog(calendarEvent, mode, onOk, calendar)
|
||||
{
|
||||
// set up a bunch of args to pass to the dialog
|
||||
var args = new Object();
|
||||
args.calendarEvent = calendarEvent;
|
||||
args.mode = mode;
|
||||
args.onOk = onOk;
|
||||
|
||||
if( calendar )
|
||||
args.calendar = calendar;
|
||||
|
||||
// wait cursor will revert to auto in eventDialog.js loadCalendarEventDialog
|
||||
window.setCursor( "wait" );
|
||||
// open the dialog modally
|
||||
openDialog("chrome://calendar/content/eventDialog.xul", "caEditEvent", "chrome,titlebar,modal", args );
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called from the unifinder's edit command
|
||||
*/
|
||||
|
||||
function editEventCommand()
|
||||
function editEvent()
|
||||
{
|
||||
if( gCalendarWindow.EventSelection.selectedEvents.length == 1 )
|
||||
{
|
||||
|
@ -493,33 +351,18 @@ function editEventCommand()
|
|||
|
||||
if( calendarEvent != null )
|
||||
{
|
||||
editEvent( calendarEvent.parentItem );
|
||||
modifyEventWithDialog(calendarEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function editToDo(task) {
|
||||
if (!task)
|
||||
return;
|
||||
|
||||
//originalEvent is the item before edits were committed,
|
||||
//used to check if there were external changes for shared calendar
|
||||
function saveItem( calendarEvent, calendar, functionToRun, originalEvent )
|
||||
{
|
||||
dump(functionToRun + " " + calendarEvent.title + "\n");
|
||||
|
||||
if (functionToRun == 'addEvent') {
|
||||
doTransaction('add', calendarEvent, calendar, null, null);
|
||||
} else if (functionToRun == 'modifyEvent') {
|
||||
// compare cal.uri because there may be multiple instances of
|
||||
// calICalendar or uri for the same spec, and those instances are
|
||||
// not ==.
|
||||
if (!originalEvent.calendar ||
|
||||
(originalEvent.calendar.uri.equals(calendar.uri)))
|
||||
doTransaction('modify', calendarEvent, calendar, originalEvent, null);
|
||||
else
|
||||
doTransaction('move', calendarEvent, calendar, originalEvent, null);
|
||||
}
|
||||
modifyEventWithDialog(task);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This is called from the unifinder's delete command
|
||||
*
|
||||
|
|
|
@ -83,10 +83,10 @@
|
|||
<broadcaster id="is_editable" hidden="false"/>
|
||||
</broadcasterset>
|
||||
<commandset id="calendar_commands">
|
||||
<command id="new_command" oncommand="newEventCommand( event )"/>
|
||||
<command id="new_command" oncommand="newEvent()"/>
|
||||
<command id="delete_command" oncommand="deleteEventCommand( )" disabled="true" disabledwhennoeventsselected="true"/>
|
||||
<command id="delete_command_no_confirm" oncommand="deleteEventCommand( true )" disabled="true" disabledwhennoeventsselected="true"/>
|
||||
<command id="modify_command" oncommand="editEventCommand()" disabled="true" disabledwhennoeventsselected="true"/>
|
||||
<command id="modify_command" oncommand="editEvent()" disabled="true" disabledwhennoeventsselected="true"/>
|
||||
<command id="send_event_command" oncommand="sendEvent()" disabled="true" disabledwhennoeventsselected="true"/>
|
||||
<command id="print_command" oncommand="print()"/>
|
||||
<command id="undo_command" oncommand="undo()" disabled="true"/>
|
||||
|
@ -96,8 +96,8 @@
|
|||
<command id="paste_command" oncommand="pasteFromClipboard()"/>
|
||||
<command id="select_all_command" oncommand="selectAllEvents()"/>
|
||||
|
||||
<command id="new_todo_command" oncommand="newToDoCommand()"/>
|
||||
<command id="modify_todo_command" oncommand="modifyToDoCommand( event )"/>
|
||||
<command id="new_todo_command" oncommand="newToDo()"/>
|
||||
<command id="modify_todo_command" oncommand="editToDo()"/>
|
||||
<command id="delete_todo_command" oncommand="deleteToDoCommand()" disabled="true"/>
|
||||
|
||||
<command id="new_calendar_command" oncommand="newCalendarDialog()"/>
|
||||
|
@ -229,6 +229,7 @@
|
|||
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendar.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendar-item-editing.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarSelection.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarWindow.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/mouseoverPreviews.js"/>
|
||||
|
|
|
@ -77,7 +77,7 @@ calViewController.prototype.modifyOccurrence = function (aOccurrence, aNewStartT
|
|||
instance.endDate = aNewEndTime;
|
||||
doTransaction('modify', instance, instance.calendar, aOccurrence, null);
|
||||
} else {
|
||||
editEventCommand();
|
||||
editEvent();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,10 +28,18 @@ calendar.jar:
|
|||
content/calendar/calendar-decorated-multiweek-view.xml (/calendar/base/content/calendar-decorated-multiweek-view.xml)
|
||||
content/calendar/calendar-decorated-month-view.xml (/calendar/base/content/calendar-decorated-month-view.xml)
|
||||
content/calendar/calendar-decorated-views.css (/calendar/base/content/calendar-decorated-views.css)
|
||||
content/calendar/calendar-dialog-utils.js (/calendar/base/content/calendar-dialog-utils.js)
|
||||
content/calendar/calendar-event-dialog.js (/calendar/base/content/calendar-event-dialog.js)
|
||||
content/calendar/calendar-event-dialog.css (/calendar/base/content/calendar-event-dialog.css)
|
||||
content/calendar/calendar-event-dialog.xul (/calendar/base/content/calendar-event-dialog.xul)
|
||||
content/calendar/calendar-item-editing.js (/calendar/base/content/calendar-item-editing.js)
|
||||
content/calendar/calendar-month-view.css (/calendar/base/content/calendar-month-view.css)
|
||||
content/calendar/calendar-month-view.xml (/calendar/base/content/calendar-month-view.xml)
|
||||
content/calendar/calendar-multiday-view.css (/calendar/base/content/calendar-multiday-view.css)
|
||||
content/calendar/calendar-multiday-view.xml (/calendar/base/content/calendar-multiday-view.xml)
|
||||
content/calendar/calendar-recurrence-dialog.js (/calendar/base/content/calendar-recurrence-dialog.js)
|
||||
content/calendar/calendar-recurrence-dialog.xul (/calendar/base/content/calendar-recurrence-dialog.xul)
|
||||
|
||||
content/calendar/calendarUtils.js (content/calendarUtils.js)
|
||||
* content/calendar/calendar.xul (content/calendar.xul)
|
||||
content/calendar/calendarMail.js (content/calendarMail.js)
|
||||
|
@ -50,8 +58,6 @@ calendar.jar:
|
|||
content/calendar/calendarProperties.js (content/calendarProperties.js)
|
||||
content/calendar/clipboard.js (content/clipboard.js)
|
||||
content/calendar/dateUtils.js (content/dateUtils.js)
|
||||
content/calendar/eventDialog.js (content/eventDialog.js)
|
||||
* content/calendar/eventDialog.xul (content/eventDialog.xul)
|
||||
content/calendar/goToDateDialog.js (content/goToDateDialog.js)
|
||||
content/calendar/goToDateDialog.xul (content/goToDateDialog.xul)
|
||||
content/calendar/import-export.js (/calendar/base/content/import-export.js)
|
||||
|
@ -62,7 +68,6 @@ calendar.jar:
|
|||
content/calendar/publish.js (content/publish.js)
|
||||
content/calendar/publishDialog.js (content/publishDialog.js)
|
||||
content/calendar/publishDialog.xul (content/publishDialog.xul)
|
||||
content/calendar/selectAddressesDialog.js (content/selectAddressesDialog.js)
|
||||
content/calendar/sound.wav (content/sound.wav)
|
||||
content/calendar/unifinder.js (content/unifinder.js)
|
||||
content/calendar/unifinderToDo.js (content/unifinderToDo.js)
|
||||
|
@ -104,11 +109,9 @@ calendar.jar:
|
|||
skin/classic/calendar/calendartoolbar.png (skin/classic/calendartoolbar.png)
|
||||
skin/classic/calendar/calendartoolbar_small.png (skin/classic/calendartoolbar_small.png)
|
||||
skin/classic/calendar/dialogOverlay.css (skin/classic/dialogOverlay.css)
|
||||
skin/classic/calendar/eventDialog.css (skin/classic/eventDialog.css)
|
||||
skin/classic/calendar/overlay.css (skin/classic/overlay.css)
|
||||
skin/classic/calendar/prefs.css (skin/classic/prefs.css)
|
||||
skin/classic/calendar/prevnextarrow.png (skin/classic/prevnextarrow.png)
|
||||
skin/classic/calendar/selectAddresses.css (skin/classic/selectAddresses.css)
|
||||
skin/classic/calendar/synch_animated.gif (skin/classic/synch_animated.gif)
|
||||
skin/classic/calendar/datetimepickers/datetimepickers.css (skin/classic/datetimepickers/datetimepickers.css)
|
||||
skin/classic/calendar/datetimepickers/minimonth.css (skin/classic/datetimepickers/minimonth.css)
|
||||
|
@ -136,11 +139,9 @@ calendar.jar:
|
|||
skin/modern/calendar/calendartoolbar.png (skin/modern/calendartoolbar.png)
|
||||
skin/modern/calendar/calendartoolbar_small.png (skin/modern/calendartoolbar_small.png)
|
||||
skin/modern/calendar/dialogOverlay.css (skin/modern/dialogOverlay.css)
|
||||
skin/modern/calendar/eventDialog.css (skin/modern/eventDialog.css)
|
||||
skin/modern/calendar/overlay.css (skin/modern/overlay.css)
|
||||
skin/modern/calendar/prefs.css (skin/modern/prefs.css)
|
||||
skin/modern/calendar/prevnextarrow.png (skin/modern/prevnextarrow.png)
|
||||
skin/modern/calendar/selectAddresses.css (skin/modern/selectAddresses.css)
|
||||
skin/modern/calendar/synch_animated.gif (skin/modern/synch_animated.gif)
|
||||
skin/modern/calendar/taskbar-cal.gif (skin/modern/taskbar-cal.gif)
|
||||
skin/modern/calendar/taskbar-cal-act.gif (skin/modern/taskbar-cal-act.gif)
|
||||
|
@ -175,7 +176,6 @@ calendar-@AB_CD@.jar:
|
|||
locale/@AB_CD@/calendar/menuOverlay.dtd (locale/@AB_CD@/menuOverlay.dtd)
|
||||
locale/@AB_CD@/calendar/overlay.dtd (locale/@AB_CD@/overlay.dtd)
|
||||
* locale/@AB_CD@/calendar/prefs.dtd (locale/@AB_CD@/prefs.dtd)
|
||||
locale/@AB_CD@/calendar/selectAddresses.dtd (locale/@AB_CD@/selectAddresses.dtd)
|
||||
#ifdef MOZ_SUNBIRD
|
||||
locale/@AB_CD@/calendar/connectionPrefs.dtd (locale/@AB_CD@/connectionPrefs.dtd)
|
||||
locale/@AB_CD@/calendar/prefutilities.properties (locale/@AB_CD@/prefutilities.properties)
|
||||
|
|
|
@ -52,6 +52,9 @@
|
|||
<!ENTITY alarm.units.hours.singular "hour " >
|
||||
<!ENTITY alarm.units.days.singular "day " >
|
||||
|
||||
<!ENTITY alarm.start.warning "This alarm requires a starting date" >
|
||||
<!ENTITY alarm.due.warning "This alarm requires a due date" >
|
||||
|
||||
<!ENTITY repeat.units.days.both "Day(s)" >
|
||||
<!ENTITY repeat.units.weeks.both "Week(s)" >
|
||||
<!ENTITY repeat.units.months.both "Month(s)" >
|
||||
|
@ -85,7 +88,7 @@
|
|||
<!ENTITY newevent.from.label "From" >
|
||||
<!ENTITY newevent.to.label "To" >
|
||||
<!ENTITY newevent.enddate.label "End" >
|
||||
<!ENTITY newevent.set.label "set..." >
|
||||
<!ENTITY newevent.set.label "Set pattern..." >
|
||||
<!ENTITY newevent.settings.label "General Settings" >
|
||||
<!ENTITY newevent.none.label "none" >
|
||||
<!ENTITY newevent.custom.label "Custom..." >
|
||||
|
@ -160,6 +163,7 @@
|
|||
|
||||
<!ENTITY newevent.attendees.tab.label "Attendees" >
|
||||
<!ENTITY newevent.attendees.label "Attendees" >
|
||||
<!ENTITY calendar.edit.attendees "Edit Attendees" >
|
||||
<!ENTITY newevent.attachments.tab.label "Attachments" >
|
||||
<!ENTITY newevent.advanced.tab.label "Advanced" >
|
||||
<!ENTITY newevent.completed.label "Completed" >
|
||||
|
@ -272,6 +276,9 @@
|
|||
<!ENTITY calendar.listofcalendarstab.label "Calendars">
|
||||
<!ENTITY calendar.gototoday.button.label "Go to Today" >
|
||||
|
||||
<!ENTITY calendar.more.label "More">
|
||||
<!ENTITY calendar.less.label "Less">
|
||||
|
||||
<!ENTITY calendar.calendarlistbox.label "Calendars">
|
||||
|
||||
<!ENTITY calendar.events.filter.all.label "All Events">
|
||||
|
|
|
@ -129,6 +129,7 @@ defaulteventalarmunit=minutes
|
|||
defaulttodoalarmunit=minutes
|
||||
|
||||
Week=Week
|
||||
None=None
|
||||
|
||||
# Alarm
|
||||
TooManyAlarmsMessage=You have %1$S total alarms. We've shown you the last 6. Click Acknowledge All to clear them all.
|
||||
|
|
|
@ -72,6 +72,7 @@
|
|||
<script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
|
||||
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendar.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendar-item-editing.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarSelection.js"/>
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/calendarWindow.js"/>
|
||||
|
|
|
@ -46,10 +46,10 @@
|
|||
</broadcasterset>
|
||||
|
||||
<commandset id="calendar_commands">
|
||||
<command id="new_command" oncommand="newEventCommand( event )"/>
|
||||
<command id="new_command" oncommand="newEvent()"/>
|
||||
<command id="delete_command" oncommand="deleteEventCommand( )" disabled="true" disabledwhennoeventsselected="true"/>
|
||||
<command id="delete_command_no_confirm" oncommand="deleteEventCommand( true )" disabled="true" disabledwhennoeventsselected="true"/>
|
||||
<command id="modify_command" oncommand="editEventCommand()" disabled="true" disabledwhennoeventsselected="true"/>
|
||||
<command id="modify_command" oncommand="editEvent()" disabled="true" disabledwhennoeventsselected="true"/>
|
||||
<command id="send_event_command" oncommand="sendEvent()" disabled="true" disabledwhennoeventsselected="true"/>
|
||||
<command id="print_command" oncommand="print()"/>
|
||||
|
||||
|
@ -60,8 +60,8 @@
|
|||
<command id="paste_command" oncommand="pasteFromClipboard()"/>
|
||||
<command id="select_all_command" oncommand="selectAllEvents()"/>
|
||||
|
||||
<command id="new_todo_command" oncommand="newToDoCommand()"/>
|
||||
<command id="modify_todo_command" oncommand="modifyToDoCommand( event )"/>
|
||||
<command id="new_todo_command" oncommand="newToDo()"/>
|
||||
<command id="modify_todo_command" oncommand="editToDo()"/>
|
||||
<command id="delete_todo_command" oncommand="deleteToDoCommand()" disabled="true"/>
|
||||
|
||||
<command id="new_calendar_command" oncommand="newCalendarDialog()"/>
|
||||
|
|
Загрузка…
Ссылка в новой задаче