Websocket: send form field maxlengths

このコミットが含まれているのは:
n9k 2022-08-12 05:25:57 +00:00
コミット 12338747de
2個のファイルの変更10行の追加0行の削除

ファイルの表示

@ -665,6 +665,11 @@ const on_websocket_message = async (event) => {
info_button.dataset.visible = "";
}
// form input maxlengths
chat_form_comment.maxLength = receipt.maxlength.comment;
chat_appearance_form_name.maxLength = receipt.maxlength.name;
chat_appearance_form_password.maxLength = receipt.maxlength.password;
// chat form nonce
chat_form_nonce.value = receipt.nonce;

ファイルの表示

@ -36,6 +36,11 @@ async def websocket_outbound(queue, user):
'scrollback': CONFIG['MAX_CHAT_SCROLLBACK'],
'digest': get_random_captcha_digest_for(user),
'pingpong': CONFIG['TASK_BROADCAST_PING'],
'maxlength': {
'comment': CONFIG['CHAT_COMMENT_MAX_LENGTH'],
'name': CONFIG['CHAT_NAME_MAX_LENGTH'],
'password': CONFIG['CHAT_TRIPCODE_PASSWORD_MAX_LENGTH'],
},
})
while True:
payload = await queue.get()