Skip to content

Commit

Permalink
perf(vssue): improve accessibility (close #96)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed May 25, 2020
1 parent f4d752f commit 270b110
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 36 deletions.
14 changes: 12 additions & 2 deletions packages/vssue/src/components/VssueComment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
>
<!-- avatar -->
<div class="vssue-comment-avatar">
<a :href="author.homepage" :title="author.username" target="_blank">
<a
:href="author.homepage"
:title="author.username"
target="_blank"
rel="noopener noreferrer"
>
<img :src="author.avatar" :alt="author.username" />
</a>
</div>
Expand All @@ -19,7 +24,12 @@
<div class="vssue-comment-header">
<!-- author - username - link to profile page -->
<span class="vssue-comment-author">
<a :href="author.homepage" :title="author.username" target="_blank">
<a
:href="author.homepage"
:title="author.username"
target="_blank"
rel="noopener noreferrer"
>
{{ author.username }}
</a>
</span>
Expand Down
7 changes: 5 additions & 2 deletions packages/vssue/src/components/VssueHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class="vssue-header-comments-count"
:href="vssue.issue ? vssue.issue.link : null"
target="_blank"
rel="noopener noreferrer"
>
<span>
{{
Expand All @@ -24,10 +25,11 @@
<span v-if="vssue.API">
<a
:href="vssue.API.platform.link"
target="_blank"
:title="
`${vssue.API.platform.name} API ${vssue.API.platform.version}`
"
target="_blank"
rel="noopener noreferrer"
>
{{ vssue.API.platform.name }}
</a>
Expand All @@ -37,8 +39,9 @@

<a
href="https://github.com/meteorlxy/vssue"
target="_blank"
:title="`Vssue v${vssue.version}`"
target="_blank"
rel="noopener noreferrer"
>
Vssue
</a>
Expand Down
4 changes: 3 additions & 1 deletion packages/vssue/src/components/VssueNewComment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
:href="user.homepage"
:title="user.username"
target="_blank"
rel="noopener noreferrer"
>
<img :src="user.avatar" />
<img :src="user.avatar" :alt="user.username" />
</a>

<VssueIcon
Expand All @@ -28,6 +29,7 @@
:disabled="isInputDisabled"
:placeholder="vssue.$t(user ? 'placeholder' : 'noLoginPlaceHolder')"
:spellcheck="false"
aria-label="leave a comment"
@keyup.enter.ctrl="submit()"
/>
</div>
Expand Down
66 changes: 35 additions & 31 deletions packages/vssue/src/components/VssuePagination.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<template>
<div class="vssue-pagination">
<div class="vssue-pagination-per-page">
<select
v-model="perPage"
class="vssue-pagination-select"
:disabled="disabled"
>
<option v-for="val in perPageOptions" :key="val" :value="val">
{{ val }}
</option>
</select>

<span>
{{ vssue.$t('perPage') }}
</span>
<label>
<select
v-model="perPage"
class="vssue-pagination-select"
:disabled="disabled"
>
<option v-for="val in perPageOptions" :key="val" :value="val">
{{ val }}
</option>
</select>

<span>
{{ vssue.$t('perPage') }}
</span>
</label>

<span
v-if="vssue.API.platform.meta.sortable"
Expand All @@ -39,24 +41,26 @@
v-text="`<`"
/>

<span>
{{ vssue.$t('page') }}
</span>

<select
v-show="pageCount > 1"
v-model="page"
class="vssue-pagination-select"
:disabled="disabled"
>
<option v-for="val in pageCount" :key="val" :value="val">
{{ val }}
</option>
</select>

<span v-show="pageCount < 2" v-text="page" />

<span v-text="` / ${pageCount} `" />
<label>
<span>
{{ vssue.$t('page') }}
</span>

<select
v-show="pageCount > 1"
v-model="page"
class="vssue-pagination-select"
:disabled="disabled"
>
<option v-for="val in pageCount" :key="val" :value="val">
{{ val }}
</option>
</select>

<span v-show="pageCount < 2" v-text="page" />

<span v-text="` / ${pageCount} `" />
</label>

<span
:class="{
Expand Down

0 comments on commit 270b110

Please sign in to comment.