Henrik Giesel
a21a4d330b
Initialize editor toolbar via function, not web component
2021-04-25 18:32:01 +02:00
Damien Elmes
68a4f4bade
Merge pull request #1151 from RumovZ/no-sel-dec
...
Fix some problems with browser actions while selection is empty
2021-04-25 20:48:40 +10:00
Damien Elmes
1a6c5f594d
enable the new deck options by default
...
- The old options are still available with a shift+click
- Translations still need updating
- See d8ca46e6e9 for some examples
of extending the screen in an add-on
2021-04-25 19:58:58 +10:00
Damien Elmes
f3b344a571
fix error when user cancels out of set due date/reposition
2021-04-25 19:33:25 +10:00
Damien Elmes
d8ca46e6e9
experimental support for extending add-ons screen with Svelte
2021-04-25 19:33:18 +10:00
Damien Elmes
fdb814cbcd
deckconfig->deckoptions
2021-04-25 19:02:30 +10:00
RumovZ
f898f5507c
Skip some browser methods if selection is empty
...
This was handled inconsistently before:
* Select Notes would throw a search error.
* Set Due Date would throw an exception.
* Dialogs with no effect would open.
* No-ops would be pushed to the undo queue.
2021-04-25 08:47:15 +02:00
RumovZ
8f37234373
Add dec to make methods no-op if no selection
2021-04-25 08:36:22 +02:00
Damien Elmes
d5c1f19521
basic support for add-ons in new deck config screen
...
- expose the data as a writable store
- currently only supports raw HTML; example to come
- fix changes not marking a deck config as modified
- the data is currently packed into the deckconfig object, but we
may move these to a separate store in the collection config in the
future, like is done with decks/notetypes
2021-04-24 11:08:01 +10:00
Henrik Giesel
79b16c1a96
Remove unused import
2021-04-24 01:32:02 +02:00
Henrik Giesel
a2ff598637
Remove addcards toolbar again for now
2021-04-24 00:10:45 +02:00
Henrik Giesel
9346e007c9
Add mostly working addcards topbar
2021-04-24 00:00:32 +02:00
Henrik Giesel
da230fbb24
Add simple version of Chooser buttons
2021-04-23 21:25:44 +02:00
Henrik Giesel
01b53a6be8
Make update algorithm in editor-toolbar/index.ts recursive
2021-04-23 20:50:09 +02:00
Henrik Giesel
e66edd3887
Reduce typing overhead in ts/editor-toolbar/index.ts and export buttonGroup
2021-04-23 19:05:43 +02:00
Henrik Giesel
aebaaf1a70
Add IterableToolbarItem interface for easier typing
2021-04-23 18:53:52 +02:00
Henrik Giesel
9e952e428e
Use rawButton in browser.py
2021-04-23 17:34:42 +02:00
Henrik Giesel
59f0a2dd70
Make dynamicComponents usable for addons, rather than the components directly
...
rawButton({ html: ... })
instead of
{ component: RawButton, html: ... }
2021-04-23 16:43:36 +02:00
Damien Elmes
ca74b25481
Merge pull request #1146 from hgiesel/shortcuts
...
Shortcut API for Editor
2021-04-23 09:44:01 +10:00
Damien Elmes
973463cb96
split deck description into separate screen linked from overview
2021-04-22 21:03:16 +10:00
Henrik Giesel
7ab5f736df
Move other buttons to WithShortcut
2021-04-22 03:25:31 +02:00
Damien Elmes
a7ef410615
hook new deck config screen up behind an env var
2021-04-22 10:59:16 +10:00
Henrik Giesel
b0ddae0f6c
Add first shortcuts for bold, italic, underline, removeFormat
2021-04-22 02:37:04 +02:00
Henrik Giesel
93136030e9
Include editor-toolbar as a library in editor
2021-04-20 13:44:44 +02:00
Henrik Giesel
ece4f75592
Generalize inListItem to getAnchorElement
2021-04-20 13:44:43 +02:00
Damien Elmes
04f0adb847
fix Find Dupes activation
2021-04-20 21:13:21 +10:00
Damien Elmes
48fc9251bd
implement deck config saving on JS end
2021-04-20 19:50:05 +10:00
Damien Elmes
c5cecabdd4
include sourcemaps for pages/* in dev builds
2021-04-20 17:33:46 +10:00
RumovZ
eb9fbb9c0f
Add sidebar filter "first review today"
2021-04-18 13:27:10 +02:00
Damien Elmes
1f0ff0f22d
add schema change prompt to removal, tweak return struct
2021-04-18 17:33:12 +10:00
Damien Elmes
e168612d01
Merge pull request #1130 from glutanimate/add-deckchooser-to-addcards-legacy-api
...
Add AddCards.deckChooser property for legacy add-on support
2021-04-16 11:58:34 +10:00
Damien Elmes
e1915696e9
support overriding listening IP during dev
2021-04-16 10:23:13 +10:00
Glutanimate
87dc766bca
Add AddCards.deckChooser property for legacy access
2021-04-15 18:18:25 +02:00
Henrik Giesel
ff8cfd1c3e
Add type to add_preview_shortcut
2021-04-15 15:50:29 +02:00
Henrik Giesel
1a04ca32fe
Add Latex formatting options to menu
...
* Format shortcuts in monospace font and increase padding a little bit
2021-04-15 15:20:37 +02:00
Henrik Giesel
277d0af336
Add Preview shortcut for browser
2021-04-15 13:09:51 +02:00
Henrik Giesel
f5687f5aec
Add support for Preview button in Browser
2021-04-15 13:09:50 +02:00
Henrik Giesel
fa6ac2b27b
Add RawButton and hook old python hooks up to it
2021-04-15 13:09:50 +02:00
Henrik Giesel
d1374d4b58
Show/Hide Cloze button depending on whether cloze type
2021-04-15 13:09:50 +02:00
Henrik Giesel
cfb9376e5e
Fix some code quality issues
2021-04-15 13:09:49 +02:00
Henrik Giesel
b002994d30
Add labels and titles to all buttons
2021-04-15 13:09:49 +02:00
Henrik Giesel
ef9eb38d26
Utilize enableButtons disableButtons from Svelte component
2021-04-15 13:09:49 +02:00
Henrik Giesel
c06d500f0c
Include icons directly in ts lib
2021-04-15 13:09:49 +02:00
Henrik Giesel
e175c9348e
First implementation
2021-04-15 13:09:48 +02:00
Henrik Giesel
e1da2d0e01
Add ts/editor-toolbar
2021-04-15 13:09:48 +02:00
RumovZ
f35110a0eb
Fix ChangeModel combos being cleared after setup()
2021-04-14 23:01:40 +02:00
Damien Elmes
04fa13b968
add a shortcut to speed up local ts dev
...
@hgiesel if you're not already doing something like this, you might
find this useful
2021-04-14 23:21:33 +10:00
Damien Elmes
57a1651113
deck config prototype work in progress
...
Still in the early stages, and not hooked up yet.
2021-04-14 22:33:10 +10:00
Damien Elmes
2629240272
Merge pull request #1127 from Arthur-Milchior/factorize_current_search
...
NF: factorize browser.current_search
2021-04-14 19:16:59 +10:00
Damien Elmes
656b0dd289
fix formatting in dmypy.py
2021-04-14 19:11:01 +10:00
Arthur Milchior
ad9adee26a
NF: factorize browser.current_search
...
I was looking at search code and find out that's already slightly more clear/short even if NF
2021-04-14 10:55:41 +02:00
Damien Elmes
cd4326c77e
run prettier on some sass files
2021-04-14 18:22:33 +10:00
Damien Elmes
2a43d42323
run black/isort on Python scripts
2021-04-14 18:22:02 +10:00
Damien Elmes
e35b2f68ac
add an updated script to run mypy as a daemon
...
Sadly doesn't work on Windows
2021-04-14 18:10:38 +10:00
Damien Elmes
ec6a2f7e2a
Merge pull request #1124 from hgiesel/dropjquerypy2
...
Remove jQuery from remaining qt/aqt files
2021-04-14 12:43:11 +10:00
Damien Elmes
4afc197b88
Merge pull request #1123 from hgiesel/reviewerbottomdropjquery
...
Remove jQuery reviewer-bottom.ts and overview.ts
2021-04-14 12:35:39 +10:00
Damien Elmes
73fa01ad0a
Merge pull request #1122 from hgiesel/webviewcss2
...
Prefer SASS over including files
2021-04-14 11:55:19 +10:00
Damien Elmes
5af7604e83
add missing type annotation
2021-04-14 11:28:40 +10:00
Damien Elmes
8277ad6686
Merge pull request #1121 from RumovZ/move-sidebar
...
More for the browser folder
2021-04-14 11:25:15 +10:00
Damien Elmes
7ac4a196e6
add contributor
2021-04-14 11:03:17 +10:00
Henrik Giesel
cc668d10d3
Replace jQuery in webview.py
2021-04-13 21:32:53 +02:00
Henrik Giesel
d2a5d9e246
Satisfy formatter
2021-04-13 20:29:59 +02:00
Henrik Giesel
ba2975409d
Remvoe jQuery from deckbrowser.py
...
It's not quite clear why jQuery was necessary here?
2021-04-13 20:26:06 +02:00
Henrik Giesel
31899c5826
Remove jquery from reviewer.py
...
- we no longer actually need to focus the default ease button
2021-04-13 20:11:18 +02:00
Henrik Giesel
7d39d77b87
Remove jQuery from toolbar.py
2021-04-13 19:59:00 +02:00
Henrik Giesel
10c7d4bf34
Remove jquery from browser.py
2021-04-13 19:54:45 +02:00
Henrik Giesel
56c2af1fd3
Satisfy formatter
2021-04-13 19:47:03 +02:00
Henrik Giesel
19903986f9
Move compile_sass.bzl to /ts + Remove core.css from data/web (unused?)
2021-04-13 19:47:03 +02:00
Henrik Giesel
5bcb2f080f
Declare dependencies in data/web/css
2021-04-13 19:47:03 +02:00
Henrik Giesel
630ee9c6bb
Use graphs-base and congrats-base
2021-04-13 19:47:03 +02:00
Henrik Giesel
8efbcddbb4
Do not include webview.css for editor
2021-04-13 19:47:03 +02:00
Henrik Giesel
b14dc3f7cb
Move card_counts and split off fusion_vars
2021-04-13 19:47:03 +02:00
Henrik Giesel
3eb02f6254
Add option not include default css in stdHtml
2021-04-13 19:47:03 +02:00
Henrik Giesel
8797ab5a20
Purge jQuery from reviewer-bottom
2021-04-13 19:41:04 +02:00
Henrik Giesel
4134041686
Remove overview.ts
2021-04-13 19:38:57 +02:00
Damien Elmes
fe41d780b5
Merge pull request #1119 from hgiesel/reviewerdropjquery
...
Remove last jQuery from reviewer.ts / Remove fadeTime
2021-04-13 23:12:13 +10:00
Henrik Giesel
f2b23ee8bd
Add setInnerHTML as a Replacement for $.html
2021-04-13 13:32:50 +02:00
RumovZ
f62cfc15c2
Move previewer.py into browser folder
2021-04-13 11:38:35 +02:00
RumovZ
38621d0fac
Declare all legacy pathnames in browser init
2021-04-13 11:30:32 +02:00
RumovZ
e37dc6c68c
Move find_and_replace.py into browser/dialogs
2021-04-13 11:21:36 +02:00
RumovZ
12d3084e46
Refactor sidebar.py into browser folder
2021-04-13 11:05:49 +02:00
Damien Elmes
1f475a1709
add missing copyright headers to *.ts
2021-04-13 18:57:08 +10:00
Damien Elmes
926fc2e492
add missing copyright headers to *.py
2021-04-13 18:45:35 +10:00
Henrik Giesel
bf119d2c9a
Remove display:none from mark and flag, and preset hidden attribute instead
2021-04-13 01:00:09 +02:00
Henrik Giesel
8f08bb3d0b
Make imageLoaded adhere to its function signature
2021-04-13 00:42:09 +02:00
Henrik Giesel
dc61a6f547
Remove jQuery from mark and flag in reviewer.ts
2021-04-13 00:37:58 +02:00
Henrik Giesel
99f2ca0b99
Remove jQuery from _updateQA
2021-04-13 00:22:00 +02:00
RumovZ
a1e8746efd
Refactor browser and table into folders
2021-04-12 09:50:44 +02:00
Damien Elmes
19d9492380
handle missing default sort column in notes view
...
Switching to notes mode was throwing:
File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/browser.py", line 449, in on_table_state_changed
self.table.toggle_state(checked, self._lastSearchTxt)
File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/table.py", line 206, in toggle_state
self._state = self._model.toggle_state(
File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/table.py", line 996, in toggle_state
self.search(context)
File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/table.py", line 1005, in search
context.order = self.columns[self._state.sort_column]
2021-04-12 16:02:51 +10:00
RumovZ
b33e81c215
Save separate browser mode headers
2021-04-11 12:28:11 +02:00
RumovZ
d58af0dd95
Merge branch 'master' into backend-columns
2021-04-11 11:18:15 +02:00
RumovZ
dadeaa75b7
Add browser_did_fetch_columns hook and some doc
2021-04-11 10:27:43 +02:00
RumovZ
a6f5a52fc1
Resolve config sort in table model
2021-04-10 11:33:59 +02:00
RumovZ
dd4f08a90f
Rename column label fields
2021-04-10 09:14:20 +02:00
RumovZ
e28f2320b8
Unify state columns
...
* Remove duplicate backend columns
* Remove duplicate column routines
* Move columns on frontend from state to model
* Generate available columns from Colum enum
* Add second column label for notes mode
2021-04-08 23:48:24 +02:00
RumovZ
0ff193cd5d
Add enum for column sorting
2021-04-08 11:40:24 +02:00
RumovZ
47eeb5da14
Add enum for column alignment
2021-04-08 11:28:29 +02:00
RumovZ
d7e0da3786
Remove Column class and use pb class instead
2021-04-08 11:17:25 +02:00
Damien Elmes
43105d62cf
i18n tts error message
2021-04-08 09:35:19 +10:00
Damien Elmes
2eec071b22
fix '\\' being converted to single backslash
...
Appears the default changed in 3.x
https://github.com/mathjax/MathJax/issues/2532
https://forums.ankiweb.net/t/double-backslashes-in-text-of-notes-are-turned-into-single-backslashes-on-display/9048
2021-04-07 21:50:33 +10:00
RumovZ
b59a7c72a1
Save key for unsupported add-on columns
2021-04-06 23:02:58 +02:00
RumovZ
3c84749973
Use backend column objects on frontend
2021-04-06 19:47:03 +02:00
RumovZ
460e79ba73
Change notes mode shortcut
2021-04-06 16:48:35 +02:00
Damien Elmes
ae7a327cae
current deck change is now undoable
...
- make sure we set flag in changes when config var changed
- move current deck get/set into backend
- set_config() now returns a bool indicating whether a change was
made, so other operations can be gated off it
- active decks generation is deferred until sched.reset()
2021-04-06 21:52:06 +10:00
RumovZ
49ebf1a9ae
Fix get_item_from_card_id()
2021-04-06 12:06:08 +02:00
RumovZ
dec8fd6181
Tweak new browsing strings
2021-04-06 11:41:18 +02:00
Damien Elmes
a8af070f9a
update find&replace, and remove perform_op()
2021-04-06 17:07:38 +10:00
Damien Elmes
1b81653e0e
update scheduling ops
...
- migrate to CollectionOp()
- return actual change count when suspending/burying
- add helper to convert vec to vec of newtype
2021-04-06 16:38:42 +10:00
Damien Elmes
783e0ec224
update note ops
...
remove_note() now returns the count of removed cards, allowing us
to unify the tooltip between browser and review screen
I've left the old translation in - we'll need to write a script at
one point that gathers all references to translations in the code,
and shows ones that are unused.
2021-04-06 14:56:36 +10:00
Damien Elmes
3669e948c4
migrate more ops to CollectionOp
2021-04-06 14:36:13 +10:00
Damien Elmes
f030fdbfa4
it seems mypy ignores the generic class bound if it's a type alias
2021-04-06 14:14:55 +10:00
Damien Elmes
45636877f4
start migrating perform_op() into builder in separate file
...
By passing back the builder to the calling code to run, we don't need
to plumb extra arguments like success= and handler= through each
operation, and the ability to override the default tooltip behaviour
comes free on all operations
2021-04-06 12:47:55 +10:00
Damien Elmes
427424c660
shift keep-current-selection logic into sidebar's refresh()
...
By calling refresh() manually after performing an op, we were refreshing
twice, and the selection was being lost when changes were made outside
of the sidebar.
Also drop the after_hooks arg to perform_op(), since nothing is using
it now.
2021-04-06 11:18:13 +10:00
Damien Elmes
c3b0fb35b7
more perform_op() tweaks
...
- pass the handler directly
- reviewer special-cases for flags and notes are now applied at
call site
- drop the kind attribute on OpChanges which is not needed
2021-04-06 10:14:11 +10:00
Damien Elmes
7666d1fc22
fix error when opening browser during review while notes mode active
2021-04-05 21:57:06 +10:00
Damien Elmes
1613f2edd4
fix row cache issues
...
I think this may have accidentally been changed in the refactoring.
If we discard self._rows, it will result in the entire table flashing
"..." until the new data is available. Instead, we leave the cached
rows alone, and just update the cutoff point, so we can serve stale
content (avoiding any visible redraw) until the new data is available.
I've updated search() to reset the rows there, so we free up memory
on a new search.
2021-04-05 14:42:04 +10:00
Damien Elmes
3ab53c77c7
add booleans for various screens to OpChanges
...
The backend knows exactly which op has executed, and it saves us having
to re-implement this logic on each client.
Fixes the browser table refreshing when toggling decks.
2021-04-05 14:28:56 +10:00
Damien Elmes
12c1a570ac
allow ops to pass metadata into perform_op()
...
Instances can pass handled_by=self to more easily ignore events they
initiate.
Fixes ugly refresh when expanding/collapsing decks, but we're still
refreshing the card/notes area unnecessarily in that case.
2021-04-05 13:43:09 +10:00
Damien Elmes
18ba5554ca
undo support for tag collapse; expand->collapse for consistency w/ decks
2021-04-05 11:47:12 +10:00
Damien Elmes
dc5b900056
add routine to set deck collapse state
...
Updating a deck via protobuf is now exposed on the backend, but not
currently on the frontend - I suspect we'll be better off writing
separate routines for the actions we need instead, and we get a better
undo description for free.
This is currently causing an ugly redraw in the browse screen, which
will need fixing.
2021-04-05 11:19:04 +10:00
Damien Elmes
282ae2285a
expose read-only access to new deck objects
2021-04-04 20:39:56 +10:00
Damien Elmes
65a2db34df
ensure page is shown when setHtml() called
...
https://forums.ankiweb.net/t/looked-into-the-bug-when-pressing-e-and-r-together-in-filtered-deck/8951
2021-04-03 16:59:23 +10:00
Damien Elmes
a9e40622e5
move operations into submodule
2021-04-03 16:26:10 +10:00
Damien Elmes
cb9d5b9f28
simplify errors
...
- use a flat enum instead of oneof messages, most of which were empty
- tidy up the Python side
2021-04-03 16:06:46 +10:00
Damien Elmes
d7237be205
use perform_op() for undo()
...
Instead of manually updating the UI after undoing, we just rely
on the same change notification infrastructure regular operations
use.
2021-04-03 14:38:49 +10:00
Damien Elmes
b2bfd940e7
move filtered deck labels to backend
...
- use strum to generate an iterator for the protobuf enum so we don't
forget to add new labels if extending in the future
- no add-ons appear to be using dynOrderLabels(), so it has been removed
@RumovZ perhaps a similar approach might work for listing the available
browser columns as well?
2021-04-01 23:53:38 +10:00
Damien Elmes
f41d6edeca
Merge pull request #1108 from RumovZ/more-columns
...
Even more browser fixes and features
2021-04-01 15:59:06 +10:00
Damien Elmes
81ad087d56
Merge pull request #1106 from abdnh/fix-deprwarn
...
Fix deprecated implicit conversion from float to int using __int__()
2021-04-01 15:14:49 +10:00
Damien Elmes
1eed560ada
tweak the wording of some of the tag ops
2021-04-01 15:12:13 +10:00
RumovZ
3e87a28232
Add shortcut and tooltip to switch
2021-03-31 18:53:36 +02:00
RumovZ
9d7c977283
Delay switch animation
...
If the switch triggers heavy GUI action, like a lot of paint()s, the
concurrently running switch animation may look choppy.
A small timer makes these events execute first and the animation will
run smoothly afterwards when the event queue has been drained.
2021-03-31 12:13:09 +02:00
RumovZ
dd997b20af
Make toggle actions checkable
2021-03-31 10:05:44 +02:00
RumovZ
b041f1db26
Change switch knob colour
2021-03-31 09:16:25 +02:00
RumovZ
6233a125fc
Add note interval column
2021-03-30 23:44:35 +02:00
abdo
7b45c08860
Fix deprecated implicit conversion from float to int using __int__()
2021-03-31 00:32:20 +03:00
RumovZ
0c1d4d66fc
Fix previewer not changing card
2021-03-30 22:06:58 +02:00
RumovZ
ca87a6fc45
Add note due column
2021-03-30 21:39:15 +02:00
RumovZ
880e6dc651
Add browser column enum for backend
2021-03-30 11:59:52 +02:00
Damien Elmes
76b5a79fe1
Merge pull request #1103 from abdnh/win-openfolder
...
Fix ResourceWarning in openFolder() on Windows
2021-03-30 19:28:12 +10:00
Damien Elmes
34195e1233
Merge pull request #1102 from RumovZ/more-browser
...
More browser fixes and features
2021-03-30 19:27:55 +10:00
RumovZ
34d3d24003
Add note lapses column
2021-03-29 16:06:15 +02:00
RumovZ
1eb1747365
Add note reps column
2021-03-29 15:52:02 +02:00
RumovZ
20d3569e72
Make note state equate to False as on backend
2021-03-29 15:51:34 +02:00
RumovZ
98288ff1cc
Add switch for browser states
2021-03-29 12:24:24 +02:00
RumovZ
f5cf5c0079
Implement custom qt button Switch
2021-03-29 12:19:48 +02:00
RumovZ
72ddbebf97
Fix browser_did_fetch_row hook
2021-03-29 12:16:50 +02:00
RumovZ
8f76b482bb
Remove fixme for card_ids legacy support
2021-03-29 12:07:24 +02:00
RumovZ
f7f20d7630
Explain use of deprecated decorator
2021-03-29 12:04:14 +02:00
RumovZ
54cf724188
Flag deleted rows as inactive
2021-03-29 11:55:28 +02:00
RumovZ
6c3d930ec0
Fix state toggling when current is deleted
2021-03-29 11:54:35 +02:00