From 756d2a98b27a300e48bb495b49c5435f60549c81 Mon Sep 17 00:00:00 2001 From: www-data Date: Thu, 27 Mar 2025 09:59:15 -0300 Subject: [PATCH] update chat --- _includes/player.html | 216 ++++++++++++++++++------------------------ php/chat/relay.php | 35 +++++++ php/chat/send.php | 11 +++ 3 files changed, 136 insertions(+), 126 deletions(-) create mode 100644 php/chat/relay.php create mode 100644 php/chat/send.php diff --git a/_includes/player.html b/_includes/player.html index 707478c..78c113d 100644 --- a/_includes/player.html +++ b/_includes/player.html @@ -1,24 +1,18 @@ - - - - - -
- +
-

Offlinee

+

Offline

@@ -30,158 +24,128 @@
-
- + + +
+ + +
+
-
- -
+
- +
-
- + +
- - \ No newline at end of file + + document.querySelector('.chat-input-form').addEventListener('submit', sendMessage); + document.querySelector('#username-input').addEventListener('change', setCustomUsername); + diff --git a/php/chat/relay.php b/php/chat/relay.php new file mode 100644 index 0000000..1613733 --- /dev/null +++ b/php/chat/relay.php @@ -0,0 +1,35 @@ + $last_modif) { + $last_modif = $current_modif; + $data = file_get_contents($tmp_file); + echo "data: " . trim($data) . "\n\n"; + ob_flush(); + flush(); + } + + sleep(1); +} +?> + diff --git a/php/chat/send.php b/php/chat/send.php new file mode 100644 index 0000000..7dda579 --- /dev/null +++ b/php/chat/send.php @@ -0,0 +1,11 @@ +