Dan Brown [Sun, 3 Apr 2022 15:22:31 +0000 (16:22 +0100)]
Fixed tests from streaming changes
- Added testing check to buffer stop/clear on streaming output due to
interference during tests.
- Made content-disposition header a little safer in download responses.
- Also aligned how we check for testing environment.
Dan Brown [Sat, 2 Apr 2022 17:42:15 +0000 (18:42 +0100)]
Fixed streamed outputs in more extreme scenarios
Fixes hitting memory limits where downloaded file sizes are much greater
than memory limit. Stopping and flushing output buffer seemed to stop
limits causing issues when fpassthru is used.
Tested with 24M memory limit and 734M file
Dan Brown [Wed, 30 Mar 2022 18:15:24 +0000 (19:15 +0100)]
Fixed settings redirect issue and custom head display
- Fixed issue where redirect for `/settings` view would not be ran
through base url generator so would not create a correct path in some
cases. Now routed through controller with normal redirect.
- Fixed custom head content being active on settings pages due to route
name changes, for when viewing settings, in last release.
Dan Brown [Mon, 28 Mar 2022 10:31:06 +0000 (11:31 +0100)]
PHPStan and StyleCI fixes
- Updated PhpStan PHP version option to match project.
- Applied StyleCI changes.
- Updated static to self in WebhookFormatter, following static analysis
guidance.
- Fixed mis-matched header tags.
Dan Brown [Mon, 28 Mar 2022 10:09:55 +0000 (11:09 +0100)]
Split out settings view and made functional
- Split settings out to new views using a core shared layout.
- Extracted added language text to translation files.
- Updated settings routes to be dynamic to category.
- Added redirect for old primary settings route.
- Updated existing tests to cover settings route changes.
- Added tests to cover settings view.
- Improved contrast of settings links for dark mode.
Dan Brown [Sat, 26 Mar 2022 16:44:34 +0000 (16:44 +0000)]
Added extendable/scalable formatter for webhook data
Creates a new organsied formatting system for webhook data, with
interfaces for extending with custom model formatting rules.
Allows easy usage & extension of the default bookstack formatting
behaviour when customizing webhook events via theme system, and keeps
default data customizations organised.
This also makes the following webhook data changes:
- owned_by/created_by/updated_by user details are loaded for events with
Entity details. (POTENTIALLY BREAKING CHANGE).
- current_revision details are loaded for page update/create events.
Added testing to cover added model formatting rules.
Uses original image data to extract orientation exif to apply image
transformations before scaling and save. Manually done due to issues
with exif data loss during the existing Invervention image path.
Dan Brown [Fri, 25 Mar 2022 11:13:04 +0000 (11:13 +0000)]
Added pre-render sizes to wysiwyg code blocks
Sets sizes on WYSIWYG code block sections based on content lines
as an early pre-codemirror height prediction to avoid excessive
jumping in the editor.
Dan Brown [Wed, 23 Mar 2022 15:11:14 +0000 (15:11 +0000)]
Added wysiwyg filter to handle <br> tags within code blocks
This filters out <br> elements within code blocks and replaces them with
newlines. The editor started using <br>'s more harshley after some
configuration changes upon upgrading tinymce, in which we standardised
on forced br tags to avoid empty elements.
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.