Thursday, 1. March 2007, 20:57:53
photography
Wednesday, 31. May 2006, 08:08:46
code
As you may know, when setting and retrieving stored values in widgets using the two functions
setPreferenceForKey and
preferenceForKey you can only use a string as an argument. I have created a library which acts as a wrapper for these functions, extending their support to:
- String
- Boolean
- Number
- Date
- Array
- Object
Best of all, the arrays and objects can be of any depth and even allow cyclic (or recursive) references. All you have to do is download the file below and load it in your page before your script executes.
Download the libraryNotes
- If you try to call a preference which has not been set then the null value will be returned instead of the usual empty string.
- Attempting to save a function will instead save the string "[Function]".
Updates
-
4 Jun 2007
Fixed a bug regarding some recursive patterns.
Added a licence.
Sunday, 14. May 2006, 14:24:54
ramblings
Over the next three months I will be making various widgets for the widget competition.
I will mostly be utilising the canvas drawing functions.
Hopefully I will take out some prizes.
That's about it.