<div dir="ltr"><br><div class="gmail_extra"><br></div><div class="gmail_extra">Hi Sam,</div><div class="gmail_extra"><br></div><div class="gmail_extra">You could find an example in my LOLActivity [1].</div><div class="gmail_extra">
Load is call here [2].</div><div class="gmail_extra">Save is call each time the board change [3].</div><div class="gmail_extra">The Load/Save process is here [4].</div><div class="gmail_extra"><br></div><div class="gmail_extra">
Hope it could help.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Best regards from France.</div><div class="gmail_extra"><br></div><div class="gmail_extra">           Lionel.</div><div class="gmail_extra">
<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">[1] <a href="http://activities.sugarlabs.org/en/sugar/addon/4717">http://activities.sugarlabs.org/en/sugar/addon/4717</a></div><div class="gmail_extra">
[2] <a href="https://github.com/llaske/LOLActivity/blob/master/js/activity.js#L28">https://github.com/llaske/LOLActivity/blob/master/js/activity.js#L28</a></div><div class="gmail_extra">[3] <a href="https://github.com/llaske/LOLActivity/blob/master/js/app.js#L138">https://github.com/llaske/LOLActivity/blob/master/js/app.js#L138</a></div>
<div class="gmail_extra">[4] <a href="https://github.com/llaske/LOLActivity/blob/master/js/app.js#L183">https://github.com/llaske/LOLActivity/blob/master/js/app.js#L183</a><br><br><div class="gmail_quote">2014-03-22 8:36 GMT+01:00  <span dir="ltr"><<a href="mailto:sugar-devel-request@lists.sugarlabs.org" target="_blank">sugar-devel-request@lists.sugarlabs.org</a>></span>:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
Message: 1<br>
Date: Sat, 22 Mar 2014 15:34:33 +1100<br>
From: Sam Parkinson <<a href="mailto:sam.parkinson3@gmail.com">sam.parkinson3@gmail.com</a>><br>
To: Manuel Qui?ones <<a href="mailto:manuq@laptop.org">manuq@laptop.org</a>>, Sugar-dev Devel<br>
        <<a href="mailto:sugar-devel@lists.sugarlabs.org">sugar-devel@lists.sugarlabs.org</a>><br>
Subject: [Sugar-devel] How do you save stuff in web activities?<br>
Message-ID:<br>
        <CACVKbrVomF2ayh1bUfCXeDSxzShjSxy3dag3Z0RES=<a href="mailto:5DDoiHkg@mail.gmail.com">5DDoiHkg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi,<br>
<br>
I'm just wondering, does anyone have any code snippets for saving on web<br>
activities?<br>
<br>
I'm trying to make a web activity and am having some issues. Here is my<br>
save+load code: [CoffeeScript]<br>
<br>
activity.setup()<br>
datastoreObject = activity.getDatastoreObject()<br>
onLoaded = (error, metadata, data) -><br>
  alert data<br>
  obj = JSON.parse data<br>
  console.log obj<br>
  container.html obj.html<br>
  $('section').each (x, ele) -><br>
    scribe_slide_setup ele<br>
  undefined<br>
datastoreObject.loadAsText onLoaded<br>
<br>
activity.write = -><br>
  obj =<br>
    html: container.html()<br>
  jsonData = JSON.stringify obj<br>
  datastoreObject.setDataAsText jsonData<br>
  datastoreObject.save()<br>
<br>
Neither methods end up getting called. I'm using 0.100.0.<br>
<br>
Thanks,<br>
Sam<br><br>
</blockquote></div><br></div></div>