Jul 28 - Update text-editor to allow image resize
This commit is contained in:
@@ -187,6 +187,26 @@ Then visit `https://your-domain/admin`, sign in, and manage content.
|
||||
change, newest first, filterable by action and type, paginated 50/page. Times
|
||||
are UTC.
|
||||
|
||||
**Adding a photo:** three ways, all equivalent — the toolbar's image button,
|
||||
**pasting** an image (a screenshot, or a copied picture), or **dragging** an
|
||||
image file into the editor. In every case the file is uploaded to the server and
|
||||
referenced by URL. Pasting from Word or Google Docs works too: those arrive as
|
||||
embedded base64 data, which is uploaded and swapped for a real file
|
||||
automatically, with the surrounding text preserved. A short notice appears while
|
||||
an upload runs, or if one is refused (max 8 MB; PNG, JPEG, GIF and WebP only).
|
||||
One exception: an image copied straight from another website keeps pointing at
|
||||
that site (it isn't copied to our server), so save the file and paste it in if
|
||||
you need it to last.
|
||||
|
||||
**Resizing a photo:** click any image in the body editor. A frame appears with
|
||||
corner handles — drag one to scale it — plus quick sizes **S / M / L / Full**
|
||||
(25 %, 50 %, 75 %, 100 % of the text width) and **Reset** for the original size.
|
||||
The live readout shows the current width in pixels. An image can't be dragged
|
||||
wider than the text column, and inside a table it scales to the cell. Ctrl+Z
|
||||
undoes a resize. The size is stored as the image's `width` attribute, so it
|
||||
survives the save and is what the public page renders; height stays automatic,
|
||||
so the photo keeps its proportions and still shrinks to fit a phone screen.
|
||||
|
||||
The editor (Quill 2 + quill-table-better) and drag library (SortableJS) are
|
||||
**vendored locally** under `static/vendor/` — no CDN dependency, so they work on a
|
||||
locked-down server and survive a strict CSP. The body toolbar supports **inline
|
||||
|
||||
Reference in New Issue
Block a user