bug 310258 - Adds 'Show completed tasks' to Lightning. Patch by jminta. r=lilmatt,ctalbert
git-svn-id: svn://10.0.0.236/trunk@214395 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
]]></destructor>
|
||||
|
||||
<field name="mCalendar">null</field>
|
||||
<field name="mShowCompleted">true</field>
|
||||
<field name="mOperationListener"><![CDATA[
|
||||
({
|
||||
todoList: this,
|
||||
@@ -167,6 +168,14 @@
|
||||
]]></setter>
|
||||
</property>
|
||||
|
||||
<property name="showCompleted">
|
||||
<getter><![CDATA[ return this.mShowCompleted; ]]></getter>
|
||||
<setter><![CDATA[
|
||||
this.mShowCompleted = val;
|
||||
this.rebuildDisplay();
|
||||
]]></setter>
|
||||
</property>
|
||||
|
||||
<method name="fireEvent">
|
||||
<parameter name="aEventType"/>
|
||||
<body><![CDATA[
|
||||
@@ -207,7 +216,12 @@
|
||||
if (!this.mCalendar)
|
||||
return;
|
||||
const cIC = Components.interfaces.calICalendar;
|
||||
var filter = cIC.ITEM_FILTER_TYPE_TODO | cIC.ITEM_FILTER_COMPLETED_ALL;
|
||||
var filter = cIC.ITEM_FILTER_TYPE_TODO;
|
||||
if (this.mShowCompleted) {
|
||||
filter |= cIC.ITEM_FILTER_COMPLETED_ALL;
|
||||
} else {
|
||||
filter |= cIC.ITEM_FILTER_COMPLETED_NO;
|
||||
}
|
||||
this.mCalendar.getItems(filter, 0, null, null, this.mOperationListener);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
@@ -45,6 +45,10 @@
|
||||
|
||||
<script type="application/x-javascript" src="chrome://lightning/content/todo-list.js"/>
|
||||
<vbox id="todo-tab-panel" flex="1">
|
||||
<checkbox id="completed-tasks-checkbox"
|
||||
label="&lightning.sidebar.showCompletedTasks.label;"
|
||||
persist="checked"
|
||||
oncommand="toggleCompletedTasks()" />
|
||||
<calendar-todo-list id="calendar-todo-list" flex="1"/>
|
||||
</vbox>
|
||||
</overlay>
|
||||
|
||||
@@ -70,6 +70,15 @@ function initializeTodoList()
|
||||
todoList.addEventListener("todo-item-open", editTodoItem, false);
|
||||
todoList.addEventListener("todo-item-delete", deleteTodoItem, false);
|
||||
todoList.addEventListener("todo-empty-dblclick", newTodoItem, false);
|
||||
todoList.showCompleted = document.getElementById("completed-tasks-checkbox").checked;
|
||||
return;
|
||||
}
|
||||
|
||||
function toggleCompletedTasks()
|
||||
{
|
||||
document.getElementById("calendar-todo-list").showCompleted =
|
||||
!document.getElementById("calendar-todo-list").showCompleted;
|
||||
return;
|
||||
}
|
||||
|
||||
window.addEventListener("load", initializeTodoList, false);
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
<!ENTITY lightning.sidebar.edit.label "Edit…">
|
||||
<!ENTITY lightning.sidebar.delete.label "Delete">
|
||||
<!ENTITY lightning.calendar.label "Calendar">
|
||||
<!ENTITY lightning.sidebar.showCompletedTasks.label "Show completed tasks">
|
||||
|
||||
<!-- Messenger Toolbar -->
|
||||
<!ENTITY lightning.toolbar.dayview.label "Day View">
|
||||
|
||||
Reference in New Issue
Block a user