mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-01-10 11:07:36 +00:00
ebe2ca7faf
Re-used existing route and moved tinymce help to its own different route. Added test to cover. Added new external-content block to support in editor UI.
33 lines
No EOL
924 B
TypeScript
33 lines
No EOL
924 B
TypeScript
import {EditorFormDefinition} from "../../framework/forms";
|
|
import {EditorUiContext, EditorUiElement} from "../../framework/core";
|
|
import {setEditorContentFromHtml} from "../../../utils/actions";
|
|
import {ExternalContent} from "../../framework/blocks/external-content";
|
|
|
|
export const source: EditorFormDefinition = {
|
|
submitText: 'Save',
|
|
async action(formData, context: EditorUiContext) {
|
|
setEditorContentFromHtml(context.editor, formData.get('source')?.toString() || '');
|
|
return true;
|
|
},
|
|
fields: [
|
|
{
|
|
label: 'Source',
|
|
name: 'source',
|
|
type: 'textarea',
|
|
},
|
|
],
|
|
};
|
|
|
|
export const about: EditorFormDefinition = {
|
|
submitText: 'Close',
|
|
async action() {
|
|
return true;
|
|
},
|
|
fields: [
|
|
{
|
|
build(): EditorUiElement {
|
|
return new ExternalContent('/help/wysiwyg');
|
|
}
|
|
}
|
|
],
|
|
}; |