Appease the dog overlords

This commit is contained in:
Karina Kwiatek 2023-03-05 19:38:31 +01:00
parent 9a7dedcafc
commit f7b9d90e28
5 changed files with 49 additions and 48 deletions

View File

@ -100,27 +100,27 @@ $unicodeRangeValues in Lexend.$unicodeMap {
*/
@import "components/announcements",
"components/answerbox",
"components/avatars",
"components/buttons",
"components/collapse",
"components/comments",
"components/container",
"components/entry",
"components/hotkey",
"components/icons",
"components/inbox-actions",
"components/inbox-entry",
"components/mobile-nav",
"components/navbar",
"components/notifications",
"components/profile",
"components/push-settings",
"components/question",
"components/smiles",
"components/themes",
"components/totp-setup",
"components/userbox";
"components/answerbox",
"components/avatars",
"components/buttons",
"components/collapse",
"components/comments",
"components/container",
"components/entry",
"components/hotkey",
"components/icons",
"components/inbox-actions",
"components/inbox-entry",
"components/mobile-nav",
"components/navbar",
"components/notifications",
"components/profile",
"components/push-settings",
"components/question",
"components/smiles",
"components/themes",
"components/totp-setup",
"components/userbox";
/**
UTILITIES

View File

@ -1,4 +1,5 @@
.js-hotkey-navigating {
.js-hotkey-current-selection {
outline: var(--primary) solid 4px;
}

View File

@ -9,7 +9,7 @@ export default class extends Controller {
declare readonly currentTarget: HTMLElement;
declare readonly traversableTargets: HTMLElement[];
traversableTargetConnected(target: HTMLElement) {
traversableTargetConnected(target: HTMLElement): void {
if (!("navigationIndex" in target.dataset)) {
target.dataset.navigationIndex = this.traversableTargets.indexOf(target).toString();
}
@ -20,14 +20,14 @@ export default class extends Controller {
}
}
currentTargetConnected(target: HTMLElement) {
currentTargetConnected(target: HTMLElement): void {
target.classList.add("js-hotkey-current-selection");
target.querySelectorAll<HTMLElement>("[data-selection-hotkey]")
.forEach(el => install(el, el.dataset.selectionHotkey));
}
currentTargetDisconnected(target: HTMLElement) {
currentTargetDisconnected(target: HTMLElement): void {
target.classList.remove("js-hotkey-current-selection");
target.querySelectorAll<HTMLElement>("[data-selection-hotkey]")

View File

@ -9,17 +9,17 @@
%span.badge.rounded-pill.bg-warning.text-bg-warning.fs-7
DEV
%ul.nav.navbar-nav.me-auto
= nav_entry t("navigation.timeline"), root_path, icon: 'home', hotkey: "g t"
= nav_entry t("navigation.timeline"), root_path, icon: "home", hotkey: "g t"
= nav_entry t("navigation.inbox"), "/inbox", icon: "inbox", badge: inbox_count, badge_attr: { data: { controller: "pwa-badge" } }, hotkey: "g i"
- if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod?
= nav_entry t("navigation.discover"), discover_path, icon: 'compass', hotkey: "g d"
= nav_entry t("navigation.discover"), discover_path, icon: "compass", hotkey: "g d"
%ul.nav.navbar-nav
- if @user.present? && @user != current_user
%li.nav-item.d-none.d-sm-block{ data: { bs_toggle: 'tooltip', bs_placement: 'bottom' }, title: t(".list") }
%a.nav-link{ href: '#', data: { bs_target: '#modal-list-memberships', bs_toggle: :modal } }
%i.fa.fa-list.hidden-xs
%span.d-none.d-sm-inline.d-md-none= t(".list")
= nav_entry t("navigation.notifications"), notifications_path, badge: notification_count, class: 'd-block d-sm-none', hotkey: "g n"
= nav_entry t("navigation.notifications"), notifications_path, badge: notification_count, class: "d-block d-sm-none", hotkey: "g n"
%li.nav-item.dropdown.d-none.d-sm-block
%a.nav-link.dropdown-toggle{ href: '#', data: { bs_toggle: :dropdown } }
- if notification_count.nil?
@ -30,7 +30,7 @@
%span.badge= notification_count
= render 'navigation/dropdown/notifications', notifications: notifications, size: "desktop"
%li.nav-item.d-none.d-sm-block{ data: { bs_toggle: 'tooltip', bs_placement: 'bottom' }, title: t('.ask_question') }
%a.nav-link{ href: '#', name: 'toggle-all-ask', data: { bs_target: '#modal-ask-followers', bs_toggle: :modal, hotkey: "n" } }
%a.nav-link{ href: "#", name: "toggle-all-ask", data: { bs_target: "#modal-ask-followers", bs_toggle: :modal, hotkey: "n" } }
%i.fa.fa-pencil-square-o
%li.nav-item.dropdown.profile--image-dropdown
%a.nav-link.dropdown-toggle.p-sm-0{ href: "#", data: { bs_toggle: :dropdown } }

View File

@ -1,8 +1,8 @@
.modal.fade#modal-hotkeys{ aria: { hidden: true, labelledby: 'modal-hotkeys-label' }, role: :dialog, tabindex: -1 }
.modal.fade#modal-hotkeys{ aria: { hidden: true, labelledby: "modal-hotkeys-label" }, role: :dialog, tabindex: -1 }
.modal-dialog
.modal-content
.modal-header
%h5.modal-title#modal-hotkeys-label= t('.title')
%h5.modal-title#modal-hotkeys-label= t(".title")
%button.btn-close{ data: { bs_dismiss: :modal }, type: :button }
%span.visually-hidden= t("voc.close")
.modal-body
@ -10,71 +10,71 @@
.col-6
.card
.card-header
%h5.card-title= t('.navigation.title')
%h5.card-title= t(".navigation.title")
%ul.list-group.list-group-flush
%li.list-group-item
= t('navigation.timeline')
= t("navigation.timeline")
%kbd
%kbd g
%kbd t
%li.list-group-item
= t('navigation.inbox')
= t("navigation.inbox")
%kbd
%kbd g
%kbd i
- if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod?
%li.list-group-item
= t('navigation.discover')
= t("navigation.discover")
%kbd
%kbd g
%kbd d
%li.list-group-item
= t('navigation.notifications')
= t("navigation.notifications")
%kbd
%kbd g
%kbd n
%li.list-group-item
= t('navigation.dropdown.profile.profile')
= t("navigation.dropdown.profile.profile")
%kbd
%kbd g
%kbd p
.col-6
.card
.card-header
%h5.card-title= t('.global.title')
%h5.card-title= t(".global.title")
%ul.list-group.list-group-flush
%li.list-group-item
= t('.global.navigation.up')
= t(".global.navigation.up")
%kbd k
%li.list-group-item
= t('.global.navigation.down')
= t(".global.navigation.down")
%kbd j
%li.list-group-item
= t('navigation.desktop.ask_question')
= t("navigation.desktop.ask_question")
%kbd n
%li.list-group-item
= t('voc.load')
= t("voc.load")
%kbd .
%li.list-group-item
= t('.show_dialog')
= t(".show_dialog")
%kbd ?
.card
.card-header
%h5.card-title= t('.answer.title')
%h5.card-title= t(".answer.title")
%ul.list-group.list-group-flush
%li.list-group-item
= t('voc.smile')
= t("voc.smile")
%kbd s
%li.list-group-item
= t('.answer.view_comments')
= t(".answer.view_comments")
%kbd x
%li.list-group-item
= t('.answer.comment')
= t(".answer.comment")
%kbd c
%li.list-group-item
= t('.answer.all_answers')
= t(".answer.all_answers")
%kbd a
%li.list-group-item
= t('.answer.view_answer')
= t(".answer.view_answer")
%kbd l