Add global placeholders for reset, restart and update.
This commit is contained in:
parent
b657367ba4
commit
fd0ad6f063
|
@ -24,6 +24,9 @@ window.setExposure = null;
|
||||||
window.setDelay = null;
|
window.setDelay = null;
|
||||||
window.setCounter = null;
|
window.setCounter = null;
|
||||||
window.sequence = null;
|
window.sequence = null;
|
||||||
|
window.reset = null;
|
||||||
|
window.restart = null;
|
||||||
|
window.update = null;
|
||||||
|
|
||||||
//ms
|
//ms
|
||||||
var shutter = function (exposure) {
|
var shutter = function (exposure) {
|
||||||
|
@ -224,8 +227,30 @@ var cameraPage = function () {
|
||||||
document.getElementById('camera').classList.add('selected');
|
document.getElementById('camera').classList.add('selected');
|
||||||
document.getElementById('cameraIcon').classList.add('selected');
|
document.getElementById('cameraIcon').classList.add('selected');
|
||||||
};
|
};
|
||||||
var spinnerInit = function () {
|
|
||||||
const spinnerOpts = {
|
var isNumeric = function (n) {
|
||||||
|
return !isNaN(parseFloat(n)) && isFinite(n);
|
||||||
|
};
|
||||||
|
|
||||||
|
var UI = {};
|
||||||
|
|
||||||
|
UI.overlay = {
|
||||||
|
elem : document.getElementById('overlay')
|
||||||
|
}
|
||||||
|
UI.overlay.show = function () {
|
||||||
|
if (!UI.overlay.elem.classList.contains('active')) {
|
||||||
|
UI.overlay.elem.classList.add('active');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
UI.overlay.hide = function () {
|
||||||
|
if (UI.overlay.elem.classList.contains('active')) {
|
||||||
|
UI.overlay.elem.classList.remove('active');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
UI.spinner = {
|
||||||
|
elem : document.getElementById('spinner')
|
||||||
|
}
|
||||||
|
UI.spinner.opts = {
|
||||||
lines: 13 // The number of lines to draw
|
lines: 13 // The number of lines to draw
|
||||||
, length: 33 // The length of each line
|
, length: 33 // The length of each line
|
||||||
, width: 11 // The line thickness
|
, width: 11 // The line thickness
|
||||||
|
@ -247,25 +272,19 @@ var spinnerInit = function () {
|
||||||
, hwaccel: true // Whether to use hardware acceleration
|
, hwaccel: true // Whether to use hardware acceleration
|
||||||
, position: 'relative' // Element positioning
|
, position: 'relative' // Element positioning
|
||||||
};
|
};
|
||||||
const target = document.getElementById('spinner');
|
UI.spinner.init = function () {
|
||||||
const spinner = new Spinner(spinnerOpts).spin(target);
|
const spinner = new Spinner(UI.spinner.opts).spin(UI.spinner.elem);
|
||||||
};
|
};
|
||||||
var spinnerShow = function () {
|
UI.spinner.show = function () {
|
||||||
const elem = document.getElementById('overlay');
|
if (!UI.spinner.elem.classList.contains('active')) {
|
||||||
if (!elem.classList.contains('active')) {
|
UI.spinner.elem.classList.add('active');
|
||||||
elem.classList.add('active');
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var spinnerHide = function () {
|
UI.spinner.hide = function () {
|
||||||
const elem = document.getElementById('overlay');
|
if (UI.spinner.elem.classList.contains('active')) {
|
||||||
if (elem.classList.contains('active')) {
|
UI.spinner.elem.classList.remove('active');
|
||||||
elem.classList.remove('active');
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var isNumeric = function (n) {
|
|
||||||
return !isNaN(parseFloat(n)) && isFinite(n);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
var init = function () {
|
var init = function () {
|
||||||
document.querySelector('.angle').oninput = function () {
|
document.querySelector('.angle').oninput = function () {
|
||||||
|
|
Loading…
Reference in New Issue