not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

34 lines
1.1 KiB

define(["sugar-web/activity/activity","activity/moon-activity","webL10n"], function (activity, moonActivity, l10n) {
// Manipulate the DOM only when it is ready.
requirejs(['domReady!'], function (doc) {
// Initialize the activity.
activity.setup();
moonActivity.setup();
var datastoreObject = activity.getDatastoreObject();
datastoreObject.loadAsText(function (error, metadata, data) {
if (data == null) {
return;
}
moonActivity.initPrefs(data);
});
var stopButton = document.getElementById("stop-button");
stopButton.addEventListener('click', function (event) {
var pref = moonActivity.getPrefs();
datastoreObject.setDataAsText(pref);
console.log("writing...");
datastoreObject.save(function (error) {
if (error === null) {
console.log("write done.");
}
else {
console.log("write failed.");
}
});
});
});
});