mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
Merge branch 'main' into pr-4379
This commit is contained in:
commit
cb763b7f70
5 changed files with 7 additions and 24 deletions
|
|
@ -249,8 +249,8 @@ Toby Penner <tobypenner01@gmail.com>
|
||||||
Danilo Spillebeen <spillebeendanilo@gmail.com>
|
Danilo Spillebeen <spillebeendanilo@gmail.com>
|
||||||
Matbe766 <matildabergstrom01@gmail.com>
|
Matbe766 <matildabergstrom01@gmail.com>
|
||||||
Amanda Sternberg <mandis.sternberg@gmail.com>
|
Amanda Sternberg <mandis.sternberg@gmail.com>
|
||||||
arold0 <arold0@icloud.com>
|
arold0 <arold0@icloud.com>
|
||||||
|
nav1s <nav1s@proton.me>
|
||||||
|
|
||||||
********************
|
********************
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ class SidebarItem:
|
||||||
self.search_node = search_node
|
self.search_node = search_node
|
||||||
self.on_expanded = on_expanded
|
self.on_expanded = on_expanded
|
||||||
self.children: list[SidebarItem] = []
|
self.children: list[SidebarItem] = []
|
||||||
self.tooltip: str | None = None
|
self.tooltip: str = name
|
||||||
self._parent_item: SidebarItem | None = None
|
self._parent_item: SidebarItem | None = None
|
||||||
self._expanded = expanded
|
self._expanded = expanded
|
||||||
self._row_in_parent: int | None = None
|
self._row_in_parent: int | None = None
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ pub(crate) fn basic(tr: &I18n) -> Notetype {
|
||||||
|
|
||||||
pub(crate) fn basic_typing(tr: &I18n) -> Notetype {
|
pub(crate) fn basic_typing(tr: &I18n) -> Notetype {
|
||||||
let mut nt = basic(tr);
|
let mut nt = basic(tr);
|
||||||
nt.config.original_stock_kind = StockKind::BasicTyping as i32;
|
nt.config.original_stock_kind = OriginalStockKind::BasicTyping as i32;
|
||||||
nt.name = tr.notetypes_basic_type_answer_name().into();
|
nt.name = tr.notetypes_basic_type_answer_name().into();
|
||||||
let front = tr.notetypes_front_field();
|
let front = tr.notetypes_front_field();
|
||||||
let back = tr.notetypes_back_field();
|
let back = tr.notetypes_back_field();
|
||||||
|
|
@ -138,7 +138,7 @@ pub(crate) fn basic_typing(tr: &I18n) -> Notetype {
|
||||||
|
|
||||||
pub(crate) fn basic_forward_reverse(tr: &I18n) -> Notetype {
|
pub(crate) fn basic_forward_reverse(tr: &I18n) -> Notetype {
|
||||||
let mut nt = basic(tr);
|
let mut nt = basic(tr);
|
||||||
nt.config.original_stock_kind = StockKind::BasicAndReversed as i32;
|
nt.config.original_stock_kind = OriginalStockKind::BasicAndReversed as i32;
|
||||||
nt.name = tr.notetypes_basic_reversed_name().into();
|
nt.name = tr.notetypes_basic_reversed_name().into();
|
||||||
let front = tr.notetypes_front_field();
|
let front = tr.notetypes_front_field();
|
||||||
let back = tr.notetypes_back_field();
|
let back = tr.notetypes_back_field();
|
||||||
|
|
@ -156,7 +156,7 @@ pub(crate) fn basic_forward_reverse(tr: &I18n) -> Notetype {
|
||||||
|
|
||||||
pub(crate) fn basic_optional_reverse(tr: &I18n) -> Notetype {
|
pub(crate) fn basic_optional_reverse(tr: &I18n) -> Notetype {
|
||||||
let mut nt = basic_forward_reverse(tr);
|
let mut nt = basic_forward_reverse(tr);
|
||||||
nt.config.original_stock_kind = StockKind::BasicOptionalReversed as i32;
|
nt.config.original_stock_kind = OriginalStockKind::BasicOptionalReversed as i32;
|
||||||
nt.name = tr.notetypes_basic_optional_reversed_name().into();
|
nt.name = tr.notetypes_basic_optional_reversed_name().into();
|
||||||
let addrev = tr.notetypes_add_reverse_field();
|
let addrev = tr.notetypes_add_reverse_field();
|
||||||
nt.add_field(addrev.as_ref());
|
nt.add_field(addrev.as_ref());
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { randomUUID } from "@tslib/uuid";
|
|
||||||
import { onDestroy } from "svelte";
|
import { onDestroy } from "svelte";
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
|
|
||||||
|
|
@ -66,7 +65,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
$: empty = title === "MathJax";
|
$: empty = title === "MathJax";
|
||||||
$: encoded = encodeURIComponent(converted);
|
$: encoded = encodeURIComponent(converted);
|
||||||
|
|
||||||
const uuid = randomUUID();
|
const uuid = crypto.randomUUID();
|
||||||
const imageHeight = writable(0);
|
const imageHeight = writable(0);
|
||||||
imageToHeightMap.set(uuid, imageHeight);
|
imageToHeightMap.set(uuid, imageHeight);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO replace with crypto.randomUUID
|
|
||||||
*/
|
|
||||||
export function randomUUID(): string {
|
|
||||||
const value = `${1e7}-${1e3}-${4e3}-${8e3}-${1e11}`;
|
|
||||||
|
|
||||||
return value.replace(/[018]/g, (character: string): string =>
|
|
||||||
(
|
|
||||||
Number(character)
|
|
||||||
^ (crypto.getRandomValues(new Uint8Array(1))[0]
|
|
||||||
& (15 >> (Number(character) / 4)))
|
|
||||||
).toString(16));
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue