mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Add AppendChild helper.
This commit is contained in:
parent
cbe3447e70
commit
b91dd24959
@ -10,6 +10,7 @@ import { UserSettings } from "./UserSettings.js";
|
||||
import { ApplyInputEventHandlers } from "./InputEventHandlers.js";
|
||||
import { Sound } from "../Shared/Sound.js";
|
||||
import * as Console from "./Console.js";
|
||||
import { AppendChild } from "../Shared/UI.js";
|
||||
|
||||
export const MainApp = {
|
||||
Commands: {
|
||||
@ -35,7 +36,7 @@ export const MainApp = {
|
||||
return;
|
||||
}
|
||||
|
||||
UI.MotdAlert.innerHTML += content;
|
||||
AppendChild(UI.MotdAlert, content, "span");
|
||||
UI.MotdAlert.removeAttribute("hidden");
|
||||
UI.MotdAlert.querySelector("button").addEventListener("click", () => {
|
||||
localStorage["remotely-motd"] = content;
|
||||
|
||||
@ -2,6 +2,13 @@
|
||||
|
||||
export var ToastsWrapper = document.getElementById("toastsWrapper") as HTMLDivElement;
|
||||
|
||||
export function AppendChild(parentElement: HTMLElement, childContent: string, childTag: string) {
|
||||
var childElement = document.createElement(childTag);
|
||||
childElement.innerText = childContent;
|
||||
parentElement.appendChild(childElement);
|
||||
}
|
||||
|
||||
|
||||
export function ShowMessage(message: string) {
|
||||
var messageDiv = document.createElement("div");
|
||||
messageDiv.classList.add("toast-message");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user