Disk Clock 1.12: Bookmarked

Disk Clock latest 1.12. Animation tweaking, getting rid of invisible things, more css based properties. Now uses url parameters, so it’s possible to bookmark configurations when using it in the browser. I’ve been toying with the idea of allowing the user to hide controls to get to all of them, but I think I’ve been working DC too long, so I’m calling it a release.

The size that wasn’t there.

The dashboard property file has a specifier for the widget’s size. I noticed that the attributes were tagged as ‘string’, even though the close box positions were numbers. I’ve noticed that the size doesn’t start out as big as it should, so I tried changing the type. It worked all right. it also stretched the default graphic out of whack, making it into an ellipse. I could perhaps add a bunch of transparency, but it would be wasteful and may cause other problems. I just deleted the attributes since they weren’t doing anything.

Tweaky tweaky tweaky

I got a little overeager with the animation function, and it could really fly on a jump. I did a lot of tweaking with the birthday disk, which has only a single mark. Anyway, with a bunch of visible marks, a little rotation goes a long way. With only one, the same amount looks kind of weak. I made the speed inversely proportional to the number of marks, and scaled back the animation function a bit.

By the way, I think it’s no coincidence that Apple does lots of animation effects, and that OS X ships with Grapher.app.

If you can’t see it, is it really there?

I found out that some disks had more marks then they were ever going to show, especially the birthday disk with 365 days and only one visible mark. Marks get added and removed as the disks change scale, but I realized that it was possible to calculate the largest possible size and cut the fat.

Playing Catch with IE8

I toyed with IE 8 briefly. One minor thing I may or may not look into (if the sidebars on my homepages get small enough to have a scrollbar, it comes up disabled.) Still no canvas, but explorercanvas works just as well (slowly) as before. Or at least my patched version does. I really ought to publish those sometime.

Anyway, I noticed that the non-canvas error was especially unhelpful, so I put in a catch/rethrow with a slightly more informative message. Or, at least it’s more informative on the browsers I have at home. Along the way I tweaked my subclass routine so I could make a family application exceptions.

I will not submit!

In the course of playing with new dynamic controls, I discovered that Safari’s default behavior is to submit the form given a return in a text field. This is mildly annoying in the browser, and rather problematic in the widget – there is no ‘back’, and it loses the reference to the widget environment. After poking around a bit, and finally realizing I couldn’t modify the DOM until it existed, I got submit blocking put in.

You will submit!

During the submit problems however, I noticed that it was going ahead and putting the preference values in the URL. This got me thinking a bit. It took a number of adjustments – such as making sure that controls had names in addition to ids, but I’ve got it set up so you can submit the form to reload with the setting configured. What’s nifty is that this is now a bookmarkable URL, so it’s possible to save settings, and I don’t even have to muck around with the new storage APIs.

Sorting things out

Url parameters can be considered somewhat ‘hard’ settings, so it’s not as necessary to be able to modify those settings again. This mean that once you set a parameter, it can be sorted lower in the list, possibly allowing more settings to be reachable. It’s a shame this scheme doesn’t work in Dashboard. Bookmarking a widget would be a nifty way to create instances.

Along the way I’ve been making lots of changes to the dynamic control code. I’ve been pursuing a separation of the settings from the control groups. I moved data validation into the store subsystem, though I haven’t used it beyond the controls yet.

Select properties for sale

One thing I’ve finally gotten into passable form is some generic controls. The disk select boxes are pretty straightforward title and select. I’ve now got a generic routine; since it does more interleaving of constants and variables it takes a little better advantage of the JSON-to-HTML process. Of course, I had to extend the process a little.

Previously I was decoding the property name to get tag attributes. I’ve now got a hook to have properties preceded with an underscore as tag attributes instead of subtags. This complicated things rather a bit, since the sub-object routine now has to return multiple values.

Doing it with style

I’ve been detecting the absence of the widget environment for some time to make some style adjustments – making the settings page visible immediately, for one. I recently realized that I ought to be just putting a class on the body and using css to make the adjustments.

Posted Tuesday, March 31st, 2009 under Devlog.

Comments are closed.