News for hackers. Stuff that matters.
Re:JQuery.Gantt by latchkey on Monday December 12, 2011 @09:31PM (#3346053)
This is really really nice.

Some suggestions:

#1. Switch to CoffeeScript. It will cut the size of the code down considerably and given that it is such a massive file, it would really help readability.

#2. Don't embed so much html into the code. That'll also cut down code and make things easier to read. I suggest something like Handlebars to render things. Yes, another dependency, but a good one.

#3. Do you really need the 'please wait' to render things? It is somewhat jarring when clicking around quickly. If anything, just switch the thing you clicked on into a spinner or display a small spinner somewhere.

#4. A lot of the date math that is going on could probably be done more easily by using momentjs. Again, another dependency, but will save you code in the long run.

#5. Grey out buttons which cannot be clicked further? Like the + and - buttons.

#6. Maybe consider integrating or building on top of the Timeline project? http://www.simile-widgets.org/timeline/

Cheers.

Re:JQuery.Gantt by taitems on Monday December 12, 2011 @10:42PM (#3346180)
In regards to momentjs and timeline, the reason I chose to develop with jQuery.Gantt was because of its lack of dependencies. I tried jQuery.GanttView and that required Date.js, which got torn to shreds earlier on Hacker News for its poor handling of varying syntaxes.
Re:JQuery.Gantt by latchkey on Monday December 12, 2011 @10:45PM (#3346185)
momentjs is actually a pretty decent library. I agree, Date.js is pretty bad.
Re:JQuery.Gantt by synnik on Monday December 12, 2011 @10:08PM (#3346115)
Some suggestions:

1) If you are going to suggest such a massive scope of changes, offer to help instead of just dumping a list out there.

2) Check to see if the poster on HN is actually the author of the article. Doesn't look like it in this case, so you may be talking into a vacuum.

3) I love that timeline widget. But it is one of the most un-intuitive and complicated things I have ever seen. I recommend re-coding its functions into a simpler library vs. adding even more complexity to timeline.

4) Dependencies can get evil. Your suggestions add quite a lot of complexity into footprint of plugin. I fear that the end result might look good to a coder, but be a bit of a nightmare to actually use in a production environment.

Re:JQuery.Gantt by latchkey on Monday December 12, 2011 @10:18PM (#3346134)
1) If you look at my github account, you can see that I've contributed quite a lot to open source over a long period of time. I've got a long history of 'helping'. Looking at your github account... oh wait...

2) Good point. Can't argue that.

3) Maybe. Maybe not. It would need to be investigated further.

4) I made those suggestions based on code I've got in production. Other than Timeline, I suggested two libraries, both of which would remove a lot of code duplication in the Gantt plugin.