mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-01-20 20:19:33 -06:00
basic infrastructure for "relation map" note type
This commit is contained in:
@@ -15,6 +15,7 @@ import noteDetailText from './note_detail_text.js';
|
||||
import noteDetailFile from './note_detail_file.js';
|
||||
import noteDetailSearch from './note_detail_search.js';
|
||||
import noteDetailRender from './note_detail_render.js';
|
||||
import noteDetailRelationMap from './note_detail_relation_map.js';
|
||||
import bundleService from "./bundle.js";
|
||||
import noteAutocompleteService from "./note_autocomplete.js";
|
||||
|
||||
@@ -45,7 +46,8 @@ const components = {
|
||||
'text': noteDetailText,
|
||||
'file': noteDetailFile,
|
||||
'search': noteDetailSearch,
|
||||
'render': noteDetailRender
|
||||
'render': noteDetailRender,
|
||||
'relation-map': noteDetailRelationMap
|
||||
};
|
||||
|
||||
function getComponent(type) {
|
||||
|
||||
15
src/public/javascripts/services/note_detail_relation_map.js
Normal file
15
src/public/javascripts/services/note_detail_relation_map.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import server from "./server.js";
|
||||
import noteDetailService from "./note_detail.js";
|
||||
|
||||
const $noteDetailRelationMap = $("#note-detail-relation-map");
|
||||
|
||||
async function render() {
|
||||
$noteDetailRelationMap.show();
|
||||
}
|
||||
|
||||
export default {
|
||||
show: render,
|
||||
getContent: () => "",
|
||||
focus: () => null,
|
||||
onNoteChange: () => null
|
||||
}
|
||||
@@ -77,6 +77,9 @@ function NoteTypeModel() {
|
||||
else if (type === 'file') {
|
||||
return 'File';
|
||||
}
|
||||
else if (type === 'relation-map') {
|
||||
return 'Relation Map';
|
||||
}
|
||||
else if (type === 'search') {
|
||||
// ignore and do nothing, "type" will be hidden since it's not possible to switch to and from search
|
||||
}
|
||||
@@ -118,6 +121,13 @@ function NoteTypeModel() {
|
||||
save();
|
||||
};
|
||||
|
||||
this.selectRelationMap = function() {
|
||||
self.type('relation-map');
|
||||
self.mime('application/json');
|
||||
|
||||
save();
|
||||
};
|
||||
|
||||
this.selectCode = function() {
|
||||
self.type('code');
|
||||
self.mime('');
|
||||
|
||||
Reference in New Issue
Block a user