Files
2025-10-22 22:06:16 +02:00

38 lines
1.4 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Leds = void 0;
var morphux_1 = require("morphux");
var Leds = /** @class */ (function () {
function Leds(Main) {
this.container = document.querySelector(".ntsh_tab[tabid=\"leds\"]");
this._Main = Main;
this.registerTabListener();
}
Leds.prototype.createPreviewFrame = function () {
var container = (0, morphux_1.ce)('div', 'ntsh_leds');
var urlParams = new URLSearchParams(window.location.search);
var transform = urlParams.has('transform')
? "?transform=".concat(urlParams.get('transform'))
: '';
var frame = (0, morphux_1.ce)('iframe', 'ntsh_leds-frame', {
src: "http://".concat(window.location.hostname, ":84").concat(transform),
});
container.appendChild(frame);
this.container.appendChild(container);
};
Leds.prototype.removePreviewFrame = function () {
this.container.innerHTML = '';
};
Leds.prototype.registerTabListener = function () {
var _this = this;
this._Main.TabController.registerListener('leds', function (visible) {
if (visible)
_this.createPreviewFrame();
else
_this.removePreviewFrame();
});
};
return Leds;
}());
exports.Leds = Leds;
//# sourceMappingURL=leds.js.map