mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
./check
This commit is contained in:
parent
c7fd7a0965
commit
1e67a773c6
5 changed files with 20 additions and 20 deletions
|
@ -11,7 +11,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
let reviewerInfo: null | ReturnType<typeof setupBottomBar> = null;
|
let reviewerInfo: null | ReturnType<typeof setupBottomBar> = null;
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
reviewerInfo = setupBottomBar()
|
reviewerInfo = setupBottomBar();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import { bridgeCommand } from "@tslib/bridgecommand";
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
import type { AnswerButtonInfo } from "./types";
|
import type { AnswerButtonInfo } from "./types";
|
||||||
import { bridgeCommand } from "@tslib/bridgecommand";
|
|
||||||
|
|
||||||
export function setupBottomBar() {
|
export function setupBottomBar() {
|
||||||
/*
|
/*
|
||||||
|
@ -77,7 +77,7 @@ export function setupBottomBar() {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// TODO This should probably be a "ready" command now that it is part of the actual reviewer,
|
// TODO This should probably be a "ready" command now that it is part of the actual reviewer,
|
||||||
// Currently this depends on this component mounting after the reviewer which it should but seems hacky.
|
// Currently this depends on this component mounting after the reviewer which it should but seems hacky.
|
||||||
// Maybe use a counter with a counter.subscribe($counter == 2 then call("ready"))
|
// Maybe use a counter with a counter.subscribe($counter == 2 then call("ready"))
|
||||||
bridgeCommand("bottomReady");
|
bridgeCommand("bottomReady");
|
||||||
|
@ -87,4 +87,4 @@ export function setupBottomBar() {
|
||||||
remaining,
|
remaining,
|
||||||
remainingIndex,
|
remainingIndex,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Writable } from "svelte/store";
|
import type { Writable } from "svelte/store";
|
||||||
|
|
||||||
export let html: Writable<string>
|
export let html: Writable<string>;
|
||||||
export let cardClass: Writable<string>
|
export let cardClass: Writable<string>;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="qa" class={$cardClass}>
|
<div id="qa" class={$cardClass}>
|
||||||
|
@ -11,6 +11,6 @@
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
#qa {
|
#qa {
|
||||||
flex: 1
|
flex: 1;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
import { writable } from "svelte/store"
|
import { writable } from "svelte/store";
|
||||||
import { preloadAnswerImages } from "../../reviewer/images"
|
import { preloadAnswerImages } from "../../reviewer/images";
|
||||||
|
|
||||||
export function setupReviewer() {
|
export function setupReviewer() {
|
||||||
const html = writable("")
|
const html = writable("");
|
||||||
const cardClass = writable("")
|
const cardClass = writable("");
|
||||||
|
|
||||||
function showQuestion(q, a, cc) {
|
function showQuestion(q, a, cc) {
|
||||||
html.set(q)
|
html.set(q);
|
||||||
cardClass.set(cc)
|
cardClass.set(cc);
|
||||||
preloadAnswerImages(a)
|
preloadAnswerImages(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
globalThis._showAnswer = html.set
|
globalThis._showAnswer = html.set;
|
||||||
globalThis._showQuestion = showQuestion
|
globalThis._showQuestion = showQuestion;
|
||||||
|
|
||||||
return {html, cardClass}
|
return { html, cardClass };
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import { setupReviewer } from "./reviewer";
|
import { setupReviewer } from "./reviewer";
|
||||||
import Reviewer from "./reviewer.svelte";
|
import Reviewer from "./reviewer.svelte";
|
||||||
|
|
||||||
import "../../reviewer/reviewer.scss"
|
import "../../reviewer/reviewer.scss";
|
||||||
|
|
||||||
let reviewerInfo: null | ReturnType<typeof setupReviewer> = null;
|
let reviewerInfo: null | ReturnType<typeof setupReviewer> = null;
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
reviewerInfo = setupReviewer()
|
reviewerInfo = setupReviewer();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue