mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
client: Create blank type widget for mind map
This commit is contained in:
parent
945bc7ded3
commit
e39dd1525d
@ -22,7 +22,8 @@ const NOTE_TYPE_ICONS = {
|
||||
"webView": "bx bx-globe-alt",
|
||||
"launcher": "bx bx-link",
|
||||
"doc": "bx bxs-file-doc",
|
||||
"contentWidget": "bx bxs-widget"
|
||||
"contentWidget": "bx bxs-widget",
|
||||
"mindMap": "bx bx-sitemap"
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -13,6 +13,7 @@ async function getNoteTypeItems(command) {
|
||||
{ title: "Mermaid Diagram", command: command, type: "mermaid", uiIcon: "bx bx-selection" },
|
||||
{ title: "Canvas", command: command, type: "canvas", uiIcon: "bx bx-pen" },
|
||||
{ title: "Web View", command: command, type: "webView", uiIcon: "bx bx-globe-alt" },
|
||||
{ title: "Mind Map", command, type: "mindMap", uiIcon: "bx bx-sitemap" }
|
||||
];
|
||||
|
||||
const templateNoteIds = await server.get("search-templates");
|
||||
|
@ -28,6 +28,7 @@ import DocTypeWidget from "./type_widgets/doc.js";
|
||||
import ContentWidgetTypeWidget from "./type_widgets/content_widget.js";
|
||||
import AttachmentListTypeWidget from "./type_widgets/attachment_list.js";
|
||||
import AttachmentDetailTypeWidget from "./type_widgets/attachment_detail.js";
|
||||
import MindMapWidget from "./type_widgets/mind_map.js";
|
||||
|
||||
const TPL = `
|
||||
<div class="note-detail">
|
||||
@ -63,7 +64,8 @@ const typeWidgetClasses = {
|
||||
'doc': DocTypeWidget,
|
||||
'contentWidget': ContentWidgetTypeWidget,
|
||||
'attachmentDetail': AttachmentDetailTypeWidget,
|
||||
'attachmentList': AttachmentListTypeWidget
|
||||
'attachmentList': AttachmentListTypeWidget,
|
||||
'mindMap': MindMapWidget
|
||||
};
|
||||
|
||||
export default class NoteDetailWidget extends NoteContextAwareWidget {
|
||||
|
31
src/public/app/widgets/type_widgets/mind_map.js
Normal file
31
src/public/app/widgets/type_widgets/mind_map.js
Normal file
@ -0,0 +1,31 @@
|
||||
import TypeWidget from "./type_widget.js";
|
||||
|
||||
const TPL = `
|
||||
<div class="note-detail-mind-map note-detail-printable">
|
||||
</div>
|
||||
`;
|
||||
|
||||
export default class MindMapWidget extends TypeWidget {
|
||||
static getType() { return "mindMap"; }
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
|
||||
super.doRender();
|
||||
}
|
||||
|
||||
async doRefresh(note) {
|
||||
this.$widget.html("<p>Hello</p>");
|
||||
this.$widget.show();
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
this.$widget.empty();
|
||||
}
|
||||
|
||||
async entitiesReloadedEvent({loadResults}) {
|
||||
if (loadResults.isNoteReloaded(this.noteId)) {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
}
|
@ -13,7 +13,8 @@ const noteTypes = [
|
||||
{ type: 'webView', defaultMime: '' },
|
||||
{ type: 'launcher', defaultMime: '' },
|
||||
{ type: 'doc', defaultMime: '' },
|
||||
{ type: 'contentWidget', defaultMime: '' }
|
||||
{ type: 'contentWidget', defaultMime: '' },
|
||||
{ type: 'mindMap', defaultMime: 'application/json' }
|
||||
];
|
||||
|
||||
function getDefaultMimeForNoteType(typeName: string) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user