diff --git a/server/chookchat.eggs.config b/server/chookchat.eggs.config new file mode 100644 index 0000000..d5b4b91 --- /dev/null +++ b/server/chookchat.eggs.config @@ -0,0 +1 @@ +notepad diff --git a/server/eggs/notepad/index.html b/server/eggs/notepad/index.html new file mode 100644 index 0000000..77a49f2 --- /dev/null +++ b/server/eggs/notepad/index.html @@ -0,0 +1,4 @@ +
diff --git a/server/eggs/notepad/index.js b/server/eggs/notepad/index.js new file mode 100644 index 0000000..30a0914 --- /dev/null +++ b/server/eggs/notepad/index.js @@ -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"; +} diff --git a/server/eggs/notepad/message.js b/server/eggs/notepad/message.js new file mode 100644 index 0000000..66f3aef --- /dev/null +++ b/server/eggs/notepad/message.js @@ -0,0 +1,4 @@ +else if (message.type == "egg-notepad") { + const eggNotepadTextArea = document.getElementById("egg-notepad-textarea"); + eggNotepadTextArea.value = message.content +} diff --git a/server/src/main/kotlin/Main.kt b/server/src/main/kotlin/Main.kt index bdc6c5f..a07fcf2 100644 --- a/server/src/main/kotlin/Main.kt +++ b/server/src/main/kotlin/Main.kt @@ -34,6 +34,10 @@ object config { var serviceName = "" fun getConfig() { + address = "" + port = "" + security = "" + serviceName = "" val configFile = File("chookchat.config") try { val config = configFile.readLines() @@ -395,10 +399,21 @@ fun buildHTML(): String { editedhtml += """ """ } else if (line == """