@intuitionrobotics/thunderstorm
Version:
31 lines • 1.11 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ThunderstormModule = void 0;
const ts_common_1 = require("@intuitionrobotics/ts-common");
class ThunderstormModule_Class extends ts_common_1.Module {
constructor() {
super("ThunderstormModule");
this.setDefaultConfig({ appName: "Thunderstorm-WebApp" });
}
init() {
this.setAppName(this.config.appName);
this.setChromeThemeColor(this.config.themeColor);
}
setAppName(appName) {
document.title = appName;
}
setChromeThemeColor(themeColor) {
let themeTag = document.head.querySelector('meta[name="theme-color"]');
if (!themeTag) {
themeTag = document.createElement('meta');
themeTag.name = "theme-color";
document.getElementsByTagName('head')[0].appendChild(themeTag);
}
themeTag.setAttribute('content', themeColor);
}
getAppName() {
return this.config.appName;
}
}
exports.ThunderstormModule = new ThunderstormModule_Class();
//# sourceMappingURL=ThunderstormModule.js.map