mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-29 12:16:04 +08:00
35 lines
796 B
JavaScript
35 lines
796 B
JavaScript
import {Component} from './component';
|
|
|
|
export class WysiwygEditor extends Component {
|
|
|
|
setup() {
|
|
this.elem = this.$el;
|
|
this.editArea = this.$refs.editArea;
|
|
|
|
window.importVersioned('wysiwyg').then(wysiwyg => {
|
|
wysiwyg.createPageEditorInstance(this.editArea);
|
|
});
|
|
}
|
|
|
|
getDrawIoUrl() {
|
|
const drawioUrlElem = document.querySelector('[drawio-url]');
|
|
if (drawioUrlElem) {
|
|
return drawioUrlElem.getAttribute('drawio-url');
|
|
}
|
|
return '';
|
|
}
|
|
|
|
/**
|
|
* Get the content of this editor.
|
|
* Used by the parent page editor component.
|
|
* @return {{html: String}}
|
|
*/
|
|
getContent() {
|
|
// TODO - Update
|
|
return {
|
|
html: this.editor.getContent(),
|
|
};
|
|
}
|
|
|
|
}
|