From db6c760c036adf858f55c6d2e4e3c7628d54cd2d Mon Sep 17 00:00:00 2001 From: Tuomas Airaksinen Date: Thu, 25 Nov 2021 16:16:07 +0200 Subject: [PATCH 1/2] Continue working on #1878. Implement keyboard modes and verse focus keys. --- app/bibleview-js/src/common.scss | 18 +++++ app/bibleview-js/src/components/BibleView.vue | 26 +++++-- .../src/components/OSIS/Reference.vue | 2 +- .../src/components/OSIS/Verse.vue | 26 ++++++- app/bibleview-js/src/components/OSIS/W.vue | 2 +- .../src/components/TextEditor.vue | 5 +- .../components/modals/AmbiguousSelection.vue | 2 +- app/bibleview-js/src/composables/index.js | 26 ------- app/bibleview-js/src/composables/keyboard.js | 76 +++++++++++++++++-- app/bibleview-js/src/composables/scroll.js | 5 +- .../src/composables/verse-handling.js | 57 ++++++++++++++ app/bibleview-js/src/utils.js | 9 +++ app/bibleview-js/tests/unit/verse.spec.js | 4 +- .../control/page/window/WindowControl.kt | 2 - .../activity/page/BibleJavascriptInterface.kt | 19 +++-- 15 files changed, 217 insertions(+), 62 deletions(-) create mode 100644 app/bibleview-js/src/composables/verse-handling.js diff --git a/app/bibleview-js/src/common.scss b/app/bibleview-js/src/common.scss index b54bd0b478..8f3f26393b 100644 --- a/app/bibleview-js/src/common.scss +++ b/app/bibleview-js/src/common.scss @@ -172,6 +172,24 @@ $modal-content-background-color-night: rgb(33, 33, 33); } } +$focusDay: rgb(255, 182, 123, 1.0); +$focusNight: rgb(255, 182, 123, 0.5); + +:focus-visible { + outline: $focusDay auto 1px; + & .night { + outline: $focusNight auto 1px; + } +} + +.isFocused { + //@extend .isHighlighted; + //background-color: rgba(255, 0, 0, 0.1); + //.night & { + // background-color: rgba(255, 0, 0, 0.3); + //} +} + .one-liner { white-space: nowrap; text-overflow: ellipsis; diff --git a/app/bibleview-js/src/components/BibleView.vue b/app/bibleview-js/src/components/BibleView.vue index 2e3806f032..6e712da808 100644 --- a/app/bibleview-js/src/components/BibleView.vue +++ b/app/bibleview-js/src/components/BibleView.vue @@ -16,7 +16,7 @@ -->