Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Anki Scripting Crimes Part 3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tapirbug-blog
Anki Scripting Crimes Part 3
Commits
44c4b35a
Commit
44c4b35a
authored
1 month ago
by
Philipp Pospischil
Browse files
Options
Downloads
Patches
Plain Diff
fix: AnkiDroid compatibility with class instead of ID
parent
7cbb5622
Branches
main
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
create_from_scratch_with_csv.py
+1
-1
1 addition, 1 deletion
create_from_scratch_with_csv.py
templates/kanji/animation.js
+6
-5
6 additions, 5 deletions
templates/kanji/animation.js
templates/kanji/back.html
+2
-4
2 additions, 4 deletions
templates/kanji/back.html
with
9 additions
and
10 deletions
create_from_scratch_with_csv.py
+
1
−
1
View file @
44c4b35a
...
...
@@ -104,7 +104,7 @@ note_type = {
'
plainText
'
:
False
,
'
collapsed
'
:
False
,
'
excludeFromSearch
'
:
False
,
'
id
'
:
1
,
'
id
'
:
2
,
'
tag
'
:
None
,
'
preventDeletion
'
:
False
}
...
...
This diff is collapsed.
Click to expand it.
templates/kanji/animation.js
+
6
−
5
View file @
44c4b35a
import
HanziWriter
from
"
hanzi-writer
"
const
kanji
=
document
.
getElementById
(
"
kanji
"
).
innerText
const
hanziWriterContainer
=
document
.
getElementById
(
"
kanji-animation
"
)
HanziWriter
.
create
(
hanziWriterContainer
,
kanji
).
animateCharacter
()
for
(
const
kanjiContainer
of
document
.
getElementsByClassName
(
"
kanji
"
))
{
const
kanjiText
=
kanjiContainer
.
textContent
const
hanziWriterContainer
=
document
.
createElement
(
"
div
"
)
kanjiContainer
.
append
(
hanziWriterContainer
)
HanziWriter
.
create
(
hanziWriterContainer
,
kanjiText
).
animateCharacter
()
}
This diff is collapsed.
Click to expand it.
templates/kanji/back.html
+
2
−
4
View file @
44c4b35a
...
...
@@ -2,10 +2,8 @@
<hr
id=
"answer"
>
<div
id=
"kanji"
>
{{Back}}
</div>
<div
id=
"kanji-animation"
></div>
<div
class=
"kanji"
>
{{Back}}
</div>
<script
type=
"module"
>
import
"
./animation.js
"
</script>
\ No newline at end of file
</script>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment