This works around a bug in mobile Firefox where under certain cirucmstances two
elements inside an iframe both become the iframe's target elment at the same
time, which breaks the CSS logic so instead of exactly one form being displayed,
nothing is displayed.
The nojs button appears when the stream is online and the user is not watching.
The js button appears when the stream is online and the media element either
(1) is not using the network or (2) fires an error event.
Made the 'Users in chat' header above the overflow area, so it always stays on
top. Now using `visibility: hidden;` instead of `display: none;` to show/hide
messages/users so that nojs css animations don't reset.
By default the buffer is exhausted every 4 seconds. This should defend against
a potential DoS against clients with JavaScript enabled. Before this, any
request with no token would generate a new user and immediately broadcast the
new user to all the websockets. It's best to lock down as much as possible the
number of places a client can cause the server to broadcasts to all the
websockets.
Any single-user tripcode update deleted all existing tripcode display css
rules, because of one place where there was `stylesheet_color` (the global
variable) where it should have been `stylesheet` (the function argument).
Also now using proper js function named-argument syntax. (Why is it legal
to declare global variables in the arguments of a function call? What?)
In JavaScript, declaring a global variable in a function call is not OK:
> function f(x) {
... console.log(typeof n);
... return x;
... }
> f(var n = 42)
Uncaught SyntaxError: Unexpected token 'var'
> f(let n = 42)
Uncaught SyntaxError: missing ) after argument list
> f(const n = 42)
Uncaught SyntaxError: Unexpected token 'const'
Unless of course you elide the variable keyword:
> f(7)
undefined
7
> f(n = 42)
number
42
> n
42
Not even once.