c3fc07ac20
- try out bootstrap modals - they're not perfect, but let's see how they go for now. Won't be hard to switch to bridge commands if required. - handle adding/renaming/removing - add a class to manage the state
24 lines
755 B
TypeScript
24 lines
755 B
TypeScript
// Copyright: Ankitects Pty Ltd and contributors
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
import { getDeckConfigInfo, DeckConfigState } from "./lib";
|
|
import { setupI18n, ModuleName } from "anki/i18n";
|
|
import { checkNightMode } from "anki/nightmode";
|
|
import DeckConfigPage from "./DeckConfigPage.svelte";
|
|
|
|
export async function deckConfig(
|
|
target: HTMLDivElement,
|
|
deckId: number
|
|
): Promise<void> {
|
|
checkNightMode();
|
|
await setupI18n({
|
|
modules: [ModuleName.SCHEDULING, ModuleName.ACTIONS, ModuleName.DECK_CONFIG],
|
|
});
|
|
const info = await getDeckConfigInfo(deckId);
|
|
const state = new DeckConfigState(info);
|
|
new DeckConfigPage({
|
|
target,
|
|
props: { state },
|
|
});
|
|
}
|