Henrik Giesel
7cd0ced35b
Make images in SizeSelect variable again
2021-09-06 21:15:37 +10:00
Henrik Giesel
386e2740e6
Only allow ImageHandle on valid pictures (determined in SizeSelect)
2021-09-06 21:15:37 +10:00
Henrik Giesel
899434c682
Fix resetting image-handle-bg on no activeImage
2021-09-06 21:15:37 +10:00
Henrik Giesel
bae09a4743
Make first adjustment of size dimensions wait for setting of dimensions label
2021-09-06 21:15:37 +10:00
Henrik Giesel
5f1ed707ff
Better algorithmus for minimum resize + prevent overflow of dimensions
2021-09-06 21:15:37 +10:00
Henrik Giesel
083d173469
Constrain with proportions in SizeSelect
2021-09-06 21:15:37 +10:00
Henrik Giesel
2f94208381
Show custom dimensions again
2021-09-06 21:15:37 +10:00
Henrik Giesel
13f5819f48
Detect active status again
2021-09-06 21:15:37 +10:00
Henrik Giesel
69f1c353df
Implement new resizing algorithm
...
* resizes against the original parameters
2021-09-06 21:15:37 +10:00
Henrik Giesel
d3e46e9da4
Manage CSSStyleSheet from within SizeSelect where each image has one rule
2021-09-06 21:15:37 +10:00
Henrik Giesel
e581d593d3
Hide Float icons when width too small + Avoid too small resizing
2021-09-06 21:15:37 +10:00
Henrik Giesel
f379e18e6f
Revert "During resizing, make the smaller dimension decide the new dimensions"
...
This reverts commit 5bad9a913ce7b4a4cc58106936203fddec37d6da.
The previous behavior was the one you can observe in most graphical editors:
The bigger dimension (width or height) will decide the size, not the smaller one.
2021-09-06 21:15:37 +10:00
Henrik Giesel
64a68743bd
During resizing, make the smaller dimension decide the new dimensions
2021-09-06 21:15:37 +10:00
Henrik Giesel
f9000de16c
Reset height, so it defaults to "auto"
...
* This allows more flexible dynamic resizing for the image in the (p)reviewer
2021-09-06 21:15:37 +10:00
Henrik Giesel
b07c46f88f
Add margin to other side of dimensions
2021-09-06 21:15:37 +10:00
Henrik Giesel
5e80ef3562
Do not allow for resizing when in constrained mode
2021-09-06 21:15:37 +10:00
Henrik Giesel
4142fa2aa2
Don't show same dimensions twice if there are no custom dimensions
2021-09-06 21:15:37 +10:00
Henrik Giesel
92ed342547
Change position of float buttons and dimension
...
* So we can show dimensions at lower image sizes
2021-09-06 21:15:37 +10:00
Henrik Giesel
1472dc854c
Deal with case where no style.{width,height} is set for size dimensions
2021-09-06 21:15:37 +10:00
Henrik Giesel
be3aaa1519
Dispaly "actualHeight / actualWidth" even in constrained mode
2021-09-06 21:15:37 +10:00
Henrik Giesel
4da68e3583
Turn off no-explicit-warning for editing-area
2021-09-06 21:15:36 +10:00
Henrik Giesel
d22aa72964
Use ResizeObserver to resize overlay if necessary
2021-09-06 21:15:36 +10:00
Henrik Giesel
30e0894ad9
Reset image handle on keydown and blur
2021-09-06 21:15:36 +10:00
Henrik Giesel
c6e56e0465
Better RTL support
2021-09-06 21:15:36 +10:00
Henrik Giesel
def2333605
Move selector / active logic up to ImageHandle
2021-09-06 21:15:36 +10:00
Henrik Giesel
a09187007d
Do not use width/height auto important to avoid enlarging smaller images
2021-09-06 21:15:36 +10:00
Henrik Giesel
a1df49b11e
Implement Maximum image size mechanism
2021-09-06 21:15:36 +10:00
Henrik Giesel
8a8cd4ee38
Add float tooltips
2021-09-06 21:15:36 +10:00
Henrik Giesel
f902e91ebd
Allow SW resize
2021-09-06 21:15:36 +10:00
Henrik Giesel
b3c921b86c
Bind to style properties instead of events
2021-09-06 21:15:36 +10:00
Henrik Giesel
8429d00081
Add functionality to set float of image
2021-09-06 21:15:36 +10:00
Henrik Giesel
49da806d91
Image resizes preserves ratio
2021-09-06 21:15:36 +10:00
Henrik Giesel
1756bca212
Add image-handle-dimensions to show dimensions directly on image
2021-09-06 21:15:36 +10:00
Henrik Giesel
0b06891771
First implementation of ImageHandle
2021-09-06 21:15:36 +10:00
Damien Elmes
41c4be2f54
Introduce editable-container
...
Contains the shadow root, and references to the styles.
Is ignorant of Editable.
Is necessary, so our we editable.scss does not need to contain
information about Codable, ImageHandle or all those other things which
have nothing to do with Editable
2021-09-06 21:15:36 +10:00
Henrik Giesel
8ff8186aab
Uniformly shorten SCSS imports/uses
2021-09-02 23:37:17 +02:00
Henrik Giesel
4737a99809
Add source for block level elements
2021-09-02 22:31:25 +10:00
Henrik Giesel
1363a40273
Remove special treatment of empty anki-editable
2021-09-02 22:31:25 +10:00
Henrik Giesel
01a283bb99
Check for non-existence of block tags instead of exclusive existence of inline tags in editable
2021-09-02 22:31:25 +10:00
Damien Elmes
cb5cb006a9
Merge pull request #1350 from hgiesel/exportshortcuts
...
Implement register-package and export some packages
2021-09-02 22:23:12 +10:00
Damien Elmes
d210a21787
Merge pull request #1351 from hgiesel/fontisinline
...
Add FONT as an inline tag
2021-09-02 22:22:19 +10:00
Damien Elmes
b9d9343f51
don't allow |
in generic family
2021-09-02 21:05:17 +10:00
Henrik Giesel
cc8ee65eaf
Add FONT as an inline tag
2021-08-31 13:59:07 +02:00
Henrik Giesel
6e0f7c3d53
Implement register-package and export some packages
...
Exported packages are:
* anki/packages
* anki/shortcuts
* anki/bridgecommand
2021-08-30 14:41:40 +02:00
Damien Elmes
1dd3583b43
Merge pull request #1340 from hgiesel/exportinternal
...
Export Svelte internals
2021-08-24 10:42:17 +10:00
Damien Elmes
12ea482c87
expose require() instead of the svelte global
...
- Means add-on authors should not need to inject any code in their build
- Should be more flexible - we can export multiple libraries if we wish,
and don't have to worry about require() being clobbered by old add-ons.
2021-08-24 10:22:07 +10:00
Henrik Giesel
fdf8321253
Rename cross-unit to export-internal
2021-08-23 23:45:50 +02:00
Henrik Giesel
fea4f17107
Export WithShortcut
2021-08-23 21:23:04 +02:00
Henrik Giesel
1495fdf311
Export svelte_internal as library on window object
...
Closes https://github.com/ankitects/anki/issues/1328 .
2021-08-23 21:16:15 +02:00
hikaru-y
20085c9bc4
Quote font family names, except for generic families
...
Fixes https://forums.ankiweb.net/t/font-script-is-not-changing-in-the-anki-windows/12465
2021-08-20 04:31:11 +09:00