Add kumos.
This commit is contained in:
parent
8a2c269d26
commit
964bd2e808
18 changed files with 427 additions and 23 deletions
38
static/kumos/guestbook.mjs
Normal file
38
static/kumos/guestbook.mjs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { Application, Window, promoteWindow, registerApplication, getScreenRoot, getProcList } from "./kernel.mjs";
|
||||
import { notify } from "./shell.mjs";
|
||||
|
||||
function draw(p) {
|
||||
const w = new Window();
|
||||
w.setTitle("Guestbook");
|
||||
w.content.innerHTML = `
|
||||
<script src="https://iframe.chat/scripts/main.min.js"></script>
|
||||
<iframe class="windowContent" src="https://iframe.chat/embed?chat=17048300" id="chattable"></iframe>
|
||||
<script>chattable.initialize({ theme: "moderno" });</script>
|
||||
`
|
||||
|
||||
getScreenRoot().appendChild(w.window);
|
||||
promoteWindow(w);
|
||||
|
||||
w.close.addEventListener('click', () => {
|
||||
p.detach();
|
||||
w.destroy();
|
||||
})
|
||||
}
|
||||
|
||||
function main(p) {
|
||||
let running = false;
|
||||
getProcList().forEach(proc => {
|
||||
if (proc.name == 'guestbook' && proc != p) {
|
||||
notify("Guestbook", "Guestbook is already running!")
|
||||
p.detach();
|
||||
running = true;
|
||||
}
|
||||
})
|
||||
|
||||
if (!running) {
|
||||
draw(p);
|
||||
}
|
||||
}
|
||||
|
||||
const app = new Application('guestbook', main);
|
||||
registerApplication(app);
|
||||
Loading…
Reference in a new issue