Add actual watch interface
parent
aec3df8745
commit
b82b65198b
|
|
@ -135,7 +135,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
cmpStr = getJSON();
|
let savestr = getJSON();
|
||||||
|
Util.showModal('Saving...');
|
||||||
|
Puck.write(`\x10require('Storage').writeJSON(${JSON.stringify('presentor.json')},${savestr})\n`,()=>{
|
||||||
|
Util.hideModal();
|
||||||
|
});
|
||||||
|
cmpStr = savestr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadJSON(str) {
|
function loadJSON(str) {
|
||||||
|
|
@ -146,6 +151,14 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
Util.showModal('Loading...');
|
||||||
|
Puck.eval(`require('Storage').readJSON(${JSON.stringify('presentor.json')})`,data => {
|
||||||
|
Util.hideModal();
|
||||||
|
loadJSON(data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function addFormPPart(partData = {}) {
|
function addFormPPart(partData = {}) {
|
||||||
let part = document.createElement('div');
|
let part = document.createElement('div');
|
||||||
part.classList.add('ppartrow');
|
part.classList.add('ppartrow');
|
||||||
|
|
@ -241,8 +254,9 @@
|
||||||
document.getElementById('loader').style.display = 'none';
|
document.getElementById('loader').style.display = 'none';
|
||||||
|
|
||||||
// load from watch first.
|
// load from watch first.
|
||||||
let qq = `[{"subject":"Hello","minutes":55,"seconds":4,"notes":""},{"subject":"dsfafds","minutes":4,"seconds":33,"notes":"fdasdfsafasfsd"},{"subject":"dsadsf","minutes":0,"seconds":4,"notes":""},{"subject":"sdasf","minutes":0,"seconds":0,"notes":""}]`;
|
// let qq = `[{"subject":"Hello","minutes":55,"seconds":4,"notes":""},{"subject":"dsfafds","minutes":4,"seconds":33,"notes":"fdasdfsafasfsd"},{"subject":"dsadsf","minutes":0,"seconds":4,"notes":""},{"subject":"sdasf","minutes":0,"seconds":0,"notes":""}]`;
|
||||||
loadJSON(qq);
|
// loadJSON(qq);
|
||||||
|
load();
|
||||||
addFormPPart(); // load empty element on startup
|
addFormPPart(); // load empty element on startup
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue