Hacking Lightning

I've been using the Lightning calendaring extension for Mozilla Thunderbird for the last couple of months for basic calendaring and it works pretty awesome.

After Rama hassled me about keeping my task list on my whiteboard at work, I decided to try out the Task lists functionality in Lightning. Its pretty light weight, easy to add a task, almost exactly what I need.

However, one thing that bugged was the predefined views. There's about four or five including a "Not Started" view and a "Completed" view, but none for what I really wanted, a "Not Completed" view. So I decided to add one.

What I really wanted was to add another view, but even though I appeared to tweak all the files necessary, it didn't work. So in the end I just changed the "Overdue" view to "Overview & Open". And it was really easy one I found my way around.

The tweak involves modifying files in two jars; calendar.jar & calendar-en-US.jar both located in ~/.thunderbird/(profile)/extensions/(uuid)/chrome.

In calendar-en-US.jar I wanted to change the label of the button from "Overdue" to "Overview & Open". This is done by unzipping the file, editing locale/en-US/calendar/calendar.dtd. and rezipping the file, changing the line

<!ENTITY calendar.task.filter.overdue.label         "Overdue">

to

<!ENTITY calendar.task.filter.overdue.label         "Overdue & Open">

Now, in the second jar calendar.jar, I needed to change the logic for deciding what was "overdue". This logic is in content/calendar/calendar-task-view.js The original logic is in the lines

        overdue: function filterOverdue(item) {
          // in case the item has no due date
          // it can't be overdue by definition
          if (item.dueDate == null) {
              return false;
          }
          return (percentCompleted(item) < 100) &&
                 !(item.dueDate.compare(now()) > 0);
        },

Which you can see they make a specific provision for excluding things with no dueDate. Many of my tasks do not have a dueDate and so I want to see those too. So I changed the logic to

        overdue: function filterOverdue(item) {
	return (percentCompleted(item) < 100 && 
		 (item.dueDate == null || !(item.dueDate.compare(now()) > 0)));
        },

Once I repacked the jars, voila, I now have the behavior I desired.

Comments:

Very nifty, Joe! Nice to see you in the blogsphere!

Posted by Dana Nourie on September 08, 2008 at 08:03 AM PDT #

Does your modified logic display tasks that are both overdue and also due 'today'?
Also, can one make a similar change to the 'Today' pane (Mail tab) so that tasks are filtered with the above logic? Now it doesn't seem to allow any filtering, predefined or otherwise.
I'm using Lightning 0.9RC1
Thanks for thinking out of the box!

Posted by Elliot on September 12, 2008 at 09:25 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

mock

Search

Top Tags
Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
Bookmarks
Blogroll

No bookmarks in folder