Tuesday, October 16, 2007

Task list

This evening I gave Long a hand finishing off the task list. He asked me to write code that let users change the name of tasks and tick tasks off when they were finished. It sounds simple but the tasks have a lot of other functionality associated with them, like drag-and-drop re-ordering and dynamic adding and removing, so it became a complicated operation.

There is a plugin for the drag-and-drop functionality, and another plugin for the click-to-edit, and they were interferring with each other. I modified the click-to-edit function so that it deactivates the other function while it is being used.

I had a lot of frustrating moments this evening when things would just not work for no apparent reason, but I've made it through in the end and got the task list completed. It's nice to use in the end. Here's a screenshot:

Monday, October 15, 2007

Error checking

This morning Long, Justin and I went through the website and created a list of things to fix on the website.

JUSTIN
-------
1) X Duplicate document type icons for .docx, .pptx and .xlsx
2) X Fix little icons on the New Version and New Doc Comment panes
3) X Make the word 'task' and 'project' in the Welcome message detect whether to pluralise or not (copy from Docs page)
4) X Dashboard titles for My Tasks and News Feed aren't there with brand new User
5) X When creating a new user, need to add folder when they choose to add a project
6) X The default task when a new Project is created needs to be assigned to the user creating the project
7) X Sample description needs to be inserted into database when new project is created upon registering a user
8) '0 secs to go' bug with commenting system
9) On Project page, if description = '', then make it 'click here to add project description'
10) Reorder My Projects list on Dashboard to be newest to oldest

LONG
-------
1) X Login page error messages for Incorrect Email/Password
2) Project and Document history and News Feed needs to be truncatable ('Show more' button)
3) Fix commenting on project error
4) Edit tasks
5) Add tasks needs to add without a page refresh
6) Document comments box bug
7) Change powerpoint slide from 'Things to fix' to 'Improvements'
8) Restyle AutoComplete
9) Create New Project styling in IE

KEEGAN
-------
1) X Remove the numbering on document versions
2) Need to be able to select yourself when assigning a task
3) X Skip the second page of the Create Project wizard if no collaborators are added
4) Need to make News Feed recognise items since last login and not just list everything
5) Validation on Create New Document
6) create_project2.php - with collaborators bug (asks for a project name)
7) First file version with a New Document needs the new filename code
8) Update project last updated time throughout

I finished the items I was assigned. Here's what the dashboard looks like now:

Sunday, October 14, 2007

Almost finished

We have finished all of the main functionality of Tabletop. Tomorrow we will go through the website and write a list of things that need to be fixed. There will doubtlessly be many bugs, but we should be able to iron them all out before the presentation on Wednesday.

Monday, October 8, 2007

Javascript problem of the day.. and a solution YAY :-)

This evening I have been working on the "Add a New Task" section of the project page. I copied across some code from the "Create a New Project" page, because both pages involve selecting person/s, entering a date and time. I got the calendar and time selector to work with no problems, but the autocompleter for the name input exhibited some strange behaviour. It is meant to show suggestions immediately below the input box, but it was showing them in the top corner of the page. See the screenshot below.




There is a lot of functionality on this page, and it has a huge amount of Javascript (including 7 different jQuery utilities). My first thought was that something else was interfering with the autocompleter, probably with its CSS.

But another possibility occured to me. On this page, the form is located in a DIV that is hidden until the user clicks to show it. That is different to the "Create a New Project" page where I have the autocompleter working. Maybe that difference was the reason it wasn't working. To test my theory, I stopped the DIV from being hidden and refreshed the page. Low and behold, the autocomplete suggestions were shown in the correct position:



I had identified what was causing the error. But I didn't have an adequate solution, because we can't leave that ugly form on the page when the user doesn't need to use it. I continued examining the page's behaviour and stepping through my code. I noted that when I clicked "Add a New Task", followed by "Cancel Adding Task", followed by "Add a New Task" again, the autocomplete suggestions were not displayed at all, let alone in the correct position. All the "Cancel Adding Task" link does is hide the DIV that the form is in, so once again, the problem was linked to the DIV being hidden.

That gave me an idea. Maybe I could initialise the autocomplete function whenever the form was shown, rather than when the page was loaded. So I changed this line of code:
$(document).ready(function() {
     $("div#addnewtask input.person").autocomplete(...);
});
to this:
$("button#addtask").click(function() {
     $("div#addnewtask input.person").autocomplete(...);
});
And it worked! Hoorah!

Friday, October 5, 2007

Uploading new file versions and commenting on them

I did some work on the Documents page, so that now users can upload new versions of files and leave comments on them. I was worried that I would have difficulty getting the file upload functionality to work. We are letting users upload any type of file, and I though that would be harder than the display picture upload, which is just images. In fact, the opposite was true. We don't need to check what the file type is and so its really easy to upload files.

We have always planned to rename uploaded files in the following format: {file_version_id}.{extension}. In our original database design, we intended to save this filename in the database. But I realised that by including the file version id we are creating redundant data by storing the primary key twice. So I decided to only store the file extension. We will work out file names on the fly when we need them, by joining the file version id with the extension.

Wednesday, October 3, 2007

Comments on documents

I wrote a little section for the Project page Long has been working on. Now people can write comments on the page. It follows the same-page AJAX functionality we have used elsewhere. I'm getting the hang of AJAX now.