ryutai
Version:
A next generation window manager.
43 lines (40 loc) • 1.14 kB
JavaScript
var Ryutai = function(om) {
this.alertbar = new AlertBar();
this.dm = new NoodleDM();
this.clock = new Clock();
this.mesh = {
dom: "_sys",
type: "DIV",
subs: {
desktopManager: this.dm.mesh,
alertbar: this.alertbar.mesh
}
};
// build and insert clock
if(!this.mesh.subs.alertbar.subs.status.subs) {
this.mesh.subs.alertbar.subs.status.subs = {};
}
this.mesh.subs.alertbar.subs.status.subs.clock = {
dom: "_sys.alertbar.status.clock",
type: "SPAN",
subs: {
symbol: {
dom: "_sys.alertbar.status.clock.symbol",
type: "I",
styles: "fa fa-clock-o"
},
time: this.clock.mesh
}
};
// bake dom and append element
if(om) {
var oven = new Oven();
oven.bakeMesh(this.mesh, (ddom, mmesh) => {
this.dom = ddom;
this.mesh = mmesh;
});
// alert(JSON.stringify(this.mesh));
om.appendChild(this.dom);
}
};
var RyutaiEngine = new Ryutai(document.body);