Coder Social home page Coder Social logo

bluegreenmagick / edit-field-during-review-cloze Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 3.0 687 KB

Code for the Anki addon Edit Field During Review Cloze

Home Page: https://ankiweb.net/shared/info/385888438

License: Other

Python 45.37% JavaScript 28.21% CSS 1.87% TypeScript 21.09% HTML 3.46%

edit-field-during-review-cloze's People

Contributors

arthur-milchior avatar bluegreenmagick avatar dependabot[bot] avatar glutanimate avatar hikaru-y avatar kelciour avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

edit-field-during-review-cloze's Issues

Bug with anki 2.1.35

I get this everytime i edit something for the first time while i review, then after i dismiss the popup window it works fine for a while and it breaks again after some time (if for example i exit to the deck browser and i start reviewing again).

Debug info:
Anki 2.1.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2020-11-04 18:52:04

Caught exception:
Traceback (most recent call last):
  File "aqt\webview.py", line 37, in cmd
  File "aqt\webview.py", line 123, in _onCmd
  File "aqt\webview.py", line 547, in _onBridgeCmd
  File "<C:\Users\pacia\Desktop\AnkiFolder\Anki21-35\decorator.pyc:decorator-gen-68>", line 2, in linkHandler_wrapper
  File "anki\hooks.py", line 638, in decorator_wrapper
  File "anki\hooks.py", line 635, in repl
  File "C:\Users\pacia\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 193, in myLinkHandler
    saveThenRefreshFld(reviewer, note, fld, new_val)
  File "C:\Users\pacia\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 153, in saveThenRefreshFld
    saveField(note, fld, new_val)
  File "C:\Users\pacia\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 135, in saveField
    txt = Editor.mungeHTML(None, txt)
  File "aqt\editor.py", line 423, in mungeHTML
  File "aqt\gui_hooks.py", line 1606, in __call__
  File "aqt\editor.py", line 1225, in reverse_url_quoting
AttributeError: 'NoneType' object has no attribute 'mw'

"Tab" Bug

I'm having a problem when using "tab" shortcut to edit back or front field, even when I use tab to go from Front → back, or shift + tab to go from back → front

Does not work with other Cloze cards

Hi, I've never really used GitHub, so I am not sure if this is the correct place to ask this. However, is there any way that you could program this add-on to be compatible with other versions of Cloze cards? The add-on works fine with the default Cloze cards, but I have my own Cloze card note type that is formatted a particular way, and the add-on does not work for those cards. I could see this being impossible because the add-on is probably formatted for the default Cloze card and cannot account of variations, but it can't hurt to ask.

Pasting images

Hello.
Currently pasting images pastes a resized version of the image as follows
<!--StartFragment--><img src="image_url" alt="image_url" class="shrinkToFit transparent" width="x" height="y"><!--EndFragment-->
Could this be changed to
<img src="image_url>"?
Rationale: I use this addon to add image context quickly and then use the Media Internalizer to localize them. However the resizing styling persists and I have to manually remove it.
Thanks.

Idea: Render empty cards (cloze type) in the reviewer

Hello.
First of all thank you for sharing your add-on.

I have an idea that could potentially work synergistically with this add-on.

If empty cloze cards could be rendered in the reviewer (instead of the usual message about 'this card is empty'), one could flip through the added cards in the reviewer and add clozes as needed.

My main thought is that, sometimes when adding cloze cards, it's a hassle and time consuming to add clozes in the editor after writing out the card.
If this could be implemented into this, or a separate add-on, one could rapidly enter cards after another without manually adding clozes, and then add them as one reads through the added cards.

What do you think?

Resize not working on latest beta

I tried with just this add-on installed on the latest beta (release candidate 2) and the resize function isn't working. I'm not sure how I actually got this error because it only occurred once, but it was when I tried to resize things

Caught exception:
Traceback (most recent call last):
File "aqt/webview.py", line 41, in cmd
File "aqt/webview.py", line 139, in _onCmd
File "aqt/webview.py", line 586, in _onBridgeCmd
File "aqt/hooks_gen.py", line 3927, in call
File "/Users/Nick/Library/Application Support/Anki2/addons21/385888438/reviewer.py", line 126, in handle_pycmd_message
reload_reviewer(reviewer)
File "/Users/Nick/Library/Application Support/Anki2/addons21/385888438/reviewer.py", line 105, in reload_reviewer
reviewer._showAnswer()
File "decorator.py", line 232, in fun
File "anki/hooks.py", line 89, in decorator_wrapper
File "anki/hooks.py", line 86, in repl
File "/Users/Nick/Library/Application Support/Anki2/addons21/1409134430/init.py", line 36, in noEasy
if self.card.timeTaken() < getConfig("timeout") * 1000:
File "anki/cards.py", line 190, in time_taken
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'

Encounter Error With Latest Version of Anki

I have disable all other plugins.
The error popups when I edit a field and loose focus of that field.

Debug info:
Anki 2.1.32 (dee7d45d) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.15.6
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-08-27 19:05:39
Add-ons possibly involved: ⁨Edit Field During Review Cloze⁩

Caught exception:
Traceback (most recent call last):
  File "aqt/webview.py", line 37, in cmd
  File "aqt/webview.py", line 123, in _onCmd
  File "aqt/webview.py", line 547, in _onBridgeCmd
  File "</Applications/Anki.app/Contents/MacOS/decorator.pyc:decorator-gen-10>", line 2, in _linkHandler
  File "anki/hooks.py", line 638, in decorator_wrapper
  File "anki/hooks.py", line 635, in repl
  File ~/Library/Application Support/Anki2/addons21/385888438/reviewer.py", line 193, in myLinkHandler
    saveThenRefreshFld(reviewer, note, fld, new_val)
  File "~/Library/Application Support/Anki2/addons21/385888438/reviewer.py", line 153, in saveThenRefreshFld
    saveField(note, fld, new_val)
  File "~/Library/Application Support/Anki2/addons21/385888438/reviewer.py", line 135, in saveField
    txt = Editor.mungeHTML(None, txt)
  File "aqt/editor.py", line 421, in mungeHTML
  File "aqt/gui_hooks.py", line 1606, in __call__
  File "aqt/editor.py", line 1219, in reverse_url_quoting
AttributeError: 'NoneType' object has no attribute 'mw'

Bug when rating a card after editing with the add-on.

The below checklist isn't mandatory, but suggested before creating an issue.

  • I've updated this add-on to the latest version
  • I've tried disabling all other add-ons except this one.

Describe the bug
Since I update to 2.1.45 this bug appeared:

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.45 (355e66e8) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-07-30 11:51:21

Caught exception:
Traceback (most recent call last):
File "anki\scheduler\v2.py", line 767, in _logLrn
File "anki\scheduler\v2.py", line 762, in log
File "anki\cards.py", line 190, in time_taken
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "aqt\webview.py", line 41, in cmd
File "aqt\webview.py", line 139, in _onCmd
File "aqt\webview.py", line 592, in _onBridgeCmd
File "decorator.py", line 232, in fun
File "anki\hooks.py", line 89, in decorator_wrapper
File "anki\hooks.py", line 86, in repl
File "C:\Users\Casartelli\AppData\Roaming\Anki2\addons21\1046608507\main.py", line 193, in linkHandler
return _old(self, url)
File "aqt\reviewer.py", line 504, in _linkHandler
File "aqt\reviewer.py", line 425, in _answerCard
File "anki\scheduler\v2.py", line 459, in answerCard
File "anki\scheduler\v2.py", line 485, in _answerCard
File "anki\scheduler\v2.py", line 578, in _answerLrnCard
File "anki\scheduler\v2.py", line 771, in _logLrn
File "anki\scheduler\v2.py", line 762, in log
File "anki\cards.py", line 190, in time_taken
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'

To Reproduce

Well i think the gift explains pretty much.

Screenshots
cRWVLM8L4H

Debug Info

Anki 2.1.45 (355e66e8) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-07-30 11:51:21


===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Add Hyperlink ['318752047', 2021-07-10T15:40, 'None', '']
Add Table ['1237621971', 2021-07-10T14:37, 'None', mod]
AnkiConnect ['2055492159', 2021-07-13T21:59, 'None', '']
Asset Manager ['656021484', 2021-04-05T17:24, 'None', '']
AwesomeTTS - Add speech to your flashcards ['1436550454', 2021-07-29T09:55, 'None', '']
Browser TableEditor side-by-side horizontal split ['831846358', 2021-05-27T13:47, 'None', '']
Button Colours Good Again ['2494384865', 2021-04-06T11:57, 'None', '']
Closet For Anki ['272311064', 2021-04-12T11:09, 'None', '']
Cloze Overlapper for Anki 21 ['109531687', 2021-01-12T00:12, 'None', '']
Collapsible Fields ['1896168623', 2021-03-07T12:08, 'None', '']
Countdown To Events and Exams ['1143540799', 2021-03-13T17:40, 'None', '']
Custom Styles font color background colour classes ['1899278645', 2021-03-02T21:41, 'None', '']
Deck name in title 21 ['699175524', 2019-05-31T22:05, 'None', '']
Edit Field During Review Cloze ['385888438', 2021-07-30T07:32, '6.5', mod]
External Note Editor for the Browser ['1996266159', 2020-03-31T17:59, 'None', '']
Fastbar- with nightmode support ['46611790', 2021-05-18T21:50, 'None', '']
Fill the blanks - Multiple typecloze support ['1933645497', 2021-07-28T16:50, 'None', '']
Highlight Search Results in the Browser ['225180905', 2021-03-10T14:06, 'None', '']
Image Editor ['307397307', 2021-06-20T20:24, 'None', mod]
Image Occlusion Enhanced for Anki 21 alpha ['1374772155', 2020-04-27T23:21, 'None', '']
Language Tools - Learn Foreign Languages with Anki ['771677663', 2021-07-20T06:27, 'None', mod]
More Decks Stats and Time Left ['1556734708', 2021-01-27T06:09, 'None', '']
More Overview Stats 21 ['738807903', 2021-07-30T16:13, 'None', '']
Quick tagging 21 ['304770511', 2020-02-11T03:17, 'None', '']
Resize images in editor ['1103084694', 2021-07-19T03:35, 'None', mod]
Searching PDF Reading  Note-Taking in Add Dialog ['1781298089', 2021-06-21T13:05, 'None', mod]
See Previous Card Ratings in Reviewer ['1906641654', 2021-07-30T21:52, 'None', mod]
Speed Focus Mode auto-alert auto-reveal auto-fail ['1046608507', 2019-06-02T06:11, 'None', '']
Straight Reward ['957961234', 2021-01-11T09:37, 'None', '']
Symbols As You Type ['2040501954', 2021-03-21T23:17, 'None', '']
Symbols ['1461102936', 2019-04-18T17:21, 'None', '']
Syntax Highlighting for Code ['1463041493', 2018-10-06T22:31, 'None', '']

===IDs of active AnkiWeb add-ons===
1046608507 109531687 1103084694 1143540799 1237621971 1374772155 1436550454 1461102936 1463041493 1556734708 1781298089 1896168623 1899278645 1906641654 1933645497 1996266159 2040501954 2055492159 225180905 2494384865 272311064 304770511 307397307 318752047 385888438 46611790 656021484 699175524 738807903 771677663 831846358 957961234

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Mini Format Pack ['295889520', 2018-07-24T14:45, 'None', '']
Minimal Theme ['867316254', 2021-07-18T09:24, 'None', '']
Persistent Editor ['1686259334', 2021-02-11T21:05, 'None', '']
Tag Entry Enhancements v2 ['536796161', 2020-11-10T08:28, 'None', '']
TagSelectorV2 ['1022577188', 2020-08-13T00:09, 'None', mod]
Ze Frozen Fields ['94610912', 2021-02-11T21:06, 'None', '']

Please add function...

Where if you edit an image on a note any other notes with the same image will also get resized to the same dimensions. Willing to pay to get this feature added.

Title on empty fields on pressing Ctrl

Hi. I usually have multiple empty fields in my card. And I use your addon to edit most of them. The issues arises when their empty. Pressing Ctrl (I use the button to activate mode) would expand the editable fields like so
2020-05-26_21-07-58
With many fields it is hard to tell which field you are editing. Therefore it would be convenient if upon pressing control, the name of the editable field appeared as well like so
uploadxe12
As an addendum as demonstrated in the gif, it is hard to select another editing field while pressing Ctrl. You have to release and then select the other one.
Thank you.

empty field in-place editing?

hi, i like this add-on thank you for releasing it,

is it possible to assess empty fields while reviewing to edit? i don't know if this feature is available or I'm just derping, thx!

(I ctrl+click everywhere but only field with text allow me to edit XD)

v2.1.22, window10

Cannot edit close during review

Hello,

For some reason, the code is not working for the field - TEXT.

{{edit:cloze:Text}}

This does not work. It only works when I "show answer" and all the hints appear - I can edit the hints but not the Text field. Can you please help me?

I'm using the Anking Card styling

Subscript hotkey adds equal sign?

After enabling subscript in the config, I can't activate it without equal sign being generated using CTRL + =

subscript

Just really annoying. Thanks!

Changing the super/subscipt shortcuts

Awesome add on that I use everyday. Can't image anki without it. I like the idea of using super/sub scripts but the shortcut "ctrl + =" and "ctrl + shift + =" interferes with the zoom add on shortcut. Is it possible to either have an option to edit the shortcuts ourselves or get them changed to "alt + =" and "alt + shift + =".

Latest update breaks the ctrl+click to edit function

Updated today and I can no longer ctrl+click to edit. If that option is set to false, I can edit just fine by clicking, but I and many others liked having that option

I'm on a mac (so using Cmd) and 2.1.20. Never had any issues before

error windows are always displaying every the first edit!

Debug info:
Anki 2.1.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-11-17 00:30:26

Caught exception:
Traceback (most recent call last):
File "aqt\webview.py", line 37, in cmd
File "aqt\webview.py", line 123, in _onCmd
File "aqt\webview.py", line 547, in _onBridgeCmd
File "<C:\Program Files\Anki\decorator.pyc:decorator-gen-42>", line 2, in linkHandler_wrapper
File "anki\hooks.py", line 638, in decorator_wrapper
File "anki\hooks.py", line 635, in repl
File "C:\Users\xxx\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 193, in myLinkHandler
saveThenRefreshFld(reviewer, note, fld, new_val)
File "C:\Users\xxx\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 153, in saveThenRefreshFld
saveField(note, fld, new_val)
File "C:\Users\xxx\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 135, in saveField
txt = Editor.mungeHTML(None, txt)
File "aqt\editor.py", line 423, in mungeHTML
File "aqt\gui_hooks.py", line 1606, in call
File "aqt\editor.py", line 1225, in reverse_url_quoting
AttributeError: 'NoneType' object has no attribute 'mw'

An error after pressing playback sound button

The below checklist isn't manditory, but suggested before creating an issue.

  • [YES] I've updated this add-on to the latest version
  • [YES] I've tried disabling all other add-ons except this one.

Describe the bug
What is the bug, and what behaviour did you expect instead?

  • When I push the play button pop up an error message and disappear sound file from Anki

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'any card with play button'
  2. Click on the 'play button'
  3. Scroll down to unnecessary
  4. See error

Screenshots
Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.44 (b2b3275f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-07-05 22:06:17

Caught exception:
Traceback (most recent call last):
File "aqt\webview.py", line 36, in cmd
File "aqt\webview.py", line 135, in _onCmd
File "aqt\webview.py", line 580, in _onBridgeCmd
File "aqt\reviewer.py", line 349, in _linkHandler
File "aqt\sound.py", line 859, in play_clicked_audio
IndexError: list index out of range

Debug Info
In the toolbar, go to Help > About.... In the About window, click the Copy Debug Info button at the bottom beside an 'OK' button. Please paste the contents below.

Anki 2.1.44 (b2b3275f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-07-05 22:06:17


===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Edit Field During Review Cloze ['385888438', 2021-06-25T07:33, '6.4', mod]

===IDs of active AnkiWeb add-ons===
385888438

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Add Hyperlink ['318752047', 2020-07-29T23:37, 'None', '']
Advanced Browser ['874215009', 2021-02-21T17:38, 'None', '']
Advanced Copy Fields ['1898445115', 2019-05-03T21:46, 'None', '']
Anki Simulator ['817108664', 2021-02-21T18:44, 'None', '']
Anki Zoom ['538879081', 2020-04-04T03:20, 'v1.1.3', mod]
Auto Ease Factor ['1672712021', 2021-03-21T21:11, 'None', '']
AwesomeTTS - Add speech to your flashcards ['1436550454', 2021-06-18T08:21, 'None', '']
Batch Editing ['291119185', 2019-09-19T20:04, 'None', '']
BetterSearch ['1052724801', 2021-05-19T03:30, 'None', mod]
Browser Resizer ['1435775540', 2020-09-08T05:04, 'None', '']
Browser TableEditor side-by-side horizontal split ['831846358', 2021-05-27T19:47, 'None', mod]
Copy notes ['1566928056', 2021-02-20T02:54, 'None', '']
Create Filtered Deck from the Browser ['861263371', 2019-03-02T06:14, 'None', '']
Extended Card Stats During Review ['1008566916', 2019-03-02T06:14, 'None', '']
Extended Heatmap ['2011818092', 2021-06-26T21:26, 'None', '']
Extended Tag AddEdit Dialog ['1135507717', 2021-05-19T03:29, 'None', mod]
Fastbar- with nightmode support ['46611790', 2021-05-19T03:50, 'None', '']
Fill the blanks - Multiple typecloze support ['1933645497', 2021-05-06T20:45, 'None', mod]
Free Weekend - or Any Other Day ['742185195', 2020-04-10T14:57, 'None', mod]
Google Translate ['1536291224', 2021-05-23T13:15, 'None', mod]
High Yield Tags ['1918380616', 2020-06-30T23:35, 'None', mod]
Image Editor ['307397307', 2021-06-21T02:24, 'None', mod]
Image Occlusion Enhanced for Anki 21 alpha ['1374772155', 2020-04-28T05:21, 'None', '']
Image Style Editor ['1593969147', 2020-12-17T16:06, 'None', mod]
Leaderboard ['41708974', 2021-06-16T22:40, 'None', mod]
Learning Step and Review Interval Retention ['1949865265', 2020-12-29T01:40, 'None', '']
Media Import ['1531997860', 2018-07-14T15:32, 'None', '']
More Decks Stats and Time Left ['1556734708', 2021-01-27T12:09, 'None', mod]
More Overview Stats 21 ['738807903', 2021-02-05T20:35, 'None', mod]
Notion Toggles Loader ['1940767534', 2021-05-23T21:48, 'None', mod]
Progress Graphs and Stats for Learned and Matured Cards ['266436365', 2020-03-29T09:26, 'None', '']
ReMemorize Rescheduler with sibling and logging v142 ['323586997', 2020-11-20T08:27, 'None', mod]
Reset Ease Automatically ['12081346', 2021-04-16T13:02, 'None', mod]
Reset Ease ['947935257', 2020-12-27T17:59, 'None', '']
Resize images in editor ['1103084694', 2021-05-30T03:04, 'None', mod]
Reverso importer ['2060267742', 2020-09-30T11:11, 'None', mod]
Review Heatmap ['review_heatmap', 2020-04-30T16:23, 'None', '']
Special Fields ['1102281552', 2021-06-21T00:27, 'None', mod]
Speed Focus Mode auto-alert auto-reveal auto-fail ['1046608507', 2019-06-02T12:11, 'None', '']
Straight Reward ['957961234', 2021-01-11T15:37, 'None', '']
Syllabus - Anki Statistics and Export by Tag and Deck ['668156440', 2020-01-12T14:47, 'None', mod]
The KING of Button Add-ons ['374005964', 2020-04-18T01:33, 'None', '']
True Retention ['613684242', 2017-11-19T23:43, 'None', '']
add-on dialog searchfilter bar ['561945101', 2020-05-08T16:16, 'None', '']
avgEase for Anki  2141 ['1129477042', 2021-06-27T14:58, 'None', '']
deck and card info sidebar during review ['673114053', 2020-09-20T15:17, 'None', '']
put ALL due learning cards first modified v2 support ['1807121582', 2019-11-24T22:20, 'None', '']
rebuild allempty all filtered decks enhanced fork ['104518886', 2021-07-05T12:12, 'None', '']
when is next learning card due today due ['563204849', 2020-09-13T16:51, 'None', mod]

Front of card being emptied

I saw the 9/12/19 review talking about cards being deleted, and I wanted to let you know that I also experienced the same issue. This has never happened to me before installing this add-on.

I had 2 cards have their cloze formatting removed. For instance: "I like {{c1::apples}}" became simply "I like apples". As far as I am aware, only the "Text" field is being changed.

The add-ons I have enabled are:

  • Clickable Tags v10
  • Create Filtered Deck from the Browser
  • Edit Field During Review Cloze
  • Hierachical Tags Addon 20 21
  • Hint Hotkeys
  • Pop-up Dictionary beta
  • ReMemorize Rescheduler with sibling and logging v114
  • Special Fields

I am using Anki Version 2.1.15.

My cards are of all the same type, Cloze-AnKingMaster, which has multiple fields on it (e.g., "text", "extra", "lecture notes", hints, etc.).

Addon changes behavior in editor of card types

Hi,
I suppose it shouldn't be this way: When I edit the card types and I use "edit:" for the front, I can't use normal spaces and a new line is forced. But when I don't use "edit:" it's working properly.

With editing:
Screenshot 2021-08-26 123844

Without editing:
Screenshot 2021-08-26 124111

Does anybody has a hint for me?

Error in Anki 2.1.33 causing serious image issues

I'm getting an error whenever I try to use this for the first time on Anki 2.1.33 (I never noticed it on earlier versions). It then causes any images that have spaces in their filename to get renamed and consistently causes the problem until I restart Anki.

For example img class="resizer" src="help (2).png" style="width: 1262px;" becomes img class="resizer" src="help%252520%2525282%252529.png" style="width: 1262px;" and I can't edit it even with by going into the HTML editor with ctrl+shift+x

Error message:

Anki 2.1.33 (3f403040) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.15.6
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2020-09-16 18:35:54
Add-ons possibly involved: ⁨Edit Field During Review Cloze, popup_dictionary⁩

Caught exception:

Traceback (most recent call last):
  File "aqt/webview.py", line 37, in cmd
  File "aqt/webview.py", line 123, in _onCmd
  File "aqt/webview.py", line 547, in _onBridgeCmd
  File "</Applications/Anki.app/Contents/MacOS/decorator.pyc:decorator-gen-152>", line 2, in linkHandler_wrapper
  File "anki/hooks.py", line 638, in decorator_wrapper
  File "anki/hooks.py", line 635, in repl
  File "/Users/Nick/Library/Application Support/Anki2/addons21/popup_dictionary/main.py", line 216, in linkHandler
    return _old(self, url)
  File "</Applications/Anki.app/Contents/MacOS/decorator.pyc:decorator-gen-86>", line 2, in linkHandler_wrapper
  File "anki/hooks.py", line 638, in decorator_wrapper
  File "anki/hooks.py", line 635, in repl
  File "/Users/Nick/Library/Application Support/Anki2/addons21/385888438/reviewer.py", line 193, in myLinkHandler
    saveThenRefreshFld(reviewer, note, fld, new_val)
  File "/Users/Nick/Library/Application Support/Anki2/addons21/385888438/reviewer.py", line 153, in saveThenRefreshFld
    saveField(note, fld, new_val)
  File "/Users/Nick/Library/Application Support/Anki2/addons21/385888438/reviewer.py", line 135, in saveField
    txt = Editor.mungeHTML(None, txt)
  File "aqt/editor.py", line 421, in mungeHTML
  File "aqt/gui_hooks.py", line 1606, in __call__
  File "aqt/editor.py", line 1217, in reverse_url_quoting
AttributeError: 'NoneType' object has no attribute 'mw'

No longer showing entire cloze field when editing

Hi, I love this addon! After updating to one of the newer versions, the addon no longer shows the entire cloze field with the brackets and colons, e.g. {{c1::Gastrulation}} but instead only allows me to edit the current state the card is in.

Current behavior:
editreviewcloze

Is it possible to go back to the old behavior or add an option? Directly editing the cloze was more useful as I can edit any part or add a hint.

EDIT: Issue resolved. Problem was with a recent update with this addon: https://ankiweb.net/shared/info/1049863218

Plugin author has fixed this

Timer resets whenever

Card timer resets whenever card is edited. This might skew with statistics of how long it takes to learn the cards 🗡️

MathJax support?

Hey, is it possible that this add-on supports MathJax as well? If I have a chemical/math equation in my editable field, they turn into "pictures", just like the [...] bug I previously reported. WIth MathJax available in fields I'd have a card like:

Q: What is the chemical equation for hydrogen combustion?
A: image
and after clicking the field to edit it, I'd see [\ce{H2 + 1/2O2 -> H2O}] (as it is the editor's appearance).

Thank you!

Doesn't work with symbols as you type

Symbols as you type doesn't work in the field editor during the reviews in Anki 2.1.43. The editor works correctly, but the keywords don't convert in symbols. Symbols as you type works perfectly in the editor though.
It doesn't give any error, it just doesn't convert the keywords in symbols!
It's no big deal, as 2.1.43 is super-recent and you can still use the editor, so it's not a problem, i just wanted to let you know !
Have a nice day!

I also submitted the issue in the other addon github: jefdongus/insert-symbols-anki-addon#27

Incompatible with GODMODE Cloze

Thank you for the great add on!

I noticed that "edit field during review" isn't compatible with "Godmode cloze" (https://ankiweb.net/shared/info/1508677152) which creates two different shortcuts 1) increases the cloze # by one and 2) which continues the same cloze number, thus if you're going to create multiple clozes on the same level (like continuing c1::) you don't have to go back and edit the cloze.

I've disabled all other add-ons and that didn't change anything. I contacted the other plugins' add on and he thought the issue was on line 220

Unfortunately, I don't have the programming ability to make the changes but the other author's add on suggested: "one way might be to combine the code from the two add-ons; then rewrite the Cloze shortcuts in the Edit Field add-on to be what they are in the Godmode add-on, so they don't conflict."

Thank you for any insights.

Answer time counting

Firs of all, I would like to say that you brought a fantastic improvement to the original add-on. This is one of the most important add-ons I have. Thanks for sharing!!

I noted that, unlike the original add-on, the answer time counting, that will later influence the user statistics, is restarted when a field is edited be means of this add-on. Particularly, I though very cool to compute the time of editing the note as part of my study time, because I was really engaged in that card and in that content.

I would suggest you to change the behavior of the add-on regarding computing the editing time, or to allow this behavior be set in the configuration menu.

I know this is a minor topic to bother you with; anyway, thanks for all you have already done!

Work with plugin closest for anki

The cloze format with plugin closet is [[c0::sample]], but the Edit-Field-During-Review-Cloze 's ctrl +shift+c 's closet is {{c1::sample}}, anyway to customize this to let it work with closet plugin?

Incompatibility with Anki 2.1.20 (beta 5)

Recent changes in Anki 2.1.20 made the add-on incompatible.

It is still possible to review cards and Anki doesn't crash but the add-on doesn't work:

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site.
Debug info:
Anki 2.1.20 (d428b3b4) Python 3.8.0 Qt 5.14.0 PyQt 5.13.2
Platform: Windows 10
Flags: frz=True ao=True sv=1

Caught exception:
Traceback (most recent call last):
File "aqt\webview.py", line 30, in cmd
File "aqt\webview.py", line 96, in _onCmd
File "aqt\webview.py", line 423, in _onBridgeCmd
File "<C:\Program Files\Anki\decorator.pyc:decorator-gen-50>", line 2, in linkHandler
File "lib\site-packages\anki\hooks.py", line 506, in decorator_wrapper
File "lib\site-packages\anki\hooks.py", line 503, in repl
File "C:\Users\marre\AppData\Roaming\Anki2\addons21\385888438_init
.py", line 89, in myLinkHandler
reviewer.card._getQA(reload=True)
AttributeError: 'Card' object has no attribute '_getQA'

Doesn't work with "Symbols As You Type" addon

Do you know why the addon no longer lets me type symbols when I edit cards (both during review and in the editing window)?

Is it possible to fix this?

Edit: I apologize, I did not realize this was caused by a different add-on

Inactive Cloze-Fields

Thanks for the last update. Great improvements!

Though, I cannot solve the following problem: My cards have multiple cloze-fields. Those cloze-fields not beeing asked still take up space due to the addon. Any chance to make it vanish totally, as it does without the addon?

image

image

image

I hope I explained the problem properly. If not, let me know :)

Huge thanks!

Hendrik

fixing anki mobile issue

since i use anki on mobile, i followed the directions on the add on page that says to paste this in the template

{{edit:cloze:FieldName}}
{{cloze:FieldName}}

I changed field name to edit:cloze:Text since Front Side doesn't work.

But now the front card, the question is shown twice. Not sure why.

Annotation 2020-03-29 163348

Underlining

Hello.
There does not seem to be anyway to cancel underline by re-pressing Ctrl+U while highlighting underlined text, while the same behaviour works for bolding.

Typing apostrophe ' will enter in my edits

Please help!!!

When I'm editing during the review, if I type an apostrophe (i.e. ') then its accepting the review prematurely and going back to the regular card with any edits I made up to the apostrophe. This occurs even with all other addon's disabled. I'm using the Anking card type which requires clicking a button to access the field. (https://drive.google.com/drive/folders/1hc44GX3vVfiEHIz1mChZhghA_DBK4dlS)

For example, if I try to write "I don't know" it would be truncated as "I don" because the edits got cut short

It's really annoying when I have speed focus mode on because then the edits get submitted and then speedfocus changes to the next card so I have to go back. During regular editing I have no issues with putting an apostrophe. It's only during editing with reviews that the edit gets submitted.

If I click and open one of the special field (e.g. Pathoma), type in an edit with an apostrophe (which gets cancelled) and then press Pathoma again I can type an apostrophe. If I then repeat this one more time or I press tab after editing, the next time I can't use apostrophes.

Occasionally if I only type an apostrophe first it gives me this error (which I think means nothing was typed):

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.33 (3f403040) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-03-11 07:21:54

Caught exception:
Traceback (most recent call last):
File "aqt\webview.py", line 37, in cmd
File "aqt\webview.py", line 123, in _onCmd
File "aqt\webview.py", line 547, in _onBridgeCmd
File "<C:\Program Files\Anki\decorator.pyc:decorator-gen-28>", line 2, in _linkHandler
File "anki\hooks.py", line 638, in decorator_wrapper
File "anki\hooks.py", line 635, in repl
File "C:\Users\user\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 193, in myLinkHandler
saveThenRefreshFld(reviewer, note, fld, new_val)
File "C:\Users\user\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 153, in saveThenRefreshFld
saveField(note, fld, new_val)
File "C:\Users\user\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 135, in saveField
txt = Editor.mungeHTML(None, txt)
File "aqt\editor.py", line 421, in mungeHTML
File "aqt\gui_hooks.py", line 1606, in call
File "aqt\editor.py", line 1217, in reverse_url_quoting
AttributeError: 'NoneType' object has no attribute 'mw'

Way to edit during preview?

Hi,
I was wondering if it's possible to be able to edit a card from the preview browser (like shown in the screenshot.) I use the preview browser for practicing math problems and keep track of how many times I've done the problem in a field instead of using Anki's review algorithm because (in my experience) I don't think it works well with long problems that take pen and paper to do. Currently, I can edit the number, but it won't save and will revert to the original once I close the preview window.

Screen Shot 2021-05-20 at 2 01 30 PM

Allow editing fields in conditional replacement

https://www.youtube.com/watch?v=M7P_-9IBKYA&feature=youtu.be
Check out point at 8:22

I think this would be a great function to have with your add on. Idk if you know how the AnKing card type is but there are a lot of extra fields for additional notes. If there would be a way to maybe make the font black for the hint field if it was empty where you could click it to then add notes or the traditional blue for fields that actually already have notes that would be awesome!

Feature request: Resize image in add-on

Hi,

A lot of people asks me whether my add-on https://ankiweb.net/shared/info/1103084694 can be used with your add-on. This add-on allows user to click-drag to resize image.
I'm not sure how easy it would be to use my code in your add-on. I would assume that it would not be extremely hard, but my past experience show me that I'm pretty bad at guessing the number of unexpected problem that may occur.
So, I've got two questions:

Would you accept to merge a PR which allow user to add image. This would add to the code complexity.
Would you be interested in doing the work yourself.

As I wrote on https://www.kickstarter.com/projects/arthurmilchior/image-resizing-in-anki/ I don't expect to do the work unless users accept to pay me; mostly because I don't think I'll use this feature myself. But I thought it may be interesting to let you know about it.

YOUTUBE Embedding not working if field specifying YT link is made editable in the addon config

The below checklist isn't manditory, but suggested before creating an issue.

  • I've updated this add-on to the latest version
  • I've tried disabling all other add-ons except this one.

Describe the bug
What is the bug, and what behaviour did you expect instead?

YOUTUBE Embedding not working if field specifying YT link is made editable in the addon config. If i make the source field containing youtube link (core part of the link) as editable in addon , the video fails to load. Once i make it non editable, it plays again. I had this issue initially while first time trying to embed. That time it was because the HTML format was misread by the youtube player. So i had changed the code so as to read only the TEXT of source field (TEXT:FIELD). i think same issue is repeating here also.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Screenshots
If applicable, please add screenshots to help explain your problem.

Debug Info
In the toolbar, go to Help > About.... In the About window, click the Copy Debug Info button at the bottom beside an 'OK' button. Please paste the contents below.

2021-08-05 00_25_56

Feature request: change shortcuts

Hello, your addon is great! I wanted to aske if it could be possible to add the option to customize shortcuts. For example i changed the editor F7 in Alt+X and i would like to have the same shortcut if i edit while i review through your fantastic addon!. It would be really appreciated

Compatibility with Custom Styles font color background colour classes

Great add-on! Exactly the thing I was looking for!

One issue: it doesn't seem to work with the Custom Styles font color background colour classes add-on. Which I use to emphasize terms on my cards. My keyboard shortcuts still work in the editor window, but not during review.

Any suggestions on how to use these add-ons together?

Disable Pop-Up Dictionary while editing

Hey! First and foremost, I cannot thank you enough for creating this add-on. I love everything you've done, and I very much appreciate all your contributions to our community.

I was going to ask if it's possible to create an option to disable the Pop-up mechanism while editing the cards. This is because very often now, when I select a word to either bold, delete, or whatever, it triggers the pop-up dictionary add-on, and it kinda lags. Thanks for considering!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.