-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[need small help] template doesn't flip card when in nightmode + how to detect platform using js #6886
Comments
Hi, have you attempted to use the JavaScript inspector: https://github.com/ankidroid/Anki-Android/wiki/Development-Guide#html-javascript-inspection
https://github.com/ankidroid/Anki-Android/wiki/AnkiDroid-Javascript-API |
Hi,
|
@thiswillbeyourgithub It's in the pipeline, but currently, no. Post your full template and I'll see if I can have a look in a while. EDIT: Our Google Groups/reddit might get a faster response. |
The backup way to do it is to use adb to connect to the filesystem, and grab the card.html that is emitted, then you can treat that as a web page development to see what AnkiDroid would render if it was still in the app |
Thanks a lot for you help. I was able to fix it eventually. It was due to a line that changed the color of the cloze, apparently this was causing issue further down the code. It was not necessary anymore so I removed it. For anyone, wondering, my code testing if the platform is on mobile so far is the following :
Then the card is flipped only if the cloze was not using hints like {{c1::X::Y}} :
Seems to work so far. I will probably have to change this eventually as I discover new edge cases. The latest version will be on my repo anyway. Thanks again for everything you do, feel free to close the issue. edit : wouldn't it be cool to create a new wiki page that contains the canonical code to detect all available platforms for all template? I've seen lots of different people asking to know if it's a tablet, or on the computer, or the simple html page of ankiweb etc. I don't think I've seen a all those trials and errors grouped in one place. |
I'm going to close this as resolved. Please let me know if you need anything more. Thanks for the update and the code! |
Hi,
I hope it's okay for me to ask this here, I'm running into an issue with ankidroid and couldn't find the answer. I hope that by asking it here, it will be visible to others, should they run into the same issue.
I'll be short and to the point : I'm doing a pretty sophisticated template in js, but I'm really new to it.
I have this in my cloze front template :
This idea is that if it passes some test, the card will not show the front but automatically flip and show the answer. The behavior doesn't seem to work when in nightmode in ankidroid but works perfectly in daymode.
Could you give me some clues as to why it doesn't work?
Do you have a recommendation as to the proper way to detect mobile versions? Your wiki and github is very well written but I don't find a lot of information about AnkiMobile
Any recommendation as to where I can find information about what should and should work in js across all platforms? I saw in the official manual that they don't really offer support.
The text was updated successfully, but these errors were encountered: