Files
XZBT-NGN/test-fixtures/reference-exhibits/planetarium/boot.js
T
2026-09-14 07:57:18 -07:00

45 lines
997 B
JavaScript

/*
* Planetarium — composition root. Last file to load.
*/
(function () {
'use strict';
var Shell = window.XZBTShell;
var announcer = new Shell.Announcer({
node: Shell.el('announcement'),
idleText: 'Dome idle \u2014 awaiting instruction.',
maxLength: 120
});
var exhibit = new window.PlanetariumExhibit({
canvas: Shell.el('sky-canvas'),
announcer: announcer
});
var ui = new window.PlanetariumUI(exhibit, announcer);
var core = window.PlanetariumContract.create(exhibit, ui);
var transport = new window.XZBTHostTransport({
core: core,
onMessage: function (request, response) {
if (response.type === 'hello.result') {
Shell.setText(Shell.el('contract-status'), 'host attached');
}
}
});
exhibit.start();
window.addEventListener('resize', function () { exhibit.resize(); });
window.__exhibit = {
core: core,
exhibit: exhibit,
ui: ui,
transport: transport,
announcer: announcer
};
})();