diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-22 12:05:32 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-22 12:05:32 +0100 |
commit | 1916c9663ac632227e60ebc93cec616b2dd6800d (patch) | |
tree | 606b753ed93aeec5d4232925c55642bd8d43c000 /client/src/app/shared | |
parent | 2b6c55528d252be180a9b206b9de01c44e67b24f (diff) | |
download | PeerTube-1916c9663ac632227e60ebc93cec616b2dd6800d.tar.gz PeerTube-1916c9663ac632227e60ebc93cec616b2dd6800d.tar.zst PeerTube-1916c9663ac632227e60ebc93cec616b2dd6800d.zip |
Fix some accessibility issues
Diffstat (limited to 'client/src/app/shared')
10 files changed, 35 insertions, 24 deletions
diff --git a/client/src/app/shared/shared-forms/dynamic-form-field.component.html b/client/src/app/shared/shared-forms/dynamic-form-field.component.html index 658d8ce5b..cb82ad752 100644 --- a/client/src/app/shared/shared-forms/dynamic-form-field.component.html +++ b/client/src/app/shared/shared-forms/dynamic-form-field.component.html | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | <input *ngIf="setting.type === 'input'" type="text" [id]="setting.name" [formControlName]="setting.name" /> | 6 | <input *ngIf="setting.type === 'input'" type="text" [id]="setting.name" [formControlName]="setting.name" /> |
7 | 7 | ||
8 | <my-input-toggle-hidden *ngIf="setting.type === 'input-password'" [formControlName]="setting.name" [id]="setting.name"></my-input-toggle-hidden> | 8 | <my-input-toggle-hidden *ngIf="setting.type === 'input-password'" [formControlName]="setting.name" [inputId]="setting.name"></my-input-toggle-hidden> |
9 | 9 | ||
10 | <textarea *ngIf="setting.type === 'input-textarea'" type="text" [id]="setting.name" [formControlName]="setting.name"></textarea> | 10 | <textarea *ngIf="setting.type === 'input-textarea'" type="text" [id]="setting.name" [formControlName]="setting.name"></textarea> |
11 | 11 | ||
diff --git a/client/src/app/shared/shared-forms/input-toggle-hidden.component.html b/client/src/app/shared/shared-forms/input-toggle-hidden.component.html index af7c6650f..e7441e4c1 100644 --- a/client/src/app/shared/shared-forms/input-toggle-hidden.component.html +++ b/client/src/app/shared/shared-forms/input-toggle-hidden.component.html | |||
@@ -1,12 +1,19 @@ | |||
1 | <div class="input-group input-group-sm"> | 1 | <div class="input-group input-group-sm"> |
2 | <input [id]="id" [autocomplete]="autocomplete" [value]="value" [placeholder]="placeholder" [tabindex]="tabindex" [(ngModel)]="value" (ngModelChange)="update()" [ngClass]="{ 'readonly': readonly }" [readonly]="readonly" | 2 | <input |
3 | #input (click)="input.select()" (input)="update()" (change)="update()" [type]="inputType" class="form-control" /> | 3 | [id]="inputId" [autocomplete]="autocomplete" [value]="value" [placeholder]="placeholder" [tabindex]="tabindex" |
4 | [(ngModel)]="value" (ngModelChange)="update()" [ngClass]="{ 'readonly': readonly }" [readonly]="readonly" | ||
5 | #input (click)="input.select()" (input)="update()" (change)="update()" [type]="inputType" class="form-control" | ||
6 | /> | ||
4 | 7 | ||
5 | <div *ngIf="withToggle || withCopy" class="input-group-append"> | 8 | <div *ngIf="withToggle || withCopy" class="input-group-append"> |
6 | <button *ngIf="withToggle" (click)="toggle()" type="button" class="btn btn-outline-secondary" [title]="toggleTitle"> | 9 | <button *ngIf="withToggle" (click)="toggle()" type="button" class="btn btn-outline-secondary" [title]="toggleTitle"> |
7 | <span class="glyphicon glyphicon-eye-{{ show ? 'open' : 'close' }}"></span> | 10 | <span class="glyphicon glyphicon-eye-{{ show ? 'open' : 'close' }}"></span> |
8 | </button> | 11 | </button> |
9 | <button *ngIf="withCopy" [cdkCopyToClipboard]="input.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary" i18n-title title="Copy"> | 12 | |
13 | <button | ||
14 | *ngIf="withCopy" [cdkCopyToClipboard]="input.value" (click)="activateCopiedMessage()" type="button" | ||
15 | class="btn btn-outline-secondary" i18n-title title="Copy" | ||
16 | > | ||
10 | <span class="glyphicon glyphicon-copy"></span> | 17 | <span class="glyphicon glyphicon-copy"></span> |
11 | </button> | 18 | </button> |
12 | </div> | 19 | </div> |
diff --git a/client/src/app/shared/shared-forms/input-toggle-hidden.component.ts b/client/src/app/shared/shared-forms/input-toggle-hidden.component.ts index 56e5b9762..e03353fe1 100644 --- a/client/src/app/shared/shared-forms/input-toggle-hidden.component.ts +++ b/client/src/app/shared/shared-forms/input-toggle-hidden.component.ts | |||
@@ -15,7 +15,7 @@ import { Notifier } from '@app/core' | |||
15 | ] | 15 | ] |
16 | }) | 16 | }) |
17 | export class InputToggleHiddenComponent implements ControlValueAccessor { | 17 | export class InputToggleHiddenComponent implements ControlValueAccessor { |
18 | @Input() id = Math.random().toString(11).slice(2, 8) // id cannot be left empty or undefined | 18 | @Input() inputId = Math.random().toString(11).slice(2, 8) // id cannot be left empty or undefined |
19 | @Input() value = '' | 19 | @Input() value = '' |
20 | @Input() autocomplete = 'off' | 20 | @Input() autocomplete = 'off' |
21 | @Input() placeholder = '' | 21 | @Input() placeholder = '' |
diff --git a/client/src/app/shared/shared-forms/peertube-checkbox.component.html b/client/src/app/shared/shared-forms/peertube-checkbox.component.html index 704f3e696..9d0402224 100644 --- a/client/src/app/shared/shared-forms/peertube-checkbox.component.html +++ b/client/src/app/shared/shared-forms/peertube-checkbox.component.html | |||
@@ -8,7 +8,7 @@ | |||
8 | [id]="inputName" | 8 | [id]="inputName" |
9 | [disabled]="disabled" | 9 | [disabled]="disabled" |
10 | /> | 10 | /> |
11 | <span role="checkbox" [attr.aria-checked]="checked"></span> | 11 | <span role="checkbox" [attr.aria-checked]="checked" [attr.aria-label]="labelText || labelInnerHTML"></span> |
12 | <span *ngIf="labelText">{{ labelText }}</span> | 12 | <span *ngIf="labelText">{{ labelText }}</span> |
13 | <span | 13 | <span |
14 | *ngIf="!labelText && labelInnerHTML" | 14 | *ngIf="!labelText && labelInnerHTML" |
diff --git a/client/src/app/shared/shared-forms/select/select-channel.component.html b/client/src/app/shared/shared-forms/select/select-channel.component.html index 897d13ee7..f83f17a16 100644 --- a/client/src/app/shared/shared-forms/select/select-channel.component.html +++ b/client/src/app/shared/shared-forms/select/select-channel.component.html | |||
@@ -7,10 +7,7 @@ | |||
7 | [searchable]="searchable" | 7 | [searchable]="searchable" |
8 | > | 8 | > |
9 | <ng-option *ngFor="let channel of channels" [value]="channel.id"> | 9 | <ng-option *ngFor="let channel of channels" [value]="channel.id"> |
10 | <img | 10 | <img alt="" class="avatar mr-1" [src]="channel.avatarPath" /> |
11 | class="avatar mr-1" | ||
12 | [src]="channel.avatarPath" | ||
13 | /> | ||
14 | {{ channel.label }} | 11 | {{ channel.label }} |
15 | </ng-option> | 12 | </ng-option> |
16 | </ng-select> | 13 | </ng-select> |
diff --git a/client/src/app/shared/shared-main/buttons/action-dropdown.component.html b/client/src/app/shared/shared-main/buttons/action-dropdown.component.html index 8b363b351..d0487f0b8 100644 --- a/client/src/app/shared/shared-main/buttons/action-dropdown.component.html +++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.html | |||
@@ -1,7 +1,7 @@ | |||
1 | <div class="dropdown-root" ngbDropdown [placement]="placement" [container]="container" *ngIf="areActionsDisplayed(actions, entry)"> | 1 | <div class="dropdown-root" ngbDropdown [placement]="placement" [container]="container" *ngIf="areActionsDisplayed(actions, entry)"> |
2 | <button | 2 | <button |
3 | class="action-button" [ngClass]="{ small: buttonSize === 'small', grey: theme === 'grey', orange: theme === 'orange', 'button-styled': buttonStyled }" | 3 | class="action-button" [ngClass]="{ small: buttonSize === 'small', grey: theme === 'grey', orange: theme === 'orange', 'button-styled': buttonStyled }" |
4 | ngbDropdownToggle role="button" | 4 | ngbDropdownToggle role="button" aria-label="Open actions" i18n-aria-label |
5 | > | 5 | > |
6 | <my-global-icon *ngIf="!label && buttonDirection === 'horizontal'" class="more-icon" iconName="more-horizontal"></my-global-icon> | 6 | <my-global-icon *ngIf="!label && buttonDirection === 'horizontal'" class="more-icon" iconName="more-horizontal"></my-global-icon> |
7 | <my-global-icon *ngIf="!label && buttonDirection === 'vertical'" class="more-icon" iconName="more-vertical"></my-global-icon> | 7 | <my-global-icon *ngIf="!label && buttonDirection === 'vertical'" class="more-icon" iconName="more-vertical"></my-global-icon> |
diff --git a/client/src/app/shared/shared-main/feeds/feed.component.html b/client/src/app/shared/shared-main/feeds/feed.component.html index a00011785..914fe6d46 100644 --- a/client/src/app/shared/shared-main/feeds/feed.component.html +++ b/client/src/app/shared/shared-main/feeds/feed.component.html | |||
@@ -1,7 +1,8 @@ | |||
1 | <div class="feed"> | 1 | <div class="feed"> |
2 | <my-global-icon | 2 | <my-global-icon |
3 | role="button" aria-label="Open syndication dropdown" i18n-aria-label | ||
3 | *ngIf="syndicationItems.length !== 0" [ngbPopover]="feedsList" [autoClose]="true" placement="bottom left auto" | 4 | *ngIf="syndicationItems.length !== 0" [ngbPopover]="feedsList" [autoClose]="true" placement="bottom left auto" |
4 | class="icon-syndication" role="button" iconName="syndication" | 5 | class="icon-syndication" iconName="syndication" |
5 | > | 6 | > |
6 | </my-global-icon> | 7 | </my-global-icon> |
7 | 8 | ||
diff --git a/client/src/app/shared/shared-user-subscription/subscribe-button.component.html b/client/src/app/shared/shared-user-subscription/subscribe-button.component.html index 85b3d1fdb..d60fd5c5f 100644 --- a/client/src/app/shared/shared-user-subscription/subscribe-button.component.html +++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.html | |||
@@ -1,5 +1,7 @@ | |||
1 | <div class="btn-group-subscribe btn-group" | 1 | <div |
2 | [ngClass]="{'subscribe-button': !isAllChannelsSubscribed, 'unsubscribe-button': isAllChannelsSubscribed, 'big': isBigButton }"> | 2 | class="btn-group-subscribe btn-group" |
3 | [ngClass]="{'subscribe-button': !isAllChannelsSubscribed, 'unsubscribe-button': isAllChannelsSubscribed, 'big': isBigButton }" | ||
4 | > | ||
3 | 5 | ||
4 | <ng-template #userLoggedOut> | 6 | <ng-template #userLoggedOut> |
5 | <span [ngClass]="{ 'extra-text': isAtLeastOneChannelSubscribed }"> | 7 | <span [ngClass]="{ 'extra-text': isAtLeastOneChannelSubscribed }"> |
@@ -18,9 +20,10 @@ | |||
18 | </ng-template> | 20 | </ng-template> |
19 | 21 | ||
20 | <ng-template #userLoggedIn> | 22 | <ng-template #userLoggedIn> |
21 | <button *ngIf="!isAllChannelsSubscribed" type="button" | 23 | <button |
22 | class="btn btn-sm" role="button" | 24 | *ngIf="!isAllChannelsSubscribed" type="button" |
23 | (click)="subscribe()"> | 25 | class="btn btn-sm" (click)="subscribe()" |
26 | > | ||
24 | <ng-template [ngTemplateOutlet]="userLoggedOut"></ng-template> | 27 | <ng-template [ngTemplateOutlet]="userLoggedOut"></ng-template> |
25 | </button> | 28 | </button> |
26 | 29 | ||
@@ -36,10 +39,11 @@ | |||
36 | *ngIf="isUserLoggedIn(); then userLoggedIn"> | 39 | *ngIf="isUserLoggedIn(); then userLoggedIn"> |
37 | </ng-container> | 40 | </ng-container> |
38 | 41 | ||
39 | <div class="btn-group" ngbDropdown autoClose="outside" | 42 | <div |
40 | placement="bottom-right" role="group" | 43 | class="btn-group" ngbDropdown autoClose="outside" placement="bottom-right" |
41 | aria-label="Multiple ways to subscribe to the current channel"> | 44 | role="group" aria-label="Multiple ways to subscribe to the current channel" i18n-aria-label |
42 | <button class="btn btn-sm dropdown-toggle-split" ngbDropdownToggle> | 45 | > |
46 | <button class="btn btn-sm dropdown-toggle-split" ngbDropdownToggle aria-label="Open subscription dropdown" i18n-aria-label> | ||
43 | <ng-container | 47 | <ng-container |
44 | *ngIf="!isUserLoggedIn(); then userLoggedOut"> | 48 | *ngIf="!isUserLoggedIn(); then userLoggedOut"> |
45 | </ng-container> | 49 | </ng-container> |
diff --git a/client/src/app/shared/shared-video-live/live-stream-information.component.html b/client/src/app/shared/shared-video-live/live-stream-information.component.html index e7b00cd01..57920239d 100644 --- a/client/src/app/shared/shared-video-live/live-stream-information.component.html +++ b/client/src/app/shared/shared-video-live/live-stream-information.component.html | |||
@@ -17,12 +17,12 @@ | |||
17 | 17 | ||
18 | <div class="form-group"> | 18 | <div class="form-group"> |
19 | <label for="liveVideoRTMPUrl" i18n>Live RTMP Url</label> | 19 | <label for="liveVideoRTMPUrl" i18n>Live RTMP Url</label> |
20 | <my-input-toggle-hidden id="liveVideoRTMPUrl" [value]="live.rtmpUrl" [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true"></my-input-toggle-hidden> | 20 | <my-input-toggle-hidden inputId="liveVideoRTMPUrl" [value]="live.rtmpUrl" [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true"></my-input-toggle-hidden> |
21 | </div> | 21 | </div> |
22 | 22 | ||
23 | <div class="form-group"> | 23 | <div class="form-group"> |
24 | <label for="liveVideoStreamKey" i18n>Live stream key</label> | 24 | <label for="liveVideoStreamKey" i18n>Live stream key</label> |
25 | <my-input-toggle-hidden id="liveVideoStreamKey" [value]="live.streamKey" [withCopy]="true" [readonly]="true"></my-input-toggle-hidden> | 25 | <my-input-toggle-hidden inputId="liveVideoStreamKey" [value]="live.streamKey" [withCopy]="true" [readonly]="true"></my-input-toggle-hidden> |
26 | 26 | ||
27 | <div class="form-group-description" i18n>⚠️ Never share your stream key with anyone.</div> | 27 | <div class="form-group-description" i18n>⚠️ Never share your stream key with anyone.</div> |
28 | </div> | 28 | </div> |
diff --git a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html index 00ee196ac..0cbf05bcc 100644 --- a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html +++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html | |||
@@ -1,6 +1,8 @@ | |||
1 | <ng-container *ngIf="videoActions.length !== 0"> | 1 | <ng-container *ngIf="videoActions.length !== 0"> |
2 | 2 | ||
3 | <div class="playlist-dropdown" ngbDropdown #playlistDropdown="ngbDropdown" role="button" autoClose="outside" [placement]="getPlaylistDropdownPlacement()" | 3 | <div |
4 | role="button" aria-label="Open video actions" i18n-aria-label | ||
5 | class="playlist-dropdown" ngbDropdown #playlistDropdown="ngbDropdown" autoClose="outside" [placement]="getPlaylistDropdownPlacement()" | ||
4 | *ngIf="isUserLoggedIn() && displayOptions.playlist" (openChange)="playlistAdd.openChange($event)" | 6 | *ngIf="isUserLoggedIn() && displayOptions.playlist" (openChange)="playlistAdd.openChange($event)" |
5 | > | 7 | > |
6 | <span class="anchor" ngbDropdownAnchor></span> | 8 | <span class="anchor" ngbDropdownAnchor></span> |