diff --git a/calendar/lightning/chrome.manifest b/calendar/lightning/chrome.manifest
index 8cf061eaa90..c74d6af2526 100644
--- a/calendar/lightning/chrome.manifest
+++ b/calendar/lightning/chrome.manifest
@@ -4,6 +4,7 @@ overlay chrome://messenger/content/messenger.xul chrome://lightning/content/mess
overlay chrome://messenger/content/preferences/preferences.xul chrome://lightning/content/messenger-overlay-preferences.xul
overlay chrome://messenger/content/messenger.xul chrome://lightning/content/messenger-overlay-toolbar.xul
overlay chrome://lightning/content/messenger-overlay-sidebar.xul chrome://lightning/content/agenda-tree-overlay.xul
+overlay chrome://lightning/content/messenger-overlay-sidebar.xul chrome://lightning/content/todo-list-overlay.xul
overlay chrome://lightning/content/lightning-standalone.xul chrome://lightning/content/messenger-overlay-sidebar.xul
skin lightning classic/1.0 jar:chrome/classic.jar!/skin/classic/lightning/
# shared pieces for chrome://calendar/
diff --git a/calendar/lightning/content/agenda-tree.js b/calendar/lightning/content/agenda-tree.js
index 50aa44c0149..e159130e2c9 100644
--- a/calendar/lightning/content/agenda-tree.js
+++ b/calendar/lightning/content/agenda-tree.js
@@ -363,6 +363,9 @@ agendaTreeView.calendarObserver = {
agendaTreeView.calendarObserver.onAddItem =
function observer_onAddItem(item)
{
+ if (!(item instanceof Components.interfaces.calIEvent))
+ return;
+
var occs = item.getOccurrencesBetween(this.agendaTreeView.today.start,
this.agendaTreeView.soon.end, {});
occs.forEach(this.agendaTreeView.addItem, this.agendaTreeView);
@@ -372,6 +375,9 @@ function observer_onAddItem(item)
agendaTreeView.calendarObserver.onDeleteItem =
function observer_onDeleteItem(item, rebuildFlag)
{
+ if (!(item instanceof Components.interfaces.calIEvent))
+ return;
+
var occs = item.getOccurrencesBetween(this.agendaTreeView.today.start,
this.agendaTreeView.soon.end, {});
occs.forEach(this.agendaTreeView.deleteItem, this.agendaTreeView);
diff --git a/calendar/lightning/content/calendar-management.js b/calendar/lightning/content/calendar-management.js
index 878825e5e44..a3c1d5a4924 100644
--- a/calendar/lightning/content/calendar-management.js
+++ b/calendar/lightning/content/calendar-management.js
@@ -4,7 +4,7 @@
var calendarPrefStyleSheet = null;
for (var i = 0; i < document.styleSheets.length; i++) {
- if (document.styleSheets[i].href == "about:blank?calendar-dynamic-style-sheet") {
+ if (document.styleSheets[i].title == "calendar-dynamic-style-sheet") {
calendarPrefStyleSheet = document.styleSheets[i];
break;
}
diff --git a/calendar/lightning/content/calendar-todo-list.css b/calendar/lightning/content/calendar-todo-list.css
new file mode 100644
index 00000000000..44fd2bc86be
--- /dev/null
+++ b/calendar/lightning/content/calendar-todo-list.css
@@ -0,0 +1,3 @@
+calendar-todo-item {
+ -moz-binding: url("calendar-todo-list.xml#calendar-todo-item");
+}
diff --git a/calendar/lightning/content/calendar-todo-list.xml b/calendar/lightning/content/calendar-todo-list.xml
new file mode 100644
index 00000000000..1e2487a6376
--- /dev/null
+++ b/calendar/lightning/content/calendar-todo-list.xml
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+ null
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " + uneval(this.checkbox.checked) + "\n");
+ clone.isCompleted = this.checkbox.checked;
+ dirty = true;
+ } else {
+ dump("checked not changed (" + uneval(this.mTodo.isCompleted) +
+ " == " + uneval(this.checkbox.checked) + "\n");
+ }
+ if (this.mTodo.title != this.label.value) {
+ clone.title = this.label.value;
+ dirty = true;
+ }
+ if (dirty) {
+ this.mTodo.calendar.modifyItem(clone, this.mTodo, null);
+ dump(clone.icalComponent.serializeToICS() + "\n");
+ this.mTodo = clone;
+ }
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/calendar/lightning/content/messenger-overlay-sidebar.js b/calendar/lightning/content/messenger-overlay-sidebar.js
index a8ab3a98dbd..e6ce1c66bc5 100644
--- a/calendar/lightning/content/messenger-overlay-sidebar.js
+++ b/calendar/lightning/content/messenger-overlay-sidebar.js
@@ -97,7 +97,6 @@ function showCalendar(aDate1, aDate2)
}
function switchView(type) {
- var messengerDisplayDeck = document.getElementById("displayDeck");
var calendarViewBox = document.getElementById("calendar-view-box");
var monthView = document.getElementById("calendar-month-view");
@@ -141,8 +140,9 @@ function selectedCalendarPane(event)
document.getElementById("displayDeck").selectedPanel =
document.getElementById("calendar-view-box");
- // give the view the calendar
- showCalendar(today());
+ // give the view the calendar, but make sure that everything
+ // has uncollapsed first before we try to relayout!
+ setTimeout(0, function() { showCalendar(today()); });
}
function LtnObserveDisplayDeckChange(event)
@@ -154,8 +154,9 @@ function LtnObserveDisplayDeckChange(event)
GetMessagePane().collapsed = true;
document.getElementById("threadpane-splitter").collapsed = true;
gSearchBox.collapsed = true;
+ document.getElementById("calendar-view-box").collapsed = false;
} else {
- // nothing to "undo" for now
+ document.getElementById("calendar-view-box").collapsed = true;
// Later: mark the view as not needing reflow due to new events coming
// in, for better performance and batching.
}
diff --git a/calendar/lightning/content/messenger-overlay-sidebar.xul b/calendar/lightning/content/messenger-overlay-sidebar.xul
index c291beb65c8..e29a1db4fd2 100644
--- a/calendar/lightning/content/messenger-overlay-sidebar.xul
+++ b/calendar/lightning/content/messenger-overlay-sidebar.xul
@@ -7,7 +7,7 @@
-
+
@@ -17,7 +17,6 @@
-
@@ -41,10 +40,12 @@
+
+
@@ -67,7 +68,7 @@
-
+
diff --git a/calendar/lightning/content/todo-list-overlay.xul b/calendar/lightning/content/todo-list-overlay.xul
new file mode 100644
index 00000000000..bf99f0e2ba0
--- /dev/null
+++ b/calendar/lightning/content/todo-list-overlay.xul
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/calendar/lightning/content/todo-list.js b/calendar/lightning/content/todo-list.js
new file mode 100644
index 00000000000..9824e2aec23
--- /dev/null
+++ b/calendar/lightning/content/todo-list.js
@@ -0,0 +1,74 @@
+/* */
+
+var todoListManager = {
+ mOuterBox: null
+};
+
+todoListManager.initialize =
+function initialize()
+{
+ this.mOuterBox = document.getElementById("todo-outer-box");
+ getCompositeCalendar().addObserver(this.calendarObserver);
+ this.populateTodoList();
+};
+
+todoListManager.addTodo =
+function addTodo(newTodo)
+{
+ dump("adding new todo " + newTodo.title + "\n");
+ var newTodoElt = document.createElement("calendar-todo-item");
+ newTodoElt.setAttribute("item-calendar", newTodo.calendar.uri.spec);
+
+ this.mOuterBox.appendChild(newTodoElt);
+
+ newTodoElt.setTodo(newTodo);
+};
+
+todoListManager.calendarOpListener =
+{
+};
+
+todoListManager.calendarOpListener.onOperationComplete =
+function listener_onOperationComplete()
+{
+ void("finished todo query!\n");
+};
+
+todoListManager.calendarOpListener.onGetResult =
+function listener_onGetResult(calendar, status, itemtype, detail, count, items)
+{
+ if (!Components.isSuccessCode(status))
+ return Components.reportError("get failed: " + status);
+
+ void("got " + count + " todos\n");
+ items.forEach(todoListManager.addTodo, todoListManager);
+};
+
+todoListManager.calendarObserver =
+{
+};
+
+todoListManager.calendarObserver.onAddItem =
+function observer_onAddItem(item)
+{
+ if (!(item instanceof Components.interfaces.calITodo))
+ return;
+
+ todoListManager.addTodo(item);
+};
+
+todoListManager.populateTodoList =
+function populateTodoList()
+{
+ const cIC = Components.interfaces.calICalendar;
+ var filter = cIC.ITEM_FILTER_TYPE_TODO | cIC.ITEM_FILTER_COMPLETED_ALL;
+ getCompositeCalendar().getItems(filter, 0, null, null, this.calendarOpListener);
+ void("started todo query!\n");
+};
+
+function initializeTodoList()
+{
+ todoListManager.initialize();
+}
+
+window.addEventListener("load", initializeTodoList, false);
diff --git a/calendar/lightning/jar.mn b/calendar/lightning/jar.mn
index 1b04aaaf3d3..780c0481438 100644
--- a/calendar/lightning/jar.mn
+++ b/calendar/lightning/jar.mn
@@ -11,6 +11,10 @@ lightning.jar:
content/lightning/lightning-preferences.xul (content/lightning-preferences.xul)
content/lightning/lightning-preferences.js (content/lightning-preferences.js)
content/lightning/messenger-overlay-toolbar.xul (content/messenger-overlay-toolbar.xul)
+ content/lightning/todo-list-overlay.xul (content/todo-list-overlay.xul)
+ content/lightning/todo-list.js (content/todo-list.js)
+ content/lightning/calendar-todo-list.css (content/calendar-todo-list.css)
+ content/lightning/calendar-todo-list.xml (content/calendar-todo-list.xml)
en-US.jar:
locale/en-US/lightning/lightning.dtd (locale/lightning.dtd)