Skip to content
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

Side buttons not working on new cards #47

Open
BeorTheOld opened this issue Feb 20, 2024 · 16 comments
Open

Side buttons not working on new cards #47

BeorTheOld opened this issue Feb 20, 2024 · 16 comments

Comments

@BeorTheOld
Copy link

I tried to update my old Xiehanzi 3.0 deck with the new Xiehanzi 3.0 write card style by copy and pasting the front, back and styling sections into their respective places on my old deck, my old deck looked right but the buttons that control what fields are displayed were all unchecked and they did not save between cards like the new xiehanzi 3.0 deck's cards did. I tried adding cards to the new xiehanzi 3.0 decks with pleco but they had the same problem as the cards from my old deck. Is there something about the new xiehanzi 3.0 deck that is different that makes the persistence work compared to my old deck?

I had the problem on my android and PC versions of anki, while the new versions of the decks worked.

@krmanik
Copy link
Owner

krmanik commented Feb 21, 2024

Maybe some javascript relate errors happening, without more info it is not easy to find the issues. I suggest install to install this addon in anki, then during review, inspect the page and paste screenshot here.

https://ankiweb.net/shared/info/31746032

@krmanik

This comment was marked as off-topic.

@BeorTheOld
Copy link
Author

I updated the card template the way you said but it seems like it still doesn't work. The left side bar always looks like that, if I change anything the changes will not save on the next card and some of the buttons, like grid size, don't even work.

Screenshot 2024-02-21 012447
Screenshot 2024-02-21 012623

@krmanik
Copy link
Owner

krmanik commented Feb 21, 2024

In this case, I have updated the card template, provided two method to update xiehanzi 3.0 deck.

A. Update by importing deck
Download and import this deck in Anki and select Update notetypes -> always, after that delete the Update deck.

Download
https://github.com/krmanik/Anki-xiehanzi/releases/download/v2.2.1/Type.4.-.xiehanzi.HSK.3.0__Update.apkg

Above method is easiest, try below method only if above does not work.

B. Update manually by copy paste.

  1. Open card template editor
  2. Copy front.html and paste in front side of card template
    front.html
  3. Copy back.html and paste in back side of card template
    back.html
  4. Copy styling.css and paste in styling of card css
    styling.css
    Save and review, it will update and fix the error.

@BeorTheOld
Copy link
Author

Unfortunately the problem is still here. I tried both methods to update the cards.

Screenshot 2024-02-21 173753

@BeorTheOld
Copy link
Author

Here is a small sample of my deck.

xiehanzi 3.0.zip

@krmanik
Copy link
Owner

krmanik commented Feb 23, 2024

The issue was that pinyin color class was generated using python using this library but when new card added, there is no pinyin color class.

Anyway, I have updated the deck and html source. Download this deck, extract, and import in Anki then delete Update deck.

xiehanzi 3.0__Update.zip

@BeorTheOld
Copy link
Author

It works as intended on PC but ankidroid still is having the same problem for me.

Ankidroid version 2.16.5

@krmanik
Copy link
Owner

krmanik commented Feb 29, 2024

It seems the note types are not get updated, the only solution I used to fix is to copy and paste manually from this front.html to Card Template in AnkiDroid.

Another options is move all notes to another note types.

@BeorTheOld
Copy link
Author

I tried manually copy and pasting into ankidroid but the problem is still the same. I know that ankidroid is updating when I change the code anki for pc but ankidroid just isnt working with the card code correctly.

@BeorTheOld
Copy link
Author

Screenshot_20240307_231604_AnkiDroid
Screenshot_20240307_231615_AnkiDroid

I'm still having the problem on ankidroid, anki on PC works as intended. The card templates have been updated on ankidroid.

@krmanik
Copy link
Owner

krmanik commented Mar 9, 2024

I have found that there is limit to clipboard copy paste. So, the copy/paste method will not work.
I suggest edit it in PC for all notetype related to xiehanzi 3.0 then syncing from PC to Ankiweb then Ankiweb to AnkiDroid.
This is possible solution, I have tried, and it is working.

This is new front.html updated for AnkiDroid, because it is working without changing on AnkiMobile and Anki, but in case of AnkiDroid you have to replace with new front content now, then follow sync.

@BeorTheOld
Copy link
Author

The new code causes the grid to disappear on both Anki for PC and Ankidroid. Persistence works as it should on PC, however, on Ankidroid the sidebar saves the checked boxes during review of a deck but if I exit to the main menu and reenter the same deck the boxes are back to their default settings.

@krmanik
Copy link
Owner

krmanik commented Mar 10, 2024

It is known problem that I knew about later.
ankidroid/Anki-Android#15773

Please update AnkiDroid to 2.17.5 and try again, it may fixed for older front.html also.

@BeorTheOld
Copy link
Author

I tried a few versions of front.html but they all didn't work. I found the line to manually set the grid size and changed it to what I want it to be, is there a way to manually check and uncheck the other checkboxes?

@krmanik
Copy link
Owner

krmanik commented Mar 14, 2024

I have used the deck you have provided in this comment #47 (comment) then imported it in Anki desktop
xiehanzi.3.0.zip
Then clicked xiehanzi 3.0 deck and edited Card Template by copying HTML from this front.html and pasted in front side of template. Also updated styling, card.css.

I found the issue with grid, which I have fixed now. Please try again and let me know.

More info

var stroke = document.getElementById("text-grid").checked ? "var(--surface1)" : "";
var grid_data = `<svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' class='grid-color' id='grid-background-target'><g id="char_grid"><line x1='0' y1='0' x2='100%' y2='100%' stroke='${stroke}' /><line x1='100%' y1='0' x2='0' y2='100%' stroke='${stroke}' /><line x1='50%' y1='0' x2='50%' y2='100%' stroke='${stroke}' /><line x1='0' y1='50%' x2='100%' y2='50%' stroke='${stroke}' /></g></svg>`;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants