JS API to open card browser and search with query #9247
JS API to open card browser and search with query #9247mikehardy merged 1 commit intoankidroid:masterfrom
Conversation
mikehardy
left a comment
There was a problem hiding this comment.
I like this idea, but as mentioned in comments, split into 2 commits where one alters the API and all callers to always use Nullable query string to open card browser as a small simple change, then second commit layers the new Javascript API on top of it using the new capability
AnkiDroid/src/main/java/com/ichi2/anki/NavigationDrawerActivity.java
Outdated
Show resolved
Hide resolved
I will split into two PR. Thanks |
|
For this one could just be 2 commits I think - in this same PR, that would work for me, these ones will be small |
Okay, I will do it. |
|
Has a conflict with your other PR though 😅 |
|
Yes, I think I need to rebase it. I also thinking about implementing in signal. Because here are two types of function
So, should we make a rule that function that needs parameter(s) should go through signal and the function which do no require parameter(s) should go though As security concerns discussed in PR comments #9245 |
|
|
Okay, I am on it. |
0ba962d to
2e8c4c1
Compare
Pull Request template
Purpose / Description
This is continuation of JS API features. From reviewer using js function/button in one click it will go to CardBrowser and search for cards using query.
Fixes
Fixes #8109
Approach
mSearchTermsthen callsearchCards()How Has This Been Tested?
Testesd on devices and emulator
AnkiDroidJS.ankiSearchCard(query)video
Note in this video: Add
AnkiDroidJS.beforeankiSearchCardbecause JSInterface used to call this function.video.mp4
Another example, Added following to front side of card template
image
Learning (optional, can help others)
https://github.com/ankidroid/Anki-Android/wiki/AnkiDroid-Javascript-API
Checklist
Please, go through these checks before submitting the PR.
ifstatements)