The first two days of the week was utilized in cleaning up my previous code to get a balance between optimization and readability. Some of those updates can be seen in the discussion that I had with Alex in the pull request.
They actually included pretty trivial errors. Some of them included:
- Using jQuery's $.each() rather than a for loop.
- Remove all hard coded variables in JS like $("#comment-" + someId).
- Write less code. For example, use if (!something.length) rather than if (something.length === 0).
- Use single line if statements.
I added the filters first, which took me one day and then added an accessible Accordeon developed by Alex. As my search filters involved hiding and then showing parts of the Accordeon, it meant I had to re-initialize the Accordeon after every search to make sure everything looked perfect. For that, a small tweak was necessary, for which I have already sent a pull request.
Anyways, I am still to get a detailed code review on adding the Accordeon, which I am very eager.
Let me take the opportunity to explain the branches I have developed in my ATutor fork.
- master: My master branch is a bit messed up because I sent my first pull request (still active) to ATutor from this branch. Unless that pull request is resolved, this branch would remain obsolete.
- gsoc2013: It has updated code from ATutor and is clean. I send pull requests to this branch for code review. Acts as the pseudo master branch.
- ajax_demo: All my ajax related work is here.
- ui_browsecourses: The modifications in browse courses page is reflected in this branch.
- gsoc_head: Has all updated and merged gsoc code.
If not, then maybe it is time to switch back to SVN. Why bother with GIT ?