Skip to content

Commit

Permalink
match assets paths with Anki's
Browse files Browse the repository at this point in the history
asked by BrayanDSO
  • Loading branch information
MorenoTropical authored and mikehardy committed Oct 11, 2024
1 parent 8352dba commit d096f49
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions AnkiDroid/src/main/assets/card_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<style>
::style::
</style>
<link rel="stylesheet" type="text/css" href="file:///android_asset/backend/web/reviewer_extras.css">
<link rel="stylesheet" type="text/css" href="file:///android_asset/backend/css/reviewer_extras.css">
::script::
<script src="file:///android_asset/backend/web/jquery.min.js"> </script>
<script src="file:///android_asset/backend/js/jquery.min.js"> </script>
<script src="file:///android_asset/scripts/card.js" type="text/javascript"> </script>
<script src="file:///android_asset/scripts/js-api.js" type="text/javascript"> </script>
<script src="file:///android_asset/backend/web/reviewer_extras_bundle.js"> </script>
<script src="file:///android_asset/backend/js/reviewer_extras_bundle.js"> </script>
</head>
<body class="::class::">
<div id="content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ViewerResourceHandler(context: Context) {
try {
if (path.startsWith(MATHJAX_PATH_PREFIX)) {
val mathjaxAssetPath = Paths.get(
"backend/web/vendor/mathjax",
"backend/js/vendor/mathjax",
path.removePrefix(MATHJAX_PATH_PREFIX)
).pathString
val inputStream = assetManager.open(mathjaxAssetPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class AndroidCardRenderContext(
val script = when (requiresMathjax) {
false -> ""
true ->
""" <script src="file:///android_asset/backend/web/mathjax.js"></script>
<script src="file:///android_asset/backend/web/vendor/mathjax/tex-chtml-full.js"></script>"""
""" <script src="file:///android_asset/backend/js/mathjax.js"></script>
<script src="file:///android_asset/backend/js/vendor/mathjax/tex-chtml-full.js"></script>"""
}
val cardClass = cardAppearance.getCardClass(ord + 1) + if (requiresMathjax) " mathjax-needs-to-render" else ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ fun stdHtml(
<html class="$docClass" dir="$languageDirectionality" data-bs-theme="$baseTheme">
<head>
<title>AnkiDroid</title>
<link rel="stylesheet" type="text/css" href="file:///android_asset/backend/web/root-vars.css">
<link rel="stylesheet" type="text/css" href="file:///android_asset/backend/web/reviewer.css">
<link rel="stylesheet" type="text/css" href="file:///android_asset/backend/css/root-vars.css">
<link rel="stylesheet" type="text/css" href="file:///android_asset/backend/css/reviewer.css">
<link rel="stylesheet" type="text/css" href="file:///android_asset/ankidroid.css">
<style>
.night-mode button { --canvas: #606060; --fg: #eee; }
Expand All @@ -85,11 +85,11 @@ fun stdHtml(
<div id="_mark" hidden>&#x2605;</div>
<div id="_flag" hidden>&#x2691;</div>
<div id="qa"></div>
<script src="file:///android_asset/backend/web/jquery.min.js"></script>
<script src="file:///android_asset/backend/web/mathjax.js"></script>
<script src="file:///android_asset/backend/web/vendor/mathjax/tex-chtml-full.js"></script>
<script src="file:///android_asset/backend/js/jquery.min.js"></script>
<script src="file:///android_asset/backend/js/mathjax.js"></script>
<script src="file:///android_asset/backend/js/vendor/mathjax/tex-chtml-full.js"></script>
<script src="file:///android_asset/scripts/ankidroid.js"></script>
<script src="file:///android_asset/backend/web/reviewer.js"></script>
<script src="file:///android_asset/backend/js/reviewer.js"></script>
<script>bridgeCommand = function(){};</script>
</body>
</html>
Expand Down

0 comments on commit d096f49

Please sign in to comment.