-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Get deck name using JS API #8500
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test to ensure that {{Deck}} and this method return the same string.
I'd typically be happy with using the same method for both calls, but we'll be removing template generation soon
Okay, I am implementing it. |
After viewing existing code for test, I have implemented for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with a test too - thank you @infinyte7 !
* get deck name * Added test for getting deck name using js api
* get deck name * Added test for getting deck name using js api
Hi there! Just a friendly notice that we try to process OpenCollective payments monthly - it's time for April 2021 submissions If you are interested in compensation for this work, the process with details is here: https://github.com/ankidroid/Anki-Android/wiki/OpenCollective-Payment-Process#how-to-get-paid (I only post one comment per person to avoid spamming you, regardless of the number of PRs merged, but this note applies to all PRs merged in April) Thanks! |
* get deck name * Added test for getting deck name using js api
Pull Request template
Purpose / Description
It helps in getting deck name when custom card layout used/designed. The
{{Deck}}
or{{Subdeck}}
not working when added from js-addonsindex.js
. So, it will easier to add deck name to reviewer using JS API.Fixes
Fixes Link to the issues.
Approach
It is implemented using existing JavascriptInterface
How Has This Been Tested?
Tested on emulator
Add following to front/back side of card in
script
tagLearning (optional, can help others)
https://developer.android.com/reference/android/webkit/JavascriptInterface
Checklist
Please, go through these checks before submitting the PR.
if
statements)