Files
NTSH-Control/frontend/views/dashboard/dist/calibration.js
2025-10-22 22:06:16 +02:00

37 lines
1.4 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Calibration = void 0;
var Calibration = /** @class */ (function () {
function Calibration(Main) {
this.container = document.querySelector('.ntsh_calibration');
this.image = this.container.querySelector('img');
this.fullscreenButton = this.container.querySelector('.ntsh_calibration-fullscreen');
this._Main = Main;
this.registerListeners();
}
Calibration.prototype.startFetchClock = function () {
var _this = this;
this.image.src = "/calibrationImage?t=".concat(Date.now());
this.fetchClock = setInterval(function () {
_this.image.src = "/calibrationImage?t=".concat(Date.now());
}, 1000);
};
Calibration.prototype.stopFetchClock = function () {
clearInterval(this.fetchClock);
};
Calibration.prototype.registerListeners = function () {
var _this = this;
this._Main.TabController.registerListener('calibration', function (visible) {
if (visible)
_this.startFetchClock();
else
_this.stopFetchClock();
});
this.fullscreenButton.addEventListener('click', function () {
_this.image.requestFullscreen();
});
};
return Calibration;
}());
exports.Calibration = Calibration;
//# sourceMappingURL=calibration.js.map