From 45d70e8e6b71c9b65964d2e4451890bec553e489 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sat, 19 Jan 2019 16:40:31 -0800 Subject: [PATCH] feat: add more keyboard shortcuts (#904) * feat: add more keyboard shortcuts largely fixes #895 * oops wrong test name --- src/routes/_actions/mention.js | 8 +++ src/routes/_components/NavShortcuts.html | 7 +- src/routes/_components/ShortcutHelpInfo.html | 68 +++++++++++++------ .../AccountProfileOptionsDialog.html | 12 ++-- .../_components/status/Notification.html | 29 +++++++- src/routes/_components/status/Status.html | 14 +++- tests/spec/025-shortcuts-status.js | 31 ++++++--- tests/spec/026-shortcuts-notification.js | 58 ++++++++++++++++ 8 files changed, 184 insertions(+), 43 deletions(-) create mode 100644 src/routes/_actions/mention.js create mode 100644 tests/spec/026-shortcuts-notification.js diff --git a/src/routes/_actions/mention.js b/src/routes/_actions/mention.js new file mode 100644 index 00000000..68bf84e2 --- /dev/null +++ b/src/routes/_actions/mention.js @@ -0,0 +1,8 @@ +import { importShowComposeDialog } from '../_components/dialog/asyncDialogs' +import { store } from '../_store/store' + +export async function composeNewStatusMentioning (account) { + store.setComposeData('dialog', { text: `@${account.acct} ` }) + let showComposeDialog = await importShowComposeDialog() + showComposeDialog() +} diff --git a/src/routes/_components/NavShortcuts.html b/src/routes/_components/NavShortcuts.html index 0a476bd4..a2aed5b9 100644 --- a/src/routes/_components/NavShortcuts.html +++ b/src/routes/_components/NavShortcuts.html @@ -6,6 +6,7 @@ + {#each $navPages as navPage, i} {/each} @@ -13,7 +14,7 @@ \ No newline at end of file + diff --git a/src/routes/_components/status/Notification.html b/src/routes/_components/status/Notification.html index be6e3eb5..f6ce14d4 100644 --- a/src/routes/_components/status/Notification.html +++ b/src/routes/_components/status/Notification.html @@ -3,14 +3,19 @@ {status} {notification} {active} {shortcutScope} on:recalculateHeight /> {:else} -
+ {#if shortcutScope} + + + {/if}
{/if}