Re: [Widgets] APIs and Events preference change

We've managed to implement Storage for Widget.preferences as an  
overlay over the older get/set method without any problems.

One issue though is the HTML5 doc uses some syntax that relies on a  
Rubyesque method_missing capability that just isn't present in many  
environments, including, notably, JavaScript.

E.g. the HTML 5 doc has this example:
<label> <input type="checkbox" onchange="sessionStorage.insurance =  
checked"> I want insurance on this trip. </label>
Now, we can handle this no problem:
Widget.preferences.getItem("insurance")
But:

Widget.preferences.insurance

... poses a bit more of a challenge!

Thoughts?

S

On 16 Mar 2009, at 11:57, Marcos Caceres wrote:

> 2009/3/9 Arve Bersvendsen <arveb@opera.com>:
>> On Mon, 09 Mar 2009 12:20:25 +0100, Arthur Barstow <art.barstow@nokia.com 
>> > wrote:
>>
>> Note that there is a difference between localStorage and Storage.   
>> I am assuming that an implementation will place a (different)  
>> instance of a Storage interface on the widget.preferences object.  
>> This object would not be bound to the same storage instance as  
>> window.localStorage, and instead have its origin set to that of the  
>> widget (whatever URI scheme or origin we end up with once those  
>> issues are resolved), translated: The widget interface would not  
>> end up using the same storage area.
>> This already seems to be permitted by the current spec, still  
>> residing in HTML5 [1], where there are two separate Storage  
>> instances in window.localStorage and window.sessionStorage
>>
>
> This distinction is useful for widgets, as you could basically set one
> preference that only affects a single widget instance
> (sessionStorage), while other preferences affect all widgets of a
> particular class (localStorage).
>
> -- 
> Marcos Caceres
> http://datadriven.com.au
>

Received on Monday, 16 March 2009 17:34:13 UTC