Skip to content

Commit

Permalink
add definitions to card when review characters
Browse files Browse the repository at this point in the history
  • Loading branch information
krmanik committed Feb 11, 2024
1 parent 842b987 commit 67331e1
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions card templates/Card 4/front.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,39 @@
</a>
</div>

<hr>

<div id="char_meaning" class="meaning-card">{{Meaning}}</div>

<script>
var hideList = ['char_sim', 'char_trad'];
function showHide(type, isShow, style = "inline") {
if (isShow) {
document.querySelectorAll(type).forEach(function (val) {
val.style.display = style;
});
} else {
document.querySelectorAll(type).forEach(function (val) {
val.style.display = 'none';
});
}
}

for (var _hide of hideList) {
var el = document.getElementById(_hide);
if (el) {
el.style.display = "none";
}
if (_hide == "char_sim") {
showHide("#char-sim-id", false);
}
if (_hide == "char_trad") {
showHide("#char-trad-id", false);
showHide(".sep", false);
}
}
</script>

<script>
// v1.0.0 - https://github.com/SimonLammer/anki-persistence/blob/eeb2e1a9e37c941dd63e1fe6c2a257f043c40e0d/script.js
if(void 0===window.Persistence){var e="github.com/SimonLammer/anki-persistence/",t="_default";if(window.Persistence_localStorage=function(){var i=!1;try{null!==window.localStorage&&"object"==typeof window.localStorage&&(i=!0,this.clear=function(){for(var t=0;t<localStorage.length;t++){var i=localStorage.key(t);0==i.indexOf(e)&&(localStorage.removeItem(i),t--)}},this.setItem=function(i,n){void 0==n&&(n=i,i=t),localStorage.setItem(e+i,JSON.stringify(n))},this.getItem=function(i){return void 0==i&&(i=t),JSON.parse(localStorage.getItem(e+i))},this.removeItem=function(i){void 0==i&&(i=t),localStorage.removeItem(e+i)})}catch(n){}this.isAvailable=function(){return i}},window.Persistence_sessionStorage=function(){var i=!1;try{"object"==typeof window.sessionStorage&&(i=!0,this.clear=function(){for(var t=0;t<sessionStorage.length;t++){var i=sessionStorage.key(t);0==i.indexOf(e)&&(sessionStorage.removeItem(i),t--)}},this.setItem=function(i,n){void 0==n&&(n=i,i=t),sessionStorage.setItem(e+i,JSON.stringify(n))},this.getItem=function(i){return void 0==i&&(i=t),JSON.parse(sessionStorage.getItem(e+i))},this.removeItem=function(i){void 0==i&&(i=t),sessionStorage.removeItem(e+i)})}catch(n){}this.isAvailable=function(){return i}},window.Persistence_windowKey=function(i){var n=window[i],o=!1;"object"==typeof n&&(o=!0,this.clear=function(){n[e]={}},this.setItem=function(i,o){void 0==o&&(o=i,i=t),n[e][i]=o},this.getItem=function(i){return void 0==i&&(i=t),void 0==n[e][i]?null:n[e][i]},this.removeItem=function(i){void 0==i&&(i=t),delete n[e][i]},void 0==n[e]&&this.clear()),this.isAvailable=function(){return o}},window.Persistence=new Persistence_sessionStorage,navigator.userAgent.indexOf("Mobile")>0&&(window.Persistence=new Persistence_localStorage,Persistence.isAvailable()||(window.Persistence=new Persistence_sessionStorage)),Persistence.isAvailable()||(window.Persistence=new Persistence_windowKey("py")),!Persistence.isAvailable()){var i=window.location.toString().indexOf("title"),n=window.location.toString().indexOf("main",i);i>0&&n>0&&n-i<10&&(window.Persistence=new Persistence_windowKey("qt"))}}
Expand Down

0 comments on commit 67331e1

Please sign in to comment.