updated remoteStorage.js API

18 views
Skip to first unread message

Michiel de Jong

unread,
Dec 4, 2011, 12:43:53 PM12/4/11
to unhosted
Hi!

Please refer to http://unhosted.org/ to see the new way to use our client-side library. For the time being, there is no support for parallel sessions, nor for real-time update notifications. It just reviews the content of localStorage every 5 seconds and 'autosaves' as necessary. I think for the vast majority of use cases this is a big step forward. You have to say which 'category' your app's data belongs to, for instance 'documents', 'pictures', 'contacts' etcetera. And you have to provide an onChange function. It will be called once for every localStorage key that is changed as a result of pulling in data.

The following seven categories are under the regime of our design dictator:
public
calendars
contacts
documents
pictures
videos
music

all others are free for land grab. If you claim a category for use by your web app, then please be so kind to record this on https://github.com/unhosted/website/wiki/Categories

So the javascript API will be:

   <script src="http://unhosted.org/remoteStorage.js">{
      onChange: function(key, oldValue, newValue) {
        if(key=='text') {
          document.getElementById('textfield').value= newValue;
        }
      },
      category: 'documents'
    }</script>

Let me know if this makes sense to you or not.


Cheers!
Michiel

Melvin Carvalho

unread,
Dec 4, 2011, 8:09:07 PM12/4/11
to unho...@googlegroups.com
On 4 December 2011 18:43, Michiel de Jong <mic...@unhosted.org> wrote:
> Hi!
>
> Please refer to http://unhosted.org/ to see the new way to use our
> client-side library. For the time being, there is no support for parallel
> sessions, nor for real-time update notifications. It just reviews the
> content of localStorage every 5 seconds and 'autosaves' as necessary. I
> think for the vast majority of use cases this is a big step forward. You
> have to say which 'category' your app's data belongs to, for instance
> 'documents', 'pictures', 'contacts' etcetera. And you have to provide an
> onChange function. It will be called once for every localStorage key that is
> changed as a result of pulling in data.
>
> The following seven categories are under the regime of our design dictator:
> public
> calendars
> contacts
> documents
> pictures
> videos
> music

Reminds me a lot of the standard directories

Just thinking out loud:

What about "home" which is also part of ubuntu, or perhaps if you want
something like a home page you can use public?

Jan-Christoph Borchardt

unread,
Dec 7, 2011, 10:58:39 AM12/7/11
to unho...@googlegroups.com
On Mon, Dec 5, 2011 at 2:09 AM, Melvin Carvalho
<melvinc...@gmail.com> wrote:
> On 4 December 2011 18:43, Michiel de Jong <mic...@unhosted.org> wrote:
>>
>> The following seven categories are under the regime of our design dictator:
>> public
>> calendars
>> contacts
>> documents
>> pictures
>> videos
>> music
>
> Reminds me a lot of the standard directories
>
> Just thinking out loud:
>
> What about "home" which is also part of ubuntu, or perhaps if you want
> something like a home page you can use public?


Yeah, it’s modeled after the standard directories and also the iCloud
categories. »Home« is the container which holds those categories – in
this case your remote storage. A home page you can use public would go
in the special »public« folder, hence the name.

Reply all
Reply to author
Forward
0 new messages