Line data Source code
1 : // SPDX-License-Identifier: LGPL-2.1-or-later
2 : import { page_status } from "notifications";
3 :
4 1 : function id(sel) {
5 1 : return document.getElementById(sel);
6 1 : }
7 :
8 1 : function update() {
9 1 : const status = page_status.get("playground");
10 :
11 1 : if (status) {
12 1 : id("received-type").innerText = status.type;
13 1 : id("received-title").innerText = status.title;
14 1 : } else if (status !== undefined) {
15 1 : id("received-type").innerText = "-";
16 1 : id("received-title").innerText = "-";
17 1 : }
18 1 : }
19 :
20 1 : function init () {
21 1 : page_status.addEventListener("changed", update);
22 1 : update();
23 1 : }
24 :
25 1 : document.addEventListener("DOMContentLoaded", init);
|