mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Lexical: Added about button/view
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.
This commit is contained in:
29
resources/js/wysiwyg/ui/framework/blocks/external-content.ts
Normal file
29
resources/js/wysiwyg/ui/framework/blocks/external-content.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import {EditorUiElement} from "../core";
|
||||
import {el} from "../../../utils/dom";
|
||||
|
||||
export class ExternalContent extends EditorUiElement {
|
||||
|
||||
/**
|
||||
* The URL for HTML to be loaded from.
|
||||
*/
|
||||
protected url: string = '';
|
||||
|
||||
constructor(url: string) {
|
||||
super();
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
buildDOM(): HTMLElement {
|
||||
const wrapper = el('div', {
|
||||
class: 'editor-external-content',
|
||||
});
|
||||
|
||||
window.$http.get(this.url).then(resp => {
|
||||
if (typeof resp.data === 'string') {
|
||||
wrapper.innerHTML = resp.data;
|
||||
}
|
||||
});
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user