Commit Graph

45 Commits

Author SHA1 Message Date
Lephenixnoir 5f62ac3643
smooth out minor bugs 2023-11-15 10:59:00 +01:00
Lephenixnoir 2317e973d4
a small refactor for less stateful UIs 2023-11-02 22:48:30 +01:00
Lephenixnoir bd1b9a369b
track state of connection to worker in main script 2023-10-10 23:33:29 +02:00
Lephenixnoir d189054616
work around case where worker is alive but not activated
This happens in the following case:
1. Start the browser
2. Load the page without triggering a worker reinstall (ie. the worker
   must not have changed since last test)
3. Worker is up but doesn't go through activation sequence

In this case we don't have an IRC client with a websocket. We generate
one dynamically once a shoutbox handshakes the worker.
2023-10-10 20:38:52 +02:00
Lephenixnoir ece78efd9c
support multiple connections to the worker
Also removes the IRCClient message-passing-style API since the service
worker will mutualize connections and thus interpret stuff like
"connect" differently.

This is getting messy, there is a real need to refactor and extend the
"IRC client state" so that

1. There is less state in the shoutbox page, instead more should come
   from the IRC client state (which updates pretty frequently)
2. The protocol is cleaner

Because currently if you disconnect from one page the others don't
necessarily show the proper tabs, etc.
2023-09-26 21:07:40 +02:00
Lephenixnoir e127e92bd3
add handshake/leave to service worker protocol
This allows tabs to connect to the service worker even if the service
worker was running before (which is almost always going to be the case).
2023-09-05 21:57:52 +02:00
Lephenixnoir 63aed672d4
move IRC client to service worker (w/ one hack)
- Demote v5shoutbox_irc.js from a module to a script, because loading
  modules from a service worker is very poorly supported
- Move IRCClientState to the top level so that the state info in
  messages is a raw object instead (which is structured-cloneable)
- For the same reason, replace the symbol-based enum with integers
- HACK: service worker enumerates clients at activation time and never
  updates the list

The hack implies that this only works if the client gets installed by
the action of loading the page. But at least we can use the shoutbox, so
it's a start. This will be cleaned up soon.
2023-08-29 22:39:53 +02:00
Lephenixnoir fa8a1983b2
proper support for IRC formatting 2023-08-21 01:27:53 +02:00
Lephenixnoir 358a5f107e
move messageToNode into new IRCFormatter class
Preparing to add more complexity to handle formats.
2023-08-09 17:23:49 +02:00
Lephenixnoir 3a3527c6f9
add markdown-style link formatting 2023-08-08 22:26:25 +02:00
Lephenixnoir f20e40a9d5
more style code/markdown formatting
* More room pseudo pseudos when the screen is large enough
* Improve header behavior when screen is small: force ellipsis on
  channel description, keep buttons visible, allow multiple rows if
  buttons themselves don't fit
2023-07-29 13:34:51 +02:00
Lephenixnoir 68f754906d
add inline-code markdown formatting 2023-07-29 00:31:57 +02:00
Lephenixnoir 4e3118c779
more style details (#2 follow-up)
* Standalone page is completely independent from v5
* Update widget.html to match index.html
* Change the message input from .message to .message-input to avoid
  collision with styles for actual div.message lines
* Make sure message input always takes the full page width
* Don't use IDs as they would collide with v5 templates
* Shorter padding specification on bottom form
* Add autocomplete="off" so browser doesn't remember previous messages
* Remove useless name attributes in message form
2023-07-29 00:11:27 +02:00
Lephenixnoir fddea4c7ee
Merge remote-tracking branch 'mb88/style' 2023-07-28 23:09:05 +02:00
mibi88 717ff28f16 Updated fallback CSS 2023-07-28 11:40:28 +02:00
mibi88 35b60ef493 Merge branch 'main' of https://gitea.planet-casio.com/devs/v5shoutbox into style 2023-07-28 11:38:08 +02:00
Lephenixnoir 8bda9f96a9
SharedChat manages IRC client + basic formatting (autolinking) 2023-07-28 00:35:32 +02:00
Lephenixnoir 9131c36d63
(almost) decouple IRC client and shoutbox
IRC client's interface is now by message passing with state updates and
other events. Only missing part is to also use messages to send requests
from the shoutbox to the client, which will come soon.

This setup will allow wrapping the IRC client in a service worker and
service the client's API over the worker's message pipe.

This change also moves the "current channel" tracking to the shoutbox,
since it ended up being unused in the client (only get/set!). This
cleans some of the mess of letting the client know about pseudo-channels
like "\log" and "\login".
2023-07-18 22:55:00 +02:00
mibi88 bcabd9952b Only loading fallback CSS if needed 2023-07-18 22:20:54 +02:00
mibi88 aa8da06510 Fallback CSSs if /static is missing. 2023-07-18 22:07:41 +02:00
Lephenixnoir f8e765018e
service worker setup 2023-07-13 16:29:49 +02:00
Lephenixnoir ca3730b64e
minor style improvements (inspired by gamja) 2023-07-13 16:29:20 +02:00
Lephenixnoir c56030b589
split IRC client off so it can be used by script or worker 2023-07-11 20:47:44 +02:00
mibi88 562082d199 Using v5's CSS to adapt them to the style of the v5.
Signed-off-by: mibi88 <mbcontact50@gmail.com>
2023-07-05 15:55:31 +02:00
Lephenixnoir e8c9c293df
fix colon -> semicolon in style.css 2023-07-04 19:42:00 +02:00
Lephenixnoir d7e929000f
meta: add HTML widget 2023-06-27 22:18:23 +02:00
Lephenixnoir fddf5bf9d5
style: parametrize colors 2023-06-27 20:32:03 +02:00
Lephenixnoir 4fbbbf07dc
style: only apply to #v5shoutbox 2023-06-27 20:23:50 +02:00
Lephenixnoir a605339ae8
style: slightly less hardcoded height layout
Basically by making v5shoutbox a flexbox so that the middle region gets
the correct height automatically.
2023-06-27 20:18:50 +02:00
Eragon 613a46c8fe
style: Force word-wrap on long words 2023-06-27 19:12:04 +02:00
Eragon 92036a3d20
style: Input field 2023-06-27 19:11:13 +02:00
Eragon 5fae634ced
style: Fix double border on channels buttons 2023-06-27 19:07:42 +02:00
Eragon 4396bda58a
style: Main message list 2023-06-27 19:06:05 +02:00
Eragon 16f902004e
style: Header and login field style 2023-06-27 19:03:12 +02:00
Lephenixnoir 203b1288e4
show new messages in title + bg activity on other channels 2023-06-17 18:51:15 +02:00
Lephenixnoir 2e55d4bbfb
restructure to enable styling 2023-06-17 18:15:03 +02:00
Lephenixnoir 0cd00577f1
generate channel info dynamically (no more HTML hardcoding) 2023-06-17 15:11:34 +02:00
Lephenixnoir 5124fd7f2a
show server time on messages 2023-06-17 13:38:07 +02:00
Lephenixnoir 0774035512
load chat history when connecting 2023-06-17 12:47:07 +02:00
Lephenixnoir 9d24cb671b
switch to SASL authentication, only use /AUTH as a default 2023-06-17 12:40:27 +02:00
Lephenixnoir c27868ff0c
allow sending raw commands with / 2023-06-17 12:40:10 +02:00
Lephenixnoir 1c32424193
collect and process batches 2023-06-16 15:57:08 +02:00
Lephenixnoir 59b6722a41
switch to reverse proxy on port 443 to avoid firewalls 2023-06-16 10:42:25 +02:00
Lephenixnoir 79a2619941
enable message-tags and parse them 2023-06-16 08:26:58 +02:00
Lephenixnoir e1dfaaab4f
first functional pure-IRC client
* Log in to IRC server with v5 credentials using /AUTH
* Read and write messages on all three channels
* No history, no CSS, and no v4/v5-posting
2023-06-13 23:35:15 +02:00