Push dev work to master #2

Merged
sixteenmillimeter merged 416 commits from dev into master 2018-07-19 15:29:02 +00:00
1 changed files with 56 additions and 2 deletions
Showing only changes of commit 1c14520c6a - Show all commits

View File

@ -147,7 +147,7 @@ web.sequence = function () {
console.error('Error getting /sequence'); console.error('Error getting /sequence');
console.error(err); console.error(err);
}) })
} };
web.sequenceSuccess = function (res) { web.sequenceSuccess = function (res) {
if (res.started && res.started != false) { if (res.started && res.started != false) {
STATE.sequence = true; STATE.sequence = true;
@ -159,10 +159,61 @@ web.sequenceSuccess = function (res) {
seqState(false); seqState(false);
mobile.getState(); mobile.getState();
} }
};
web.reset = function () {
const opts = {
method : 'POST',
headers : web._header,
body : JSON.stringify({})
}
fetch('/reset', opts)
.then(web.useJson)
.then(web.resetSuccess)
.catch(err => {
console.error('Error posting to /reset');
console.error(err);
})
};
web.resetSuccess = function (res) {
console.dir(res)
} }
web.restart = function () {
const opts = {
method : 'POST',
headers : web._header,
body : JSON.stringify({})
}
fetch('/restart', opts)
.then(web.useJson)
.then(web.restartSuccess)
.catch(err => {
console.error('Error posting to /restart');
console.error(err);
})
};
web.restartSuccess = function (res) {
console.dir(res)
};
web.update = function () {
const opts = {
method : 'POST',
headers : web._header,
body : JSON.stringify({})
}
fetch('/update', opts)
.then(web.useJson)
.then(web.updateSuccess)
.catch(err => {
console.error('Error posting to /update');
console.error(err);
})
};
web.updateSuccess = function (res) {
console.dir(res)
};
web.useJson = function (res) { web.useJson = function (res) {
return res.json(); return res.json();
} };
web.init = function () { web.init = function () {
window.frame = web.frame; window.frame = web.frame;
window.getState = web.getState; window.getState = web.getState;
@ -171,5 +222,8 @@ web.init = function () {
window.setExposure = web.setExposure; window.setExposure = web.setExposure;
window.setCounter = web.setCounter; window.setCounter = web.setCounter;
window.sequence = web.sequence; window.sequence = web.sequence;
window.reset = web.reset;
window.restart = web.restart;
window.update = web.update;
console.log('started web') console.log('started web')
}; };