Right now I’m getting closer to make a pull request to the project repo.

The past few days I’ve made some major modifications compared to my Release 0.1.
I remembered the “Cathedral and the Bazaar” article by Eric Raymond.
On the article he says:

Good programmers know what to write. Great ones know what to rewrite (and reuse).

I feel that the quote applies to a great extent to the situation that I’m currently in.

First, because I’m learning new javascript tricks at the same time while writing some code, I often need look back at the code an make some modifications/improvements.
Second, I’m looking at a lot of other projects and using as a parameter. Not witting something from scratch, but utilizing the good parts as a base for my development.

I need to mention the html5PreLoader library
Besides the library being very useful for the work I’m doing on the gladius ticket, Jussi Kalliokoski, the developer who wrote the library,  was very helpful and answered a few questions I had about some specific parts and usage of the html5PreLoader.

A few key points I was able to accomplish:

  • Restructure the skeleton of the module, and fixing a problem I had before with callbacks functions.
  • Now the module triggers the onComplete callback for all resources loaded with success, the onError callback if the resources can’t be loaded, and the onCompleteAll callback when all the resources were loaded(with or without errors)
  • Implementing alternate url for resources. So if one url fails, the alternates are loaded.
  • Support for audio.
  • Validation,/browser compatibility check for images and audio.

Still to do:

  • Implement support for different contexts
  • Refactor the code
  • Write qunit tests