コミットグラフ

18 コミット

作成者 SHA1 メッセージ 日付
n9k 8b4d6e8c09 Get stream title from disk
By default from `title.txt`. Also replace newlines with spaces when setting the
title in js, for parity with the nojs info iframe.
2022-03-07 12:54:35 +13:00
n9k 8d1f273a99 Show and update stream uptime in js 2022-03-07 12:54:33 +13:00
n9k 672ef10159 Add 3-hexdigit tags for default-name users 2022-02-23 09:21:07 +00:00
n9k 93409f8095 Message dates and times in chat
Now using `get_message_for_websocket` when sending an individual message.
2022-02-23 15:57:05 +13:00
n9k 2f4a9739c0 Show and enforce the captcha in js
Also clear the chat form comment input only if the message was accepted.
2022-02-22 16:25:43 +13:00
n9k 6ceb553b29 Buffer new and mutated users before sending to websockets
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.
2022-02-22 16:25:43 +13:00
n9k 20f79c5265 Fix js typos 2022-02-22 16:25:43 +13:00
n9k 6109de37ec Nojs chat: ETag, limit scrollback, timeout notice
Limiting scrollback is happening for the js chat too. Also reject long
comments.
2022-02-22 16:25:41 +13:00
n9k 4f85b52af0 Eradicate typo in js that breaks tripcodes
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.
2022-02-18 19:06:23 +13:00
n9k d848d1532e Reflect appearance changes with js 2022-02-18 18:17:01 +13:00
n9k 1e6563c4a2 Some more project structure 2022-02-18 14:32:34 +13:00
n9k 0eeee250ed Fix js removing messages 2022-02-17 13:30:09 +13:00
n9k e77862f4ff Nojs chat, store all user names/colors in js, forget about inactive users
Project structure evolving a bit
2022-02-17 13:30:05 +13:00
n9k 60b0cb1ebc Indent with 2 spaces in js 2022-02-15 23:16:10 +13:00
n9k 694c6a4995 Nojs comment submission, notify for rejected comments
Fix with-user wrapper (wasn't collecting users)
2022-02-15 23:11:53 +13:00
n9k 885c10b5de Initial noscript markup for chat form & stream info
Use with-user decorator on routes (instead of with-token)
2022-02-14 23:16:09 +13:00
n9k 5d0cac0b0f Concatenate segments
Add small js failsafe, other minor changes
2022-02-13 22:25:02 +13:00
n9k 71586420b6 Project structure, chat markup/style, websockets 2022-02-13 17:00:10 +13:00