Skip to content

Instantly share code, notes, and snippets.

@sartak
Created August 2, 2020 23:13
Show Gist options
  • Save sartak/4a4a718c7d7ea05da7fd3551c975aa00 to your computer and use it in GitHub Desktop.
Save sartak/4a4a718c7d7ea05da7fd3551c975aa00 to your computer and use it in GitHub Desktop.
JavaScript for PC Anki (v2.1.19) and iOS AnkiMobile (2.0.63) to enable the card to automatically advance to the answer side
// Note: This assumes for iOS AnkiMobile that a midCenter tap advances to the answer side)
<script type="text/javascript">
$(document).ready(function () {
// see https://gist.github.com/sartak/581d3564dc42b689b604
if (window.anki && window.sendMessage) {
// delay to give Anki a chance to continue processing
setTimeout(function () {
window.sendMessage("ankitap", "midCenter");
}, 100);
return;
}
if (window.pycmd) { // PC
pycmd("ans");
return;
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment