mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Hide SM2-specific items in help pages when FSRS enabled
This commit is contained in:
parent
f4b760153f
commit
8b4c57fbce
5 changed files with 32 additions and 6 deletions
|
@ -15,12 +15,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import HelpSection from "./HelpSection.svelte";
|
import HelpSection from "./HelpSection.svelte";
|
||||||
import { infoCircle, manualIcon } from "./icons";
|
import { infoCircle, manualIcon } from "./icons";
|
||||||
import Row from "./Row.svelte";
|
import Row from "./Row.svelte";
|
||||||
import type { HelpItem } from "./types";
|
import { type HelpItem, HelpItemScheduler } from "./types";
|
||||||
|
|
||||||
export let title: string;
|
export let title: string;
|
||||||
export let url: string;
|
export let url: string;
|
||||||
export let startIndex = 0;
|
export let startIndex = 0;
|
||||||
export let helpSections: HelpItem[];
|
export let helpSections: HelpItem[];
|
||||||
|
export let fsrs = false;
|
||||||
|
|
||||||
export const modalKey: string = Math.random().toString(36).substring(2);
|
export const modalKey: string = Math.random().toString(36).substring(2);
|
||||||
|
|
||||||
|
@ -93,7 +94,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
<nav>
|
<nav>
|
||||||
<div id="nav">
|
<div id="nav">
|
||||||
<ul>
|
<ul>
|
||||||
{#each helpSections as section, i}
|
{#each helpSections as item, i}
|
||||||
<li>
|
<li>
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
|
@ -101,8 +102,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
carousel.to(activeIndex);
|
carousel.to(activeIndex);
|
||||||
}}
|
}}
|
||||||
class:active={i == activeIndex}
|
class:active={i == activeIndex}
|
||||||
|
class:d-none={fsrs
|
||||||
|
? item.sched ===
|
||||||
|
HelpItemScheduler.SM2
|
||||||
|
: item.sched ==
|
||||||
|
HelpItemScheduler.FSRS}
|
||||||
>
|
>
|
||||||
{section.title}
|
{item.title}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
|
@ -121,6 +127,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
<div
|
<div
|
||||||
class="carousel-item"
|
class="carousel-item"
|
||||||
class:active={i == startIndex}
|
class:active={i == startIndex}
|
||||||
|
class:d-none={fsrs
|
||||||
|
? item.sched === HelpItemScheduler.SM2
|
||||||
|
: item.sched == HelpItemScheduler.FSRS}
|
||||||
>
|
>
|
||||||
<HelpSection {item} />
|
<HelpSection {item} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,4 +8,10 @@ export type HelpItem = {
|
||||||
title: string;
|
title: string;
|
||||||
help?: string;
|
help?: string;
|
||||||
url?: string;
|
url?: string;
|
||||||
|
sched?: HelpItemScheduler;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export enum HelpItemScheduler {
|
||||||
|
SM2 = 0,
|
||||||
|
FSRS = 1,
|
||||||
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import SettingTitle from "../components/SettingTitle.svelte";
|
import SettingTitle from "../components/SettingTitle.svelte";
|
||||||
import SwitchRow from "../components/SwitchRow.svelte";
|
import SwitchRow from "../components/SwitchRow.svelte";
|
||||||
import TitledContainer from "../components/TitledContainer.svelte";
|
import TitledContainer from "../components/TitledContainer.svelte";
|
||||||
import type { HelpItem } from "../components/types";
|
import { type HelpItem, HelpItemScheduler } from "../components/types";
|
||||||
import CardStateCustomizer from "./CardStateCustomizer.svelte";
|
import CardStateCustomizer from "./CardStateCustomizer.svelte";
|
||||||
import FsrsOptions from "./FsrsOptions.svelte";
|
import FsrsOptions from "./FsrsOptions.svelte";
|
||||||
import type { DeckOptionsState } from "./lib";
|
import type { DeckOptionsState } from "./lib";
|
||||||
|
@ -40,26 +40,31 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
title: tr.schedulingStartingEase(),
|
title: tr.schedulingStartingEase(),
|
||||||
help: tr.deckConfigStartingEaseTooltip(),
|
help: tr.deckConfigStartingEaseTooltip(),
|
||||||
url: HelpPage.DeckOptions.startingEase,
|
url: HelpPage.DeckOptions.startingEase,
|
||||||
|
sched: HelpItemScheduler.SM2,
|
||||||
},
|
},
|
||||||
easyBonus: {
|
easyBonus: {
|
||||||
title: tr.schedulingEasyBonus(),
|
title: tr.schedulingEasyBonus(),
|
||||||
help: tr.deckConfigEasyBonusTooltip(),
|
help: tr.deckConfigEasyBonusTooltip(),
|
||||||
url: HelpPage.DeckOptions.easyBonus,
|
url: HelpPage.DeckOptions.easyBonus,
|
||||||
|
sched: HelpItemScheduler.SM2,
|
||||||
},
|
},
|
||||||
intervalModifier: {
|
intervalModifier: {
|
||||||
title: tr.schedulingIntervalModifier(),
|
title: tr.schedulingIntervalModifier(),
|
||||||
help: tr.deckConfigIntervalModifierTooltip(),
|
help: tr.deckConfigIntervalModifierTooltip(),
|
||||||
url: HelpPage.DeckOptions.intervalModifier,
|
url: HelpPage.DeckOptions.intervalModifier,
|
||||||
|
sched: HelpItemScheduler.SM2,
|
||||||
},
|
},
|
||||||
hardInterval: {
|
hardInterval: {
|
||||||
title: tr.schedulingHardInterval(),
|
title: tr.schedulingHardInterval(),
|
||||||
help: tr.deckConfigHardIntervalTooltip(),
|
help: tr.deckConfigHardIntervalTooltip(),
|
||||||
url: HelpPage.DeckOptions.hardInterval,
|
url: HelpPage.DeckOptions.hardInterval,
|
||||||
|
sched: HelpItemScheduler.SM2,
|
||||||
},
|
},
|
||||||
newInterval: {
|
newInterval: {
|
||||||
title: tr.schedulingNewInterval(),
|
title: tr.schedulingNewInterval(),
|
||||||
help: tr.deckConfigNewIntervalTooltip(),
|
help: tr.deckConfigNewIntervalTooltip(),
|
||||||
url: HelpPage.DeckOptions.newInterval,
|
url: HelpPage.DeckOptions.newInterval,
|
||||||
|
sched: HelpItemScheduler.SM2,
|
||||||
},
|
},
|
||||||
customScheduling: {
|
customScheduling: {
|
||||||
title: tr.deckConfigCustomScheduling(),
|
title: tr.deckConfigCustomScheduling(),
|
||||||
|
@ -85,6 +90,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
title={tr.deckConfigAdvancedTitle()}
|
title={tr.deckConfigAdvancedTitle()}
|
||||||
url={HelpPage.DeckOptions.advanced}
|
url={HelpPage.DeckOptions.advanced}
|
||||||
slot="tooltip"
|
slot="tooltip"
|
||||||
|
fsrs={$fsrs}
|
||||||
{helpSections}
|
{helpSections}
|
||||||
on:mount={(e) => {
|
on:mount={(e) => {
|
||||||
modal = e.detail.modal;
|
modal = e.detail.modal;
|
||||||
|
|
|
@ -14,7 +14,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import Item from "../components/Item.svelte";
|
import Item from "../components/Item.svelte";
|
||||||
import SettingTitle from "../components/SettingTitle.svelte";
|
import SettingTitle from "../components/SettingTitle.svelte";
|
||||||
import TitledContainer from "../components/TitledContainer.svelte";
|
import TitledContainer from "../components/TitledContainer.svelte";
|
||||||
import type { HelpItem } from "../components/types";
|
import { type HelpItem, HelpItemScheduler } from "../components/types";
|
||||||
import { leechChoices } from "./choices";
|
import { leechChoices } from "./choices";
|
||||||
import type { DeckOptionsState } from "./lib";
|
import type { DeckOptionsState } from "./lib";
|
||||||
import SpinBoxRow from "./SpinBoxRow.svelte";
|
import SpinBoxRow from "./SpinBoxRow.svelte";
|
||||||
|
@ -54,6 +54,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
title: tr.schedulingMinimumInterval(),
|
title: tr.schedulingMinimumInterval(),
|
||||||
help: tr.deckConfigMinimumIntervalTooltip(),
|
help: tr.deckConfigMinimumIntervalTooltip(),
|
||||||
url: HelpPage.DeckOptions.minimumInterval,
|
url: HelpPage.DeckOptions.minimumInterval,
|
||||||
|
sched: HelpItemScheduler.SM2,
|
||||||
},
|
},
|
||||||
leechThreshold: {
|
leechThreshold: {
|
||||||
title: tr.schedulingLeechThreshold(),
|
title: tr.schedulingLeechThreshold(),
|
||||||
|
@ -82,6 +83,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
title={tr.schedulingLapses()}
|
title={tr.schedulingLapses()}
|
||||||
url={HelpPage.DeckOptions.lapses}
|
url={HelpPage.DeckOptions.lapses}
|
||||||
slot="tooltip"
|
slot="tooltip"
|
||||||
|
fsrs={$fsrs}
|
||||||
{helpSections}
|
{helpSections}
|
||||||
on:mount={(e) => {
|
on:mount={(e) => {
|
||||||
modal = e.detail.modal;
|
modal = e.detail.modal;
|
||||||
|
|
|
@ -15,7 +15,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import Item from "../components/Item.svelte";
|
import Item from "../components/Item.svelte";
|
||||||
import SettingTitle from "../components/SettingTitle.svelte";
|
import SettingTitle from "../components/SettingTitle.svelte";
|
||||||
import TitledContainer from "../components/TitledContainer.svelte";
|
import TitledContainer from "../components/TitledContainer.svelte";
|
||||||
import type { HelpItem } from "../components/types";
|
import { type HelpItem, HelpItemScheduler } from "../components/types";
|
||||||
import { newInsertOrderChoices } from "./choices";
|
import { newInsertOrderChoices } from "./choices";
|
||||||
import type { DeckOptionsState } from "./lib";
|
import type { DeckOptionsState } from "./lib";
|
||||||
import SpinBoxRow from "./SpinBoxRow.svelte";
|
import SpinBoxRow from "./SpinBoxRow.svelte";
|
||||||
|
@ -66,11 +66,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
title: tr.schedulingGraduatingInterval(),
|
title: tr.schedulingGraduatingInterval(),
|
||||||
help: tr.deckConfigGraduatingIntervalTooltip(),
|
help: tr.deckConfigGraduatingIntervalTooltip(),
|
||||||
url: HelpPage.DeckOptions.graduatingInterval,
|
url: HelpPage.DeckOptions.graduatingInterval,
|
||||||
|
sched: HelpItemScheduler.SM2,
|
||||||
},
|
},
|
||||||
easyInterval: {
|
easyInterval: {
|
||||||
title: tr.schedulingEasyInterval(),
|
title: tr.schedulingEasyInterval(),
|
||||||
help: tr.deckConfigEasyIntervalTooltip(),
|
help: tr.deckConfigEasyIntervalTooltip(),
|
||||||
url: HelpPage.DeckOptions.easyInterval,
|
url: HelpPage.DeckOptions.easyInterval,
|
||||||
|
sched: HelpItemScheduler.SM2,
|
||||||
},
|
},
|
||||||
insertionOrder: {
|
insertionOrder: {
|
||||||
title: tr.deckConfigNewInsertionOrder(),
|
title: tr.deckConfigNewInsertionOrder(),
|
||||||
|
@ -95,6 +97,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
url={HelpPage.DeckOptions.newCards}
|
url={HelpPage.DeckOptions.newCards}
|
||||||
slot="tooltip"
|
slot="tooltip"
|
||||||
{helpSections}
|
{helpSections}
|
||||||
|
fsrs={$fsrs}
|
||||||
on:mount={(e) => {
|
on:mount={(e) => {
|
||||||
modal = e.detail.modal;
|
modal = e.detail.modal;
|
||||||
carousel = e.detail.carousel;
|
carousel = e.detail.carousel;
|
||||||
|
|
Loading…
Reference in a new issue