mirror of
https://github.com/ankitects/anki.git
synced 2026-01-09 12:03:56 -05:00
Added: Hr to shortcuts
This commit is contained in:
parent
e1ce4264d9
commit
7a64397eb7
2 changed files with 27 additions and 10 deletions
|
|
@ -8,6 +8,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import MoreItem from "./MoreItem.svelte";
|
import MoreItem from "./MoreItem.svelte";
|
||||||
import { setFlag } from "@generated/backend";
|
import { setFlag } from "@generated/backend";
|
||||||
import type { ReviewerState } from "../reviewer";
|
import type { ReviewerState } from "../reviewer";
|
||||||
|
import type { MoreMenuItemInfo } from "./types";
|
||||||
|
|
||||||
let showFloating = false;
|
let showFloating = false;
|
||||||
let showFlags = false;
|
let showFlags = false;
|
||||||
|
|
@ -27,7 +28,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
alert("Not yet implemented in new reviewer.");
|
alert("Not yet implemented in new reviewer.");
|
||||||
}
|
}
|
||||||
|
|
||||||
const shortcuts = [
|
const shortcuts: MoreMenuItemInfo[] = [
|
||||||
{
|
{
|
||||||
name: tr.studyingBuryCard(),
|
name: tr.studyingBuryCard(),
|
||||||
shortcut: "-",
|
shortcut: "-",
|
||||||
|
|
@ -44,6 +45,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
{ name: tr.actionsCardInfo(), shortcut: "I", onClick: todo },
|
{ name: tr.actionsCardInfo(), shortcut: "I", onClick: todo },
|
||||||
{ name: tr.actionsPreviousCardInfo(), shortcut: "Ctrl+Alt+I", onClick: todo },
|
{ name: tr.actionsPreviousCardInfo(), shortcut: "Ctrl+Alt+I", onClick: todo },
|
||||||
|
|
||||||
|
"hr",
|
||||||
// Notes
|
// Notes
|
||||||
{ name: tr.studyingMarkNote(), shortcut: "*", onClick: todo },
|
{ name: tr.studyingMarkNote(), shortcut: "*", onClick: todo },
|
||||||
{ name: tr.studyingBuryNote(), shortcut: "=", onClick: todo },
|
{ name: tr.studyingBuryNote(), shortcut: "=", onClick: todo },
|
||||||
|
|
@ -55,6 +57,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
onClick: todo,
|
onClick: todo,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"hr",
|
||||||
// Audio
|
// Audio
|
||||||
{ name: tr.actionsReplayAudio(), shortcut: "R", onClick: todo },
|
{ name: tr.actionsReplayAudio(), shortcut: "R", onClick: todo },
|
||||||
{ name: tr.studyingPauseAudio(), shortcut: "5", onClick: todo },
|
{ name: tr.studyingPauseAudio(), shortcut: "5", onClick: todo },
|
||||||
|
|
@ -113,15 +116,19 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</MoreSubmenu>
|
</MoreSubmenu>
|
||||||
</div>
|
</div>
|
||||||
{#each shortcuts as shortcut}
|
{#each shortcuts as shortcut}
|
||||||
<div
|
{#if shortcut == "hr"}
|
||||||
style:background-color={shortcut.onClick == todo
|
<hr />
|
||||||
? "RGBA(255,0,0,0.25)"
|
{:else}
|
||||||
: ""}
|
<div
|
||||||
>
|
style:background-color={shortcut.onClick == todo
|
||||||
<MoreItem shortcut={shortcut.shortcut} on:click={shortcut.onClick}>
|
? "RGBA(255,0,0,0.25)"
|
||||||
{shortcut.name}
|
: ""}
|
||||||
</MoreItem>
|
>
|
||||||
</div>
|
<MoreItem shortcut={shortcut.shortcut} on:click={shortcut.onClick}>
|
||||||
|
{shortcut.name}
|
||||||
|
</MoreItem>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
</MoreSubmenu>
|
</MoreSubmenu>
|
||||||
|
|
@ -140,6 +147,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,3 +7,9 @@ export interface AnswerButtonInfo {
|
||||||
"label": string;
|
"label": string;
|
||||||
"due": string;
|
"due": string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type MoreMenuItemInfo = {
|
||||||
|
name: string;
|
||||||
|
onClick: () => any;
|
||||||
|
shortcut: string;
|
||||||
|
} | "hr";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue