Add eggs, as well as example egg and config

This commit is contained in:
Maxwell Jeffress
2024-12-06 13:07:53 +11:00
parent 23fc71bd45
commit 7ff5447388
5 changed files with 84 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
<div class="egg" id="egg-notepad" style="display: none;">
<button id="egg-notepad-close" class="redbutton" onclick="closeEggNotepad()">Close</button><br>
<textarea id="egg-notepad-textarea" placeholder="Start typing..." style="height: 500px"></textarea>
</div>

View File

@@ -0,0 +1,21 @@
function eggNotepad() {
const eggsList = document.getElementById("eggs-list");
eggsList.style.display = "none";
const eggNotepad = document.getElementById("egg-notepad");
eggNotepad.style.display = "block";
const eggNotepadTextArea = document.getElementById("egg-notepad-textarea");
eggNotepadTextArea.addEventListener('input', function(event) {
const eggNotepadMessage = {
"type": "egg-notepad",
"username": username,
"token": md5(password),
"content": event.target.value
};
ws.send(JSON.stringify(eggNotepadMessage));
}, false);
}
function closeEggNotepad() {
const eggNotepad = document.getElementById("egg-notepad");
eggNotepad.style.display = "none";
}

View File

@@ -0,0 +1,4 @@
else if (message.type == "egg-notepad") {
const eggNotepadTextArea = document.getElementById("egg-notepad-textarea");
eggNotepadTextArea.value = message.content
}