From cf00fefa6b0e4b0a2755551b5609913022259c70 Mon Sep 17 00:00:00 2001 From: cutls Date: Tue, 21 Apr 2020 23:56:04 +0900 Subject: [PATCH] Accessibility --- app/css/master.css | 15 +++- app/js/common/keyshortcut.js | 7 ++ app/js/tl/directory.js | 2 +- app/js/tl/filter.js | 2 +- app/js/tl/list.js | 2 +- app/js/tl/parse.js | 82 +++++++++++---------- app/js/tl/src.js | 2 +- app/js/ui/layout.js | 22 +++--- app/js/ui/menu.js | 3 +- app/js/ui/sort.js | 2 +- app/view/make/acct.sample.html | 5 +- app/view/make/index.sample.html | 108 ++++++++++++++-------------- app/view/make/language/en/acct.json | 1 + app/view/make/language/en/main.json | 1 + app/view/make/language/ja/acct.json | 1 + app/view/make/language/ja/main.json | 1 + 16 files changed, 145 insertions(+), 111 deletions(-) diff --git a/app/css/master.css b/app/css/master.css index 2e37af9a..4c90049b 100644 --- a/app/css/master.css +++ b/app/css/master.css @@ -342,21 +342,22 @@ blockquote:before, #left-menu { width: 230px; } -#left-menu div { +#left-menu a { padding-left: 5px; width: 100%; height: 50px; display: flex; align-items: center; cursor: pointer; + color: var(--color); } -#left-menu div:hover { +#left-menu a:hover { background-color: var(--beforehover); } #left-menu span { margin-left: 5px; } -#left-menu div.active { +#left-menu a.active { background-color: var(--emphasized); } #right-menu { @@ -376,6 +377,7 @@ blockquote:before, width: 170px; height: 40px; cursor: pointer; + color: var(--color); } #tltype .type span { width: calc(100% - 30px); @@ -514,6 +516,13 @@ textarea { #pageSrcInput { width: 160px; } +.voice { + clip: rect(1px, 1px, 1px, 1px); + position: absolute !important; + height: 1px; + width: 1px; + overflow: hidden; +} @media (max-width: 500px) { #pageSrc { diff --git a/app/js/common/keyshortcut.js b/app/js/common/keyshortcut.js index b09fbce6..07722f61 100644 --- a/app/js/common/keyshortcut.js +++ b/app/js/common/keyshortcut.js @@ -115,6 +115,13 @@ $(function($) { return false } } + //Ctrl+K:メニュー開閉 + if (event.metaKey || event.ctrlKey) { + if (e.keyCode === 75) { + menu() + return false + } + } //Ctrl+Space:読み込み if (event.metaKey || event.ctrlKey) { if (e.keyCode === 32) { diff --git a/app/js/tl/directory.js b/app/js/tl/directory.js index 85470633..e7d81d50 100644 --- a/app/js/tl/directory.js +++ b/app/js/tl/directory.js @@ -3,7 +3,7 @@ function dirMenu() { $("#dir-contents").html(""); directory(); - $("#left-menu div").removeClass("active"); + $("#left-menu a").removeClass("active"); $("#dirMenu").addClass("active"); $(".menu-content").addClass("hide"); $("#dir-box").removeClass("hide"); diff --git a/app/js/tl/filter.js b/app/js/tl/filter.js index 61878950..d1eb29b4 100644 --- a/app/js/tl/filter.js +++ b/app/js/tl/filter.js @@ -101,7 +101,7 @@ function delreset(tlid) { } /*ワードフィルター機能*/ function filterMenu() { - $('#left-menu div').removeClass('active') + $('#left-menu a').removeClass('active') $('#filterMenu').addClass('active') $('.menu-content').addClass('hide') $('#filter-box').removeClass('hide') diff --git a/app/js/tl/list.js b/app/js/tl/list.js index 579bbfcb..c30bad4a 100644 --- a/app/js/tl/list.js +++ b/app/js/tl/list.js @@ -1,5 +1,5 @@ function listMenu() { - $('#left-menu div').removeClass('active') + $('#left-menu a').removeClass('active') $('#listMenu').addClass('active') $('.menu-content').addClass('hide') $('#list-box').removeClass('hide') diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index 607b1212..636bb5ce 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -241,7 +241,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { noticeavatar = toot.account.avatar_static } noticeavatar = ` - + ` if (toot.type == 'mention') { var what = lang.lang_parse_mentioned @@ -268,15 +268,15 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { } else { var notfFilHide = '' } - var noticetext = ` - + var noticetext = ` + ${lang.lang_parse_notffilter} - + })" aria-hidden="true"> ${date(toot.created_at, datetype)} + ${date(toot.created_at, 'absolute')}(${lang.lang_parse_notftime}) ${dis_name}(@${toot.account.acct}) @@ -393,7 +393,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { } else { noticeavatar = toot.account.avatar_static } - noticeavatar = ` + noticeavatar = `` @@ -518,7 +518,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { var spoil = escapeHTML(toot.spoiler_text) var spoiler = 'cw cw_hide' var api_spoil = 'gray' - var spoiler_show = `${lang.lang_parse_cwshow}
` + var spoiler_show = `${lang.lang_parse_cwshow}${lang.lang_parse_cwshow_acc}
` } else { if (content) { var ct1 = content.split('

').length + content.split('
').length - 2 @@ -576,7 +576,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { } if (urls) { - var analyze = ` + var analyze = `
` } else { @@ -621,7 +621,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { viewer + ` - ` } else { if (media.type == 'unknown') { @@ -634,7 +634,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { viewer + '