Skip to content

Improving Uploading and Editing Images - #788

Merged
poppastring merged 6 commits into
mainfrom
blog-editing-improvements
Mar 14, 2026
Merged

poppastring merged 6 commits into
mainfrom
blog-editing-improvements

Conversation

@poppastring

Copy link
Copy Markdown
Owner

PR Classification

Editor integration and code cleanup.

PR Summary

This pull request replaces Froala and TinyMCE editors with Jodit for blog post editing, streamlining image upload and file browsing. It removes obsolete code and updates configuration to use Jodit as the default editor.

  • BlogPostController.cs: Removes old image upload logic, adds new API endpoints for Jodit image upload and listing.
  • JoditBuilder.cs: Introduces Jodit editor integration with AJAX image/file handling.
  • Constants.cs and EntryEditControlViewModel.cs: Updates to add Jodit and remove unused editor constants.
  • site.config and site.Development.config: Sets Jodit as the default EntryEditControl.
  • BlogPostFields.cshtml and TextAreaBuilder.cs: Removes file upload UI and deletes obsolete TextArea editor code.

poppastring and others added 6 commits March 13, 2026 19:45
Replace the bare TextArea editor with Jodit 4.x (MIT license, no API key
required). Jodit provides full WYSIWYG editing with HTML source view toggle,
toolbar formatting, and built-in drag-and-drop image upload.

- Add JoditBuilder implementing IRichEditBuilder with CDN-loaded Jodit
- Add AJAX image upload endpoint (POST /api/image/upload) for drag-and-drop
- Wire Jodit as the default editor in DI (fallback for unknown config values)
- Remove TextAreaBuilder and TextAreaEditor constant
- Update config defaults and admin dropdown to list Jodit first

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use insertHTML with a <figure> wrapper instead of insertImage so
dropped images are placed as block-level elements rather than inline
inside paragraph tags.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add GET /api/image/list endpoint that reads the binary folder and returns
image files in Jodit filebrowser format. Configure Jodit's built-in file
browser to call this endpoint, allowing users to browse and insert images
that have already been uploaded. Clicking the image toolbar button now
shows both upload and browse-existing options.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add required name and type fields to file objects and source name to
match Jodit 4 filebrowser expected JSON structure. Add process and
isSuccess callbacks to filebrowser ajax config.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Jodit editor now handles image upload via drag-and-drop and the
toolbar image button with file browser. Remove the redundant form-based
upload button, its HandleImageUpload controller method, and the
UploadImageAction constant.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Listen for filebrowser:insertImage event and override default behavior
to insert images wrapped in a figure element, consistent with the
drag-and-drop upload insertion.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@poppastring
poppastring merged commit 5a04cc6 into main Mar 14, 2026
3 checks passed
@poppastring
poppastring deleted the blog-editing-improvements branch March 14, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant