Commit Graph

7715 Commits

Author SHA1 Message Date
Damien Elmes
a1ce048ed5 fix error when user cancels out of set due date/reposition 2021-04-25 19:33:25 +10:00
Damien Elmes
b7747b6a38 experimental support for extending add-ons screen with Svelte 2021-04-25 19:33:18 +10:00
Damien Elmes
b485b8cbb9 deckconfig->deckoptions 2021-04-25 19:02:30 +10:00
Damien Elmes
d6df6c0f89 RevertIcon->RevertButton 2021-04-25 19:02:30 +10:00
RumovZ
b1392980f5 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
458d891d28 Add dec to make methods no-op if no selection 2021-04-25 08:36:22 +02:00
Damien Elmes
e2a4d6041c 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
Damien Elmes
c71b684a94
Merge pull request #1150 from hgiesel/notetypechoose
Editor Toolbar cleanup
2021-04-24 11:04:24 +10:00
Henrik Giesel
5709183fe1 Prefer slicing and splicing 2021-04-24 01:48:22 +02:00
Henrik Giesel
452fdf05af Remove unused import 2021-04-24 01:32:02 +02:00
Henrik Giesel
af5d7cc6a3 Fix typing typo 2021-04-24 01:15:16 +02:00
Henrik Giesel
53bb8c7b28 Add addMenu and updateMenu, avoid using {buttons,menus}Promise outside of class 2021-04-24 01:08:55 +02:00
Henrik Giesel
1f05ebbcf7 Remove addcards toolbar again for now 2021-04-24 00:10:45 +02:00
Henrik Giesel
9f7a187d4a Add mostly working addcards topbar 2021-04-24 00:00:32 +02:00
Henrik Giesel
baeaa29dae Simplify Handling of margins and padding of ButtonGroup & ButtonDropdown 2021-04-23 22:22:53 +02:00
Henrik Giesel
9629d3201b Simplify tag structure in ButtonGroup 2021-04-23 21:42:44 +02:00
Henrik Giesel
8ecd4f8c95 Add simple version of Chooser buttons 2021-04-23 21:25:44 +02:00
Henrik Giesel
48b7cb49f9 Make update algorithm in editor-toolbar/index.ts recursive 2021-04-23 20:50:09 +02:00
Henrik Giesel
6ae368ebac Reduce typing overhead in ts/editor-toolbar/index.ts and export buttonGroup 2021-04-23 19:05:43 +02:00
Henrik Giesel
bda99ee0f1 Add IterableToolbarItem interface for easier typing 2021-04-23 18:53:52 +02:00
Henrik Giesel
7cd779063f Fix regression from 70c3b51b0b
Negative indices were not treated correctly (as offset from end)
2021-04-23 18:21:03 +02:00
Henrik Giesel
7563a3c929 Use rawButton in browser.py 2021-04-23 17:34:42 +02:00
Henrik Giesel
d250d39d64 Add withLabel component 2021-04-23 17:20:52 +02:00
Henrik Giesel
4379f1e84f 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
ee6f5cd0fd onDestroy must be called from top level 2021-04-23 20:25:47 +10:00
Damien Elmes
aba8df7708 make return value match mergeTooltipAndShortcut() signature 2021-04-23 19:48:36 +10:00
Damien Elmes
70c3b51b0b remove nested terneries and enable lint
@hgiesel would you mind quickly checking I've correctly captured
the logic here?
2021-04-23 13:00:18 +10:00
Damien Elmes
5a8b9f403d move isApplePlatform() into lib/shortcuts, and remove sveltelib file 2021-04-23 11:22:30 +10:00
Damien Elmes
79b62682ab use new registerShortcut() fuction in DeckConfigPage 2021-04-23 11:20:12 +10:00
Damien Elmes
42c466223e bump rules_nodejs version 2021-04-23 11:11:47 +10:00
Damien Elmes
b43ca89a5a
Merge pull request #1149 from hgiesel/renameankitolib
Rename anki/ to lib/ for export
2021-04-23 10:18:33 +10:00
Damien Elmes
00f170dddc update remaining anki/ references 2021-04-23 10:16:40 +10:00
Henrik Giesel
1d72599a37 Rename anki/ to lib/ for export
import _ from "anki/x";

will become

import _ from "lib/x";

to fit the directory name.
2021-04-23 10:02:28 +10:00
Damien Elmes
8b4446d044
Merge pull request #1148 from hgiesel/updatetypescript
Update Typescript to 4.2.4
2021-04-23 09:48:34 +10:00
Damien Elmes
02ebab7491
Merge pull request #1146 from hgiesel/shortcuts
Shortcut API for Editor
2021-04-23 09:44:01 +10:00
Damien Elmes
047072182b
change file comment to group comment 2021-04-23 08:55:04 +10:00
Damien Elmes
a20606530e
Merge pull request #1145 from rgreenblatt/main
solve missing escape of ' (fixes #1144)
2021-04-23 08:53:23 +10:00
Henrik Giesel
dc10e6235d Update eslint to 4.22.0 2021-04-22 19:19:39 +02:00
Henrik Giesel
5a11566ff2 Import createPatch in ts/sql_format directly 2021-04-22 18:43:35 +02:00
Henrik Giesel
a7c3aec5dc Update Typescript to 4.2.4 2021-04-22 18:33:42 +02:00
Henrik Giesel
22a07a3a58 Separate type import for WithShortcut 2021-04-22 18:19:09 +02:00
Henrik Giesel
5197e3b779 Prefer optionalModifiers over register multiple shortcuts 2021-04-22 18:15:25 +02:00
Henrik Giesel
31e4b79ff4 Add optionalModifiers parameter to registerShortcut 2021-04-22 17:28:38 +02:00
Henrik Giesel
7aaf7b7fe0 Add license headers 2021-04-22 16:49:30 +02:00
Henrik Giesel
57357a42a5 Satisfy formatter 2021-04-22 15:24:27 +02:00
Henrik Giesel
f6ef4d43cb Use registerShortcut in inputHandlers + Avoid focus on color picker 2021-04-22 15:09:09 +02:00
Henrik Giesel
8ca40369a7 Fix typo deregisters 2021-04-22 14:54:29 +02:00
Henrik Giesel
47809f6230 Add shortcut labels for ColorPicker and Latex items 2021-04-22 14:35:44 +02:00
Henrik Giesel
3cf7db8557 Add better better shortcutLabel support for buttons 2021-04-22 14:18:48 +02:00
Damien Elmes
e5c5c91ec8 override some bootstrap styles for night mode
There's probably a better way to accomplish this - fixes welcome!

Also fix the page reloading when enter hit inside the modal.
2021-04-22 21:57:32 +10:00