Dan Brown [Wed, 23 Mar 2022 11:51:19 +0000 (11:51 +0000)]
Updated tasklist style and functionality for cross-browser use
- Updated styles to better align checkboxes within page content.
- Updated functionality to use a cross-compatible property on checkbox
click within the editor.
Dan Brown [Mon, 7 Mar 2022 14:27:41 +0000 (14:27 +0000)]
Updated CSP with frame-src rules
- Configurable via 'ALLOWED_IFRAME_SOURCES' .env option.
- Also updated how CSP rules are set, with a single header being used
instead of many.
- Also applied CSP rules to HTML export outputs.
- Updated tests to cover.
Dan Brown [Tue, 1 Mar 2022 17:26:06 +0000 (17:26 +0000)]
Updated strategy for empty newline sections
- For some reason, TinyMCE would handle empty paragraphs with a ' '
by default but this would be removed when the paragraph had an
attribute. This was fine in the old editor.
- This changes the approach to use '<br>' tags within elements
for "spaced emptiness".
- For compatbility with any existing empty paragraphs, I updated the
styles to show default height for empty paragraph sections.
- This also makes changes to help preserve encoded html tags
since they were getting converted along the journey.
Dan Brown [Mon, 28 Feb 2022 13:54:33 +0000 (13:54 +0000)]
Added a custom link context toolbar
- Allows for easy unlinking, link preview or link editing.
- Created custom one to limit actions available.
- Performed refactoring of non-plugin toolbar editor code to extact into
its own file.
Dan Brown [Sun, 27 Feb 2022 17:18:08 +0000 (17:18 +0000)]
Improved WYSIWYG code block behaviour via range of fixes
- Fixed issues with new code blocks breaking or acting odd due to
misnamed contenteditable attribute.
- Helped fix issue where code blocks may show in a strage blank state
due to timing within shadow dom loading.
- Fixed some function timing issues where some functions required their
async predecessor to have finished.
Tested rather heavily in firefox and brave.
Fixes #3292
Dan Brown [Thu, 24 Feb 2022 18:26:34 +0000 (18:26 +0000)]
Updated github issue templates
- Removed titles since they don't provide added benefit upon the labels
and would often lead to being submitted with just the placeholder
title.
- Feature request form
- Added further context to benefits field for hopefully better
responses that target the core goal.
- Added a field to ask if feature can already be achieved, to
gain an idea if the submitter has explored other options (if
existing).
- Added a field to ensure the submitter has search the issue list
before submitting.
- Added a field to ask existing BookStack usage time to understand
potential evolution of usage and/or influence of other platforms.
Dan Brown [Thu, 24 Feb 2022 14:16:09 +0000 (14:16 +0000)]
Updated OIDC error handling for better error reporting
Fixes issue where certain errors would not show to the user
due to extra navigation jumps which lost the error message
in the process.
This simplifies and aligns exceptions with more directly
handled exception usage at the controller level.
Dan Brown [Sun, 13 Feb 2022 13:03:41 +0000 (13:03 +0000)]
Updated github actions to ignore language branch
Old branch filters did not seem to work since they are supposed to
reference the target branch, not source branch.
Instead used if statement to prevent run on crowdin branch.
Dan Brown [Wed, 9 Feb 2022 19:24:27 +0000 (19:24 +0000)]
Revamped workings of WYSIWYG code blocks
Code blocks in tinymce could sometimes end up exploded into the sub
elements of the codemirror display.
This changes the strategy to render codemirror within the shadow dom of
a custom element while preserving the normal pre/code DOM structure.
Still a little instability when moving/adding code blocks within details
blocks but much harder to break things now.
Dan Brown [Tue, 8 Feb 2022 17:05:38 +0000 (17:05 +0000)]
Changed editor bottom padding technique
- Ensures padding works across FF & Chrome, was only working on FF
before.
- Fixes sketchy editor positioning focus on FF, since tinyMCE would
add a hidden element to the bottom of the body which would remove/add
our body padding causing unstable positioning.
Dan Brown [Tue, 8 Feb 2022 01:01:37 +0000 (01:01 +0000)]
Aligned some editor events, Changed wysiwyg custom styles loading
- Removed old 'editor-*-update' commands to instead use the aligned
'editor::replace' command that we already have.
- Changed the way custom styles are loaded for the WYSIWYG editor so we
don't need an API call but instead scape content from the parent page
header using comments as identifiers. Added tests to ensure comments
exist and align.
Dan Brown [Mon, 7 Feb 2022 23:19:04 +0000 (23:19 +0000)]
Added help/about box to wysiwyg editor
- To display license info along with shortcuts.
- Extracted out plain layout from 503 error page.
- Added tests to ensure license references are as expected.
Dan Brown [Sun, 6 Feb 2022 15:14:57 +0000 (15:14 +0000)]
WYSIWG: Improved handling of cross-block code block creation
- Updated code content to get specific text selection instead of using
node-based handling which could return the whole document when
multiple top-level nodes were in selection.
- Simplified how code gets applied into the page to not be node based
but use native editor methods to replace the selection. Allows
creation from half-way through a block.
Tested on chrome+Firefox on Fedora 35.
Builds upon changes in #3246.
For #3200.
Dan Brown [Sat, 5 Feb 2022 23:15:58 +0000 (23:15 +0000)]
Modularised our tinymce config and plugins
- Split everything into specific plugin/concern files to make things
more managable. Means original component file is now simple and much
of the core config is focused in one place.
Dan Brown [Fri, 4 Feb 2022 00:26:19 +0000 (00:26 +0000)]
Added user-create API endpoint
- Required extracting logic into repo.
- Changed some existing creation paths to standardise behaviour.
- Added test to cover new endpoint.
- Added extra test for user delete to test migration.
- Changed how permission errors are thrown to ensure the right status
code can be reported when handled in API.
Dan Brown [Thu, 3 Feb 2022 16:52:28 +0000 (16:52 +0000)]
Added user-update API endpoint
- Required changing the docs generator to handle more complex
object-style rules. Bit of a hack for some types (password).
- Extracted core update logic to repo for sharing with API.
- Moved user update language string to align with activity/logging
system.
- Added tests to cover.
Dan Brown [Thu, 3 Feb 2022 12:33:26 +0000 (12:33 +0000)]
Refactored existing user API work
- Updated routes to use new format.
- Changed how hidden fields are exposed to be more flexible to different
use-cases.
- Updated properties available on read/list results.
- Started adding testing coverage.
- Removed old unused UserRepo 'getAllUsers' function.
Dan Brown [Mon, 31 Jan 2022 20:43:41 +0000 (20:43 +0000)]
Added external-auth-id option to create-admin command
- Added tests to cover.
- Refactored some existing testing.
- Requires password or external_auth_id to be provided. Defaults to
password.
- Randomly sets password to 32 digit random chars if external_auth_id
provided instead.
Dan Brown [Mon, 24 Jan 2022 22:08:36 +0000 (22:08 +0000)]
Refreshed markdown cm instance layout on size change
Intended to fix positioning quirks caused by changing codemirror
instance size when you have lines that wrap and cause line height
changes. Often caused by editor toolbox expand/collapse.
This adds a debounced resize observer to refresh editor layout on size
change.
Also tweaks toolbox expand/collapse to more consistently set aria
attribute.
Dan Brown [Mon, 24 Jan 2022 21:38:11 +0000 (21:38 +0000)]
Patched gallery duplication on multi-image upload
Quick patch to clear the gallery display when getting the first page.
Duplication of the galler was occuring due to the mulitple upload events
loading the gallery mulitple times while only clearing the existing
gallery at the start of all refreshes.
A bit flashy in terms of user experience, as there will still be
mulitple load/clear events but fixes the duplication. Could be done more
elegently in future by communicating up image upload counts.