2016-08-18 11:45:08 +00:00
|
|
|
/*globals $, SimpleStorage, document*/
|
|
|
|
|
|
|
|
var addToLog = function(txt) {
|
|
|
|
$(".logs").append("<br>" + txt);
|
|
|
|
};
|
|
|
|
|
2015-05-24 13:07:19 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
$("button.set").click(function() {
|
|
|
|
var value = parseInt($("input.text").val(), 10);
|
|
|
|
SimpleStorage.set(value);
|
2016-08-18 11:45:08 +00:00
|
|
|
addToLog("SimpleStorage.set(" + value + ")");
|
2015-05-24 13:07:19 +00:00
|
|
|
});
|
|
|
|
|
2016-05-23 15:10:24 +00:00
|
|
|
$("button.get").click(function() {
|
2016-08-18 11:45:08 +00:00
|
|
|
SimpleStorage.get().then(function(value) {
|
|
|
|
$(".value").html(value.toNumber());
|
|
|
|
});
|
2015-05-24 13:07:19 +00:00
|
|
|
addToLog("SimpleStorage.get()");
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|