Improved accessibility (#118):
* Adding a role="region" and an aria-label="Chat" on the chat container.
This commit is contained in:
parent
3177c31b08
commit
e65bd5c426
1
client/@types/global.d.ts
vendored
1
client/@types/global.d.ts
vendored
@ -12,6 +12,7 @@ declare const MUSTACHE_CONFIGURATION_CHANNEL: string
|
||||
// Constants that begins with "LOC_" are loaded by build-client.js, reading the english locale file.
|
||||
// See the online documentation: https://livingston.frama.io/peertube-plugin-livechat/contributing/translate/
|
||||
declare const LOC_ONLINE_HELP: string
|
||||
declare const LOC_CHAT: string
|
||||
declare const LOC_OPEN_CHAT: string
|
||||
declare const LOC_OPEN_CHAT_NEW_WINDOW: string
|
||||
declare const LOC_CLOSE_CHAT: string
|
||||
|
@ -46,6 +46,8 @@ async function initChat (video: Video): Promise<void> {
|
||||
container.setAttribute('id', 'peertube-plugin-livechat-container')
|
||||
container.setAttribute('peertube-plugin-livechat-state', 'initializing')
|
||||
container.setAttribute('peertube-plugin-livechat-current-url', window.location.href)
|
||||
container.role = 'region'
|
||||
container.ariaLabel = await ptContext.ptOptions.peertubeHelpers.translate(LOC_CHAT)
|
||||
placeholder.append(container)
|
||||
|
||||
try {
|
||||
|
@ -1,3 +1,4 @@
|
||||
chat: Chat
|
||||
online_help: "Online help"
|
||||
open_chat: "Open chat"
|
||||
open_chat_new_window: "Open chat in a new window"
|
||||
|
Loading…
Reference in New Issue
Block a user