If you like it, please give me a star, thank you so much! This repository is actively under development, and I’m planning to add more templates in the future, such as interactive templates. Your star is definitely my motivation to keep updating!
Really cool! I’ve been wanting to implement a chatGPT query in my cards in a way that’d work on mobile too, so I think I’ll examine your source and add this to my own javascript filled templates.
I noticed one bug. It seems something is wrong with how .nightMode is handled. The text in the tool menu is white and thus invisible in dark mode. I guess you forgot to change the tool menu background in dark mode?
One other bug I’m seeing is on AnkiDroid. It seems not all the template settings’ saved values get communicated to the card in AnkiDroid:
I made tool menu changes on desktop and then synced. These were then applied on AnkiDroid.
However the other basic settings did not get transferred to AnkiDroid. Editing these or the tool menu settings on AnkiDroid also seems to only apply in the current review session. Reopening the review causes those settings to get reset.
Ah, you’re using localStorage to store stuff. How is that getting synced to other devices? I think the most reliable way would be to store the config as a json file in collection media. Except I don’t know if the JS in the card template is allowed to edit files in collection media.
Yes, the current implementation does not sync between multiple devices.
And as far as I know, it is not possible to modify media files only through card templates.
My AnkiDroid is 2.20. So to clarify, the settings do persist between reviews but closing the reviewer loses all changes - localStorage doesn’t persistent outside of the reviewer.
This is because ankidroid fell back to displaying the reviewer on a random port in later verisons, so after restarting ankidroid, the previous localStorage could not be accessed due to the different port. I am testing cross-site storage through iframe and postMessage, but there are still uncertainties.