Disk Clock 2.4

I just published Day Disk 2.4 out to the Chrome App Store. It has a background mode and will also save settings between runs. I’m thinking about publishing Disk Clock, but there is all the overhead work of making screen shots, etc.

Pause for a moment

One cost of enabling full scaling was that drawing a larger image takes more time. I was especially concerned about this in the browser scenario where it is running all the time – Dashboard had events that told you when the application was being shown or hid. A little research turned up some events (blur and focus) on window or document that could be used to determine when the tab or browser (depending on the browser) lost focus.

Save it for later

Even with the pause support, one usage model is to open the clock only when needed. However, Chrome doesn’t support the Dashboard widget preference API. I had the browser URL-based method, but that didn’t survive relaunch. I implemented HTML local storage quite easily. Only possible downside is that Chrome doesn’t provide any system support for multiple instances with different settings.

Extraction team

While I was working, I pulled out a few more psuedo-classes to try and pare down the main code file. The highlight overlay and disk-collection have been extracted to their own files.

What’s your name again?

I’ve been setting the application name, but I realized that Chrome was actually using the HTML title for the tab. I went ahead and turned the main HTML file into template a little while ago, so I made the build name available and updated the title.

New improved ugliness

Meanwhile, I’m working a presentation about RequireJS for the Chicago Javascript Meetup group, so I updated to RequireJS 0.24. In the two revisions difference, it changed the base path discovery method and code minifiers. The base path tripped me up a little bit because the ‘main file’ actually coming out of a builds subdirectory, whereas in most applications it would come from the script root. The optimizer changed to Uglify.js. I’m enjoying the much faster builds, although I had to install Node.js to make it run.

Passing around the ugly stick

I also reflected on the fact that a few files which were being loaded by direct script tag were escaping the optimization process. I added some extra build steps to compress them while copying. In the case of RequireJS itself, this proved a bit tricky, since it seems to have a special exception for itself. Fortunately, an optimizer argument can include RequireJS, so it gets both added and removed at the same time.

Speech Timer

Since I’ve started working on Toastmasters, I tried making a speech timer disk. There are great number of speech timers out there (I like this speech timer so far), but besides playing with my own toy, I wanted a bit more resolution on the early practice runs so I had better feedback for adjusting things.

Posted Saturday, March 19th, 2011 under Devlog.

Comments are closed.