Add button titles for accessibility
This commit is contained in:
1 parent
5788f5a8b4
commit
b423446412
25 files changed
+65
-50
No files matched your search
@@ -139,7 +139,7 @@ onMount(get_reporters);
|
||||
<section>
|
||||
<div class="toolbar" style="text-align: left;">
|
||||
<div class="toolbar_spacer"></div>
|
||||
<button onclick={() => get_reporters()}>
|
||||
<button onclick={() => get_reporters()} title="Refresh">
|
||||
<i class="icon i_refresh"></i>
|
||||
</button>
|
||||
<button bind:this={edit_button} class:button_highlight={creating} onclick={() => {creating = !creating}}>
|
||||
|
||||
@@ -73,23 +73,23 @@ const toggle_preview = (rep) => {
|
||||
<td>{formatDate(rep.last_used, true, true, false)}</td>
|
||||
<td>{formatDate(rep.created, false, false, false)}</td>
|
||||
<td>
|
||||
<button onclick={e => {e.preventDefault(); toggle_preview(rep)}} class="button round">
|
||||
<button onclick={e => {e.preventDefault(); toggle_preview(rep)}} class="button round" title="Show last message">
|
||||
<i class="icon i_email"></i>
|
||||
</button>
|
||||
<button onclick={e => {e.preventDefault(); on_edit(rep)}} class="button round">
|
||||
<button onclick={e => {e.preventDefault(); on_edit(rep)}} class="button round" title="Edit">
|
||||
<i class="icon i_edit"></i>
|
||||
</button>
|
||||
{#if rep.status !== "trusted"}
|
||||
<button onclick={e => {e.preventDefault(); on_approve(rep)}} class="button button_highlight round">
|
||||
<button onclick={e => {e.preventDefault(); on_approve(rep)}} class="button button_highlight round" title="Trust">
|
||||
<i class="icon i_check"></i>
|
||||
</button>
|
||||
{/if}
|
||||
{#if rep.status !== "rejected"}
|
||||
<button onclick={e => {e.preventDefault(); on_spam(rep)}} class="button button_red round">
|
||||
<button onclick={e => {e.preventDefault(); on_spam(rep)}} class="button button_red round" title="Reject">
|
||||
<i class="icon i_block"></i>
|
||||
</button>
|
||||
{/if}
|
||||
<button onclick={e => {e.preventDefault(); on_delete(rep)}} class="button button_red round">
|
||||
<button onclick={e => {e.preventDefault(); on_delete(rep)}} class="button button_red round" title="Delete">
|
||||
<i class="icon i_delete"></i>
|
||||
</button>
|
||||
</td>
|
||||
|
||||
@@ -115,7 +115,7 @@ const decommission = (id: string) => {
|
||||
<td>{formatDataVolume(peer.min_free_space, 3)}</td>
|
||||
{#if !all_reachable}
|
||||
<td>
|
||||
<button class="button flat delete" onclick={() => decommission(peer.id)}>
|
||||
<button class="button flat delete" onclick={() => decommission(peer.id)} title="Decommission">
|
||||
<i class="icon small i_delete"></i>
|
||||
</button>
|
||||
</td>
|
||||
|
||||
@@ -141,7 +141,7 @@ onMount(get_bans);
|
||||
Date<br/>
|
||||
{formatDate(row.offences[0].ban_time, false, false, false)}
|
||||
</div>
|
||||
<button onclick={e => {e.stopPropagation(); delete_ban(row.user_id)}} class="button button_red" style="align-self: center;">
|
||||
<button onclick={e => {e.stopPropagation(); delete_ban(row.user_id)}} class="button button_red" style="align-self: center;" title="Delete ban">
|
||||
<i class="icon i_delete"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -115,7 +115,7 @@ const toggle_expand_keyboard = (e: KeyboardEvent) => {
|
||||
</script>
|
||||
|
||||
<div class="container" onclick={toggle_expand} onkeypress={toggle_expand_keyboard} role="presentation">
|
||||
<button class="button_expand hidden_vertical" onclick={toggle_expand}>
|
||||
<button class="button_expand hidden_vertical" onclick={toggle_expand} title={expanded ? "Collapse" : "Expand"}>
|
||||
{#if expanded}
|
||||
<i class="icon i_expand_more"></i>
|
||||
{:else}
|
||||
|
||||
@@ -41,13 +41,13 @@ export const copy_link = () => {
|
||||
|
||||
<div class="grid" class:hide={!toolbar_expanded}>
|
||||
<div class="button_row">
|
||||
<button onclick={() => {nav.open_sibling(-1)}}>
|
||||
<button onclick={() => {nav.open_sibling(-1)}} title="Previous file">
|
||||
<i class="icon i_skip_previous"></i>
|
||||
</button>
|
||||
<button onclick={nav.toggle_shuffle} class:button_highlight={$nav.shuffle}>
|
||||
<button onclick={nav.toggle_shuffle} class:button_highlight={$nav.shuffle} title="Shuffle">
|
||||
<i class="icon i_shuffle"></i>
|
||||
</button>
|
||||
<button onclick={() => {nav.open_sibling(1)}}>
|
||||
<button onclick={() => {nav.open_sibling(1)}} title="Next file">
|
||||
<i class="icon i_skip_next"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -93,7 +93,7 @@ const del_password = (pass: string) => {
|
||||
{#if options.user_permissions !== undefined}
|
||||
{#each Object.keys(options.user_permissions) as id (id)}
|
||||
<div class="row">
|
||||
<Button click={() => del_user(id)} icon="delete"/>
|
||||
<Button click={() => del_user(id)} icon="delete" title="Remove"/>
|
||||
<div class="grow id">
|
||||
{id}
|
||||
</div>
|
||||
@@ -133,9 +133,9 @@ const del_password = (pass: string) => {
|
||||
{#if options.password_permissions !== undefined}
|
||||
{#each Object.keys(options.password_permissions) as password (password)}
|
||||
<div class="row">
|
||||
<Button click={() => del_password(password)} icon="delete"/>
|
||||
<Button click={() => del_password(password)} icon="delete" title="Remove"/>
|
||||
<input type="text" bind:value={options.password_permissions[password].label} placeholder="Label" class="grow" maxlength="100" size="1">
|
||||
<ToggleButton bind:on={revealed[password]} icon_on="visibility" icon_off="visibility_off"/>
|
||||
<ToggleButton bind:on={revealed[password]} icon_on="visibility" icon_off="visibility_off" title="Reveal password"/>
|
||||
<div class="grow id">
|
||||
{revealed[password] ? password : "••••••••••••••••"}
|
||||
</div>
|
||||
|
||||
@@ -43,6 +43,7 @@ let {
|
||||
<button
|
||||
class="action_button flat"
|
||||
onclick={e => file_event(FileAction.Menu, index, e)}
|
||||
title="Menu"
|
||||
>
|
||||
<i class="icon i_menu"></i>
|
||||
</button>
|
||||
|
||||
@@ -253,7 +253,7 @@ onMount(() => {
|
||||
{:else}
|
||||
<div class="toolbar toolbar_edit">
|
||||
<div>
|
||||
<Button click={() => nav.set_selecting(false)} icon="close"/>
|
||||
<Button click={() => nav.set_selecting(false)} icon="close" title="Clear selection"/>
|
||||
{@render nav_buttons()}
|
||||
</div>
|
||||
<div class="toolbar_spacer">
|
||||
|
||||
@@ -98,7 +98,7 @@ onMount(() => {
|
||||
<Modal bind:this={modal} width="900px">
|
||||
{#snippet header()}
|
||||
<div class="header" >
|
||||
<button class="button round" onclick={modal.hide}>
|
||||
<button class="button round" onclick={modal.hide} title="Close">
|
||||
<i class="icon i_close"></i>
|
||||
</button>
|
||||
<button onclick={() => nav.navigate_up()} disabled={$nav.path.length <= 1} title="Up">
|
||||
|
||||
@@ -100,7 +100,7 @@ onMount(load_settings)
|
||||
</td>
|
||||
{/each}
|
||||
<td class="node_icons icons_wrap">
|
||||
<Button flat icon="settings" click={e => dialog.open(e)} />
|
||||
<Button flat icon="settings" click={e => dialog.open(e)} title="Columns"/>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -168,17 +168,18 @@ onMount(load_settings)
|
||||
href="/d/{child.id}"
|
||||
onclick={e => file_event(FileAction.Share, index, e)}
|
||||
class="button action_button"
|
||||
title="This file / directory is shared. Click to open public link"
|
||||
>
|
||||
<i class="icon i_share" title="This file / directory is shared. Click to open public link"></i>
|
||||
<i class="icon i_share"></i>
|
||||
</a>
|
||||
{/if}
|
||||
{#if child.properties !== undefined && child.properties.branding_enabled === "true" && !hide_branding}
|
||||
<button class="action_button" onclick={e => file_event(FileAction.Branding, index, e)}>
|
||||
<button class="action_button" onclick={e => file_event(FileAction.Branding, index, e)} title="Edit branding">
|
||||
<i class="icon i_palette"></i>
|
||||
</button>
|
||||
{/if}
|
||||
{#if !hide_edit}
|
||||
<button class="action_button" onclick={e => file_event(FileAction.Menu, index, e)}>
|
||||
<button class="action_button" onclick={e => file_event(FileAction.Menu, index, e)} title="Menu">
|
||||
<i class="icon i_menu"></i>
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
@@ -109,7 +109,7 @@ onMount(() => {
|
||||
{#snippet toolbar()}
|
||||
{#if $trash.selecting}
|
||||
<div class="toolbar toolbar_edit">
|
||||
<Button icon="close" click={() => trash.set_selecting(false)}/>
|
||||
<Button icon="close" click={() => trash.set_selecting(false)} title="Stop selecting"/>
|
||||
<div class="toolbar_spacer">Selecting files</div>
|
||||
<Button click={restore} icon="restore_from_trash" label="Restore"/>
|
||||
<button onclick={delete_selected} class="button_red">
|
||||
|
||||
@@ -128,17 +128,17 @@ onMount(() => {
|
||||
<track kind="captions"/>
|
||||
</audio>
|
||||
<div style="text-align: center;">
|
||||
<button onclick={() => change_track(-1)}><i class="icon i_skip_previous"></i></button>
|
||||
<button onclick={() => seek(-10)}><i class="icon i_replay_10"></i></button>
|
||||
<button onclick={toggle_playback}>
|
||||
<button onclick={() => change_track(-1)} title="Previous track"><i class="icon i_skip_previous"></i></button>
|
||||
<button onclick={() => seek(-10)} title="Back 10 seconds"><i class="icon i_replay_10"></i></button>
|
||||
<button onclick={toggle_playback} title={playing ? "Pause" : "Play"}>
|
||||
{#if playing}
|
||||
<i class="icon i_pause"></i>
|
||||
{:else}
|
||||
<i class="icon i_play_arrow"></i>
|
||||
{/if}
|
||||
</button>
|
||||
<button onclick={() => seek(10)}><i class="icon i_forward_10"></i></button>
|
||||
<button onclick={() => change_track(1)}><i class="icon i_skip_next"></i></button>
|
||||
<button onclick={() => seek(10)} title="Forward 10 seconds"><i class="icon i_forward_10"></i></button>
|
||||
<button onclick={() => change_track(1)} title="Next track"><i class="icon i_skip_next"></i></button>
|
||||
</div>
|
||||
|
||||
<h2>Tracklist</h2>
|
||||
|
||||
@@ -118,34 +118,34 @@ const video_keydown = (e: KeyboardEvent) => {
|
||||
|
||||
<div class="controls">
|
||||
<div class="spacer"></div>
|
||||
<button onclick={() => open_sibling(-1)}>
|
||||
<button onclick={() => open_sibling(-1)} title="Previous file">
|
||||
<i class="icon i_skip_previous"></i>
|
||||
</button>
|
||||
<button onclick={() => seek(-10)}>
|
||||
<button onclick={() => seek(-10)} title="Back 10 seconds">
|
||||
<i class="icon i_replay_10"></i>
|
||||
</button>
|
||||
<button onclick={toggle_playback} class="button_highlight">
|
||||
<button onclick={toggle_playback} class="button_highlight" title={playing ? "Pause" : "Play"}>
|
||||
{#if playing}
|
||||
<i class="icon i_pause"></i>
|
||||
{:else}
|
||||
<i class="icon i_play_arrow"></i>
|
||||
{/if}
|
||||
</button>
|
||||
<button onclick={() => seek(10)}>
|
||||
<button onclick={() => seek(10)} title="Forward 10 seconds">
|
||||
<i class="icon i_forward_10"></i>
|
||||
</button>
|
||||
<button onclick={() => open_sibling(1)}>
|
||||
<button onclick={() => open_sibling(1)} title="Next file">
|
||||
<i class="icon i_skip_next"></i>
|
||||
</button>
|
||||
<div style="width: 16px; height: 8px;"></div>
|
||||
<button onclick={toggle_mute} class:button_red={player && player.muted}>
|
||||
<button onclick={toggle_mute} class:button_red={player && player.muted} title="Mute">
|
||||
{#if player && player.muted}
|
||||
<i class="icon i_volume_off"></i>
|
||||
{:else}
|
||||
<i class="icon i_volume_up"></i>
|
||||
{/if}
|
||||
</button>
|
||||
<button onclick={toggle_fullscreen}>
|
||||
<button onclick={toggle_fullscreen} title="Fullscreen">
|
||||
<i class="icon i_fullscreen"></i>
|
||||
</button>
|
||||
<div class="spacer"></div>
|
||||
|
||||
@@ -10,6 +10,7 @@ let {
|
||||
class:button_highlight={toggle}
|
||||
style="margin: 0;"
|
||||
onclick={() => toggle = !toggle}
|
||||
title="Help"
|
||||
>
|
||||
<i class="icon i_help"></i>
|
||||
</button>
|
||||
|
||||
@@ -9,6 +9,7 @@ let {
|
||||
highlight = false,
|
||||
flat = false,
|
||||
action,
|
||||
title,
|
||||
children,
|
||||
}: {
|
||||
on?: boolean;
|
||||
@@ -20,6 +21,7 @@ let {
|
||||
highlight?: boolean;
|
||||
flat?: boolean;
|
||||
action?: (e: MouseEvent) => void;
|
||||
title?: string;
|
||||
children?: import('svelte').Snippet;
|
||||
} = $props();
|
||||
|
||||
@@ -34,6 +36,7 @@ const click = (e: MouseEvent) => {
|
||||
<button
|
||||
onclick={click}
|
||||
type="button"
|
||||
title={title}
|
||||
class="button"
|
||||
class:button_highlight={highlight}
|
||||
class:group_first
|
||||
|
||||
@@ -67,7 +67,7 @@ const del_domain = (index: number) => {
|
||||
{/if}
|
||||
{#each embed_domains as domain, index}
|
||||
<div class="form_row">
|
||||
<button class="shrink" type="button" onclick={() => del_domain(index)}>
|
||||
<button class="shrink" type="button" onclick={() => del_domain(index)} title="Remove">
|
||||
<i class="icon i_delete"></i>
|
||||
</button>
|
||||
<div>{domain}</div>
|
||||
|
||||
@@ -59,11 +59,11 @@ onMount(() => {
|
||||
</script>
|
||||
|
||||
<div class="toolbar">
|
||||
<Button click={last_month} icon="chevron_left"/>
|
||||
<Button click={last_month} icon="chevron_left" title="Previous month"/>
|
||||
<div class="toolbar_spacer">
|
||||
{month_str}
|
||||
</div>
|
||||
<Button click={next_month} icon="chevron_right"/>
|
||||
<Button click={next_month} icon="chevron_right" title="Next month"/>
|
||||
</div>
|
||||
|
||||
{#if data.length === 0}
|
||||
|
||||
@@ -108,11 +108,11 @@ onMount(() => {
|
||||
</script>
|
||||
|
||||
<div class="toolbar">
|
||||
<Button click={last_month} icon="chevron_left"/>
|
||||
<Button click={last_month} icon="chevron_left" title="Previous month"/>
|
||||
<div class="toolbar_spacer">
|
||||
{month_str}
|
||||
</div>
|
||||
<Button click={next_month} icon="chevron_right"/>
|
||||
<Button click={next_month} icon="chevron_right" title="Next month"/>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
|
||||
@@ -144,17 +144,17 @@ onMount(() => {
|
||||
{/if}
|
||||
|
||||
{#if i > 0}
|
||||
<Button click={() => swap_card(i, i-1)} icon="chevron_left" flat/>
|
||||
<Button click={() => swap_card(i, i-1)} icon="chevron_left" flat title="Move left"/>
|
||||
{/if}
|
||||
{#if i < cards.length-1}
|
||||
<Button click={() => swap_card(i, i+1)} icon="chevron_right" flat/>
|
||||
<Button click={() => swap_card(i, i+1)} icon="chevron_right" flat title="Move right"/>
|
||||
{/if}
|
||||
|
||||
<Button click={() => shrink(i)} icon="zoom_out" flat/>
|
||||
<Button click={() => shrink(i)} icon="zoom_out" flat title="Shrink"/>
|
||||
<span>
|
||||
{card.size === undefined ? 1 : card.size}
|
||||
</span>
|
||||
<Button click={() => expand(i)} icon="zoom_in" flat/>
|
||||
<Button click={() => expand(i)} icon="zoom_in" flat title="Enlarge"/>
|
||||
</div>
|
||||
|
||||
{#if !card.hidden && card.size > 0}
|
||||
|
||||
@@ -60,7 +60,7 @@ let {
|
||||
{@render header?.()}
|
||||
</div>
|
||||
|
||||
<button class="bucket_expand" onclick={e => {e.stopPropagation(); toggle()}}>
|
||||
<button class="bucket_expand" onclick={e => {e.stopPropagation(); toggle()}} title={expanded ? "Collapse" : "Expand"}>
|
||||
{#if expanded}
|
||||
<i class="icon i_expand_less"></i>
|
||||
{:else}
|
||||
|
||||
@@ -87,12 +87,12 @@ const keydown = (e: KeyboardEvent) => {
|
||||
<div class="header">
|
||||
{#if header}{@render header()}{:else}
|
||||
{#if form !== ""}
|
||||
<Button round click={hide} icon="close"/>
|
||||
<Button round click={hide} icon="close" title="Close"/>
|
||||
<span class="title">{title}</span>
|
||||
<Button round highlight type="submit" form={form} click={hide} icon="save" label="Save"/>
|
||||
{:else}
|
||||
<span class="title">{title}</span>
|
||||
<Button round click={hide} icon="close" />
|
||||
<Button round click={hide} icon="close" title="Close"/>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -301,7 +301,7 @@ const set_offset = (off: number) => {
|
||||
<div class="page">
|
||||
<div class="header bubble">
|
||||
<div class="breadcrumbs">
|
||||
<button class="menu_button" onclick={toggle_menu}>
|
||||
<button class="menu_button" onclick={toggle_menu} title="Menu">
|
||||
<i class="icon i_menu"></i>
|
||||
</button>
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ const drop = (e: DragEvent, drop_idx: number) => {
|
||||
<MenuEntry id="bookmarks">
|
||||
{#snippet title()}
|
||||
<div class="title">Bookmarks</div>
|
||||
<button onclick={toggle_edit} class:button_highlight={editing} class="button flat">
|
||||
<button onclick={toggle_edit} class:button_highlight={editing} class="button flat" title={editing ? "Save" : "Edit"}>
|
||||
{#if editing}
|
||||
<i class="icon i_save"></i>
|
||||
{:else}
|
||||
@@ -107,11 +107,12 @@ const drop = (e: DragEvent, drop_idx: number) => {
|
||||
style="cursor: grab;"
|
||||
onmousedown={enable_drag}
|
||||
onmouseup={disable_drag}
|
||||
title="Drag to reorder"
|
||||
>
|
||||
<i class="icon i_drag_indicator"></i>
|
||||
</button>
|
||||
<input type="text" bind:value={bookmark.label}/>
|
||||
<button onclick={() => delete_bookmark(bookmark.id)}>
|
||||
<button onclick={() => delete_bookmark(bookmark.id)} title="Remove">
|
||||
<i class="icon i_delete"></i>
|
||||
</button>
|
||||
{:else}
|
||||
|
||||
@@ -46,7 +46,15 @@ const toggle = (e: MouseEvent) => {
|
||||
</script>
|
||||
|
||||
<div class="title" class:no_border>
|
||||
<ToggleButton bind:on={expanded} action={toggle} icon_on="arrow_drop_down" icon_off="arrow_right" highlight={false} flat/>
|
||||
<ToggleButton
|
||||
bind:on={expanded}
|
||||
action={toggle}
|
||||
icon_on="arrow_drop_down"
|
||||
icon_off="arrow_right"
|
||||
highlight={false}
|
||||
flat
|
||||
title={expanded ? "Collapse" : "Expand"}
|
||||
/>
|
||||
|
||||
{#if !collapsed}
|
||||
{@render title()}
|
||||
|
||||
Reference in new issue
Block a user