Monday, March 8, 2010

Stoplight gadget 1.7

This week I am still working on the stoplight gadget. Hopefully, this will be the final touches on the stoplight gadget. The other two people in my group are working on the wattdepot monitor gadget. The modifications that we have made to the stoplight gadget this week are minor changes that will enhance the user experience while using the gadget.

The modifications are: for the gadget window to automatically adjust its height when the image size changes, the entire page does not refresh every time the reload time expires, and move the title of the gadget from the top of the gadget window to above the stoplight image. In our previous version (version 1.6), there is a lot of extra white space beneath the gadget when user would change the image size.

Luckily, this was very simple to fix since there is already a 'dynamic-height' feature in the google gadget api. So I only had to add a few lines of code.

The most tricky part of this weeks changes were getting the old values to change without changing the entire script. I originally thought that I would have had to add in some AJAX code to get the image, message, and units to all refresh without refreshing the entire page. I needed to find a way to trigger the event. Using the setTimeout() javascript function, I was able to get the images to reload without refreshing the entire page.

0 comments:

Post a Comment