From 54d2f832c95b2f8a935715e73aba9661573ebeb5 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 17 Apr 2024 11:58:03 +0200 Subject: jsp: scatter some aria labels --- web/script/jshelper | 2 +- web/script/player/mod.ts | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'web') diff --git a/web/script/jshelper b/web/script/jshelper index 17fbd41..c6ada7c 160000 --- a/web/script/jshelper +++ b/web/script/jshelper @@ -1 +1 @@ -Subproject commit 17fbd41f033ca7aa11f91785904220ed509de1f3 +Subproject commit c6ada7c013956d25a055334b24f96658f12ee68f diff --git a/web/script/player/mod.ts b/web/script/player/mod.ts index 2defa6e..f290db4 100644 --- a/web/script/player/mod.ts +++ b/web/script/player/mod.ts @@ -91,6 +91,7 @@ function initialize_player(el: HTMLElement, node_id: string) { const enabled = active.length > 0 return e("button", MEDIA_KIND_ICONS[kind][+enabled], { class: "icon", + aria_label: `configure ${kind}`, onclick: () => { if (enabled) { for (const t of active) { @@ -141,7 +142,7 @@ function initialize_player(el: HTMLElement, node_id: string) { // TODO show loading indicator } return e("li", { class: active ? ["active"] : [] }, - e("button", { class: "jsp-track-state", onclick }, active ? "-" : "+"), " ", + e("button", { class: ["jsp-track-state", "icon"], onclick }, active ? "remove" : "add"), " ", e("span", { class: "jsp-track-name" }, `"${track.name}"`), " ", e("span", { class: "jsp-track-lang" }, `(${track.language})`) ) @@ -154,7 +155,7 @@ function initialize_player(el: HTMLElement, node_id: string) { } const settings_popup = () => { - const button = e("button", "settings", { class: "icon" }) + const button = e("button", "settings", { class: "icon", aria_label: "settings" }) new Popup(button, popups, () => e("div", { class: "jsp-settings-popup" }, e("h2", "Settings"), playersync_controls(sync_state, player), @@ -169,7 +170,7 @@ function initialize_player(el: HTMLElement, node_id: string) { const controls = e("div", { class: "jsp-controls" }, player.playing.map(playing => - e("button", { class: "icon" }, playing ? "pause" : "play_arrow", { onclick: toggle_playing }) + e("button", { class: "icon", aria_label: "toggle pause/play" }, playing ? "pause" : "play_arrow", { onclick: toggle_playing }) ), e("p", { class: "jsp-status" }, player.position.map(v => e("span", show.duration(v))), e("br"), @@ -208,7 +209,7 @@ function initialize_player(el: HTMLElement, node_id: string) { track_select("subtitles") ), settings_popup(), - e("button", "fullscreen", { class: "icon", onclick: toggle_fullscreen }) + e("button", "fullscreen", { class: "icon", onclick: toggle_fullscreen, aria_label: "fullscreen" }) ) player.position.onchangeinit(p => pri_current.style.width = pri_map(p)) -- cgit v1.2.3-70-g09d2