mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-03-05 08:50:12 +08:00
18 lines
550 B
TypeScript
18 lines
550 B
TypeScript
![]() |
import {EditorFormDefinition} from "../../framework/forms";
|
||
|
import {EditorUiContext} from "../../framework/core";
|
||
|
import {setEditorContentFromHtml} from "../../../actions";
|
||
|
|
||
|
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',
|
||
|
},
|
||
|
],
|
||
|
};
|