Skip to content

Build your personal knowledge base with Trilium Notes

WIP

zadam653f80f7d848
diff --git a/src/public/app/components/root_command_executor.js b/src/public/app/components/root_command_executor.js
index 57bda8a918..e4001ebb8d 100644
--- a/src/public/app/components/root_command_executor.js
+++ b/src/public/app/components/root_command_executor.js
@@ -85,6 +85,6 @@ export default class RootCommandExecutor extends Component {
}
async showOptionsCommand() {
- await appContext.tabManager.openContextWithNote('options', true, null, 'opt_root')
+ await appContext.tabManager.openContextWithNote('options', true, null, 'options')
}
}
diff --git a/src/services/hidden_subtree.js b/src/services/hidden_subtree.js
index c905cf135e..9326c01469 100644
--- a/src/services/hidden_subtree.js
+++ b/src/services/hidden_subtree.js
@@ -183,17 +183,17 @@ const HIDDEN_SUBTREE_DEFINITION = {
title: 'Options',
type: 'book',
children: [
- { id: 'optionsAppearance', title: 'Appearance', type: 'contentWidget' },
- { id: 'optionsShortcuts', title: 'Shortcuts', type: 'contentWidget' },
- { id: 'optionsTextNotes', title: 'Text Notes', type: 'contentWidget' },
- { id: 'optionsCodeNotes', title: 'Code Notes', type: 'contentWidget' },
- { id: 'optionsImages', title: 'Images', type: 'contentWidget' },
- { id: 'optionsSpellcheck', title: 'Spellcheck', type: 'contentWidget' },
- { id: 'optionsPassword', title: 'Password', type: 'contentWidget' },
- { id: 'optionsEtapi', title: 'ETAPI', type: 'contentWidget' },
- { id: 'optionsBackup', title: 'Backup', type: 'contentWidget' },
- { id: 'optionsSync', title: 'Sync', type: 'contentWidget' },
- { id: 'optionsOther', title: 'Other', type: 'contentWidget' },
+ { id: 'optionsAppearance', title: 'Appearance', type: 'contentWidget', icon: 'bx-layout' },
+ { id: 'optionsShortcuts', title: 'Shortcuts', type: 'contentWidget', icon: 'bxs-keyboard' },
+ { id: 'optionsTextNotes', title: 'Text Notes', type: 'contentWidget', icon: 'bx-text' },
+ { id: 'optionsCodeNotes', title: 'Code Notes', type: 'contentWidget', icon: 'bx-code' },
+ { id: 'optionsImages', title: 'Images', type: 'contentWidget', icon: 'bx-image' },
+ { id: 'optionsSpellcheck', title: 'Spellcheck', type: 'contentWidget', icon: 'bx-check-double' },
+ { id: 'optionsPassword', title: 'Password', type: 'contentWidget', icon: 'bx-lock' },
+ { id: 'optionsEtapi', title: 'ETAPI', type: 'contentWidget', icon: 'bx-extension' },
+ { id: 'optionsBackup', title: 'Backup', type: 'contentWidget', icon: 'bx-data' },
+ { id: 'optionsSync', title: 'Sync', type: 'contentWidget', icon: 'bx-wifi' },
+ { id: 'optionsOther', title: 'Other', type: 'contentWidget', icon: 'bx-dots-horizontal' },
{ id: 'optionsAdvanced', title: 'Advanced', type: 'contentWidget' }
]
}
diff --git a/src/services/import/zip.js b/src/services/import/zip.js
index 2e2c1c7ed9..a2f859a3f0 100644
--- a/src/services/import/zip.js
+++ b/src/services/import/zip.js
@@ -187,7 +187,7 @@ async function importZip(taskContext, fileBuffer, importRootNote) {
title: noteTitle,
content: '',
noteId: noteId,
- type: noteMeta ? noteMeta.type : 'text',
+ type: resolveNoteType(noteMeta.type),
mime: noteMeta ? noteMeta.mime : 'text/html',
prefix: noteMeta ? noteMeta.prefix : '',
isExpanded: noteMeta ? noteMeta.isExpanded : false,
@@ -258,12 +258,14 @@ async function importZip(taskContext, fileBuffer, importRootNote) {
return;
}
- const {type, mime} = noteMeta ? noteMeta : detectFileTypeAndMime(taskContext, filePath);
+ let {type, mime} = noteMeta ? noteMeta : detectFileTypeAndMime(taskContext, filePath);
if (type !== 'file' && type !== 'image') {
content = content.toString("UTF-8");
}
+ type = resolveNoteType(type);
+
if ((noteMeta && noteMeta.format === 'markdown')
|| (!noteMeta && taskContext.data.textImportedAsText && ['text/markdown', 'text/x-markdown'].includes(mime))) {
const parsed = mdReader.parse(content);
@@ -531,6 +533,22 @@ async function importZip(taskContext, fileBuffer, importRootNote) {
return firstNote;
}
+function resolveNoteType(type) {
+ type = type || 'text';
+
+ // BC for ZIPs created in Triliun 0.57 and older
+ if (type === 'relation-map') {
+ type = 'relationMap';
+ } else if (type === 'note-map') {
+ type = 'noteMap';
+ } else if (type === 'web-view') {
+ type = 'webView';
+ }
+
+ return type;
+}
+
+
module.exports = {
importZip
};