mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
added button for entering workspace
This commit is contained in:
parent
1c5425c9eb
commit
2a6978c349
18
package-lock.json
generated
18
package-lock.json
generated
@ -3212,9 +3212,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"electron-to-chromium": {
|
"electron-to-chromium": {
|
||||||
"version": "1.3.607",
|
"version": "1.3.610",
|
||||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.607.tgz",
|
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.610.tgz",
|
||||||
"integrity": "sha512-h2SYNaBnlplGS0YyXl8oJWokfcNxVjJANQfMCsQefG6OSuAuNIeW+A8yGT/ci+xRoBb3k2zq1FrOvkgoKBol8g==",
|
"integrity": "sha512-eFDC+yVQpEhtlapk4CYDPfV9ajF9cEof5TBcO49L1ETO+aYogrKWDmYpZyxBScMNe8Bo/gJamH4amQ4yyvXg4g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"electron-window-state": {
|
"electron-window-state": {
|
||||||
@ -7156,9 +7156,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"terser": {
|
"terser": {
|
||||||
"version": "5.5.0",
|
"version": "5.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/terser/-/terser-5.5.1.tgz",
|
||||||
"integrity": "sha512-eopt1Gf7/AQyPhpygdKePTzaet31TvQxXvrf7xYUvD/d8qkCJm4SKPDzu+GHK5ZaYTn8rvttfqaZc3swK21e5g==",
|
"integrity": "sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"commander": "^2.20.0",
|
"commander": "^2.20.0",
|
||||||
@ -7627,9 +7627,9 @@
|
|||||||
"integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w=="
|
"integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w=="
|
||||||
},
|
},
|
||||||
"webpack": {
|
"webpack": {
|
||||||
"version": "5.8.0",
|
"version": "5.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.9.0.tgz",
|
||||||
"integrity": "sha512-X2yosPiHip3L0TE+ylruzrOqSgEgsdGyBOGFWKYChcwlKChaw9VodZIUovG1oo7s0ss6e3ZxBMn9tXR+nkPThA==",
|
"integrity": "sha512-YnnqIV/uAS5ZrNpctSv378qV7HmbJ74DL+XfvMxzbX1bV9e7eeT6eEWU4wuUw33CNr/HspBh7R/xQlVjTEyAeA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/eslint-scope": "^3.7.0",
|
"@types/eslint-scope": "^3.7.0",
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
"jsdoc": "3.6.6",
|
"jsdoc": "3.6.6",
|
||||||
"lorem-ipsum": "2.0.3",
|
"lorem-ipsum": "2.0.3",
|
||||||
"rcedit": "2.2.0",
|
"rcedit": "2.2.0",
|
||||||
"webpack": "5.8.0",
|
"webpack": "5.9.0",
|
||||||
"webpack-cli": "4.2.0"
|
"webpack-cli": "4.2.0"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
|
@ -90,6 +90,14 @@ export default class Entrypoints extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async hoistNoteCommand({noteId}) {
|
||||||
|
const tabContext = appContext.tabManager.getActiveTabContext();
|
||||||
|
|
||||||
|
if (tabContext.hoistedNoteId !== noteId) {
|
||||||
|
await tabContext.setHoistedNoteId(noteId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async unhoistCommand() {
|
async unhoistCommand() {
|
||||||
const activeTabContext = appContext.tabManager.getActiveTabContext();
|
const activeTabContext = appContext.tabManager.getActiveTabContext();
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ export default class LinkMapWidget extends CollapsibleWidget {
|
|||||||
|
|
||||||
get headerActions() {
|
get headerActions() {
|
||||||
const $showFullButton = $("<a>")
|
const $showFullButton = $("<a>")
|
||||||
.addClass("bx bx-map-alt")
|
.addClass("bx bx-network-chart")
|
||||||
.addClass('widget-header-action')
|
.addClass('widget-header-action')
|
||||||
.attr('title', 'Show full link map');
|
.attr('title', 'Show full link map');
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ export default class WhatLinksHereWidget extends CollapsibleWidget {
|
|||||||
|
|
||||||
get headerActions() {
|
get headerActions() {
|
||||||
const $showFullButton = $("<a>")
|
const $showFullButton = $("<a>")
|
||||||
.addClass("bx bx-map-alt")
|
.addClass("bx bx-network-chart")
|
||||||
.addClass('widget-header-action')
|
.addClass('widget-header-action')
|
||||||
.attr('title', 'Show full link map');
|
.attr('title', 'Show full link map');
|
||||||
|
|
||||||
|
@ -35,20 +35,7 @@ const TPL = `
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding-bottom: 35px;
|
padding-bottom: 35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.refresh-search-button {
|
|
||||||
cursor: pointer;
|
|
||||||
position: relative;
|
|
||||||
top: -1px;
|
|
||||||
border: 1px solid transparent;
|
|
||||||
padding: 2px;
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.refresh-search-button:hover {
|
|
||||||
border-color: var(--button-border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.collapse-tree-button {
|
.collapse-tree-button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
@ -142,17 +129,22 @@ const TPL = `
|
|||||||
span.fancytree-node.archived {
|
span.fancytree-node.archived {
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-note-button {
|
.tree-item-button {
|
||||||
display: none;
|
|
||||||
font-size: 120%;
|
font-size: 120%;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid var(--main-background-color);
|
||||||
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-note-button:hover {
|
.tree-item-button:hover {
|
||||||
border: 1px solid var(--main-border-color);
|
border-color: var(--main-border-color);
|
||||||
border-radius: 3px;
|
}
|
||||||
|
|
||||||
|
.add-note-button {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
span.fancytree-node:hover .add-note-button {
|
span.fancytree-node:hover .add-note-button {
|
||||||
@ -214,6 +206,18 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.$tree.on("click", ".enter-workspace-button", e => {
|
||||||
|
const node = $.ui.fancytree.getNode(e);
|
||||||
|
|
||||||
|
this.triggerCommand('hoistNote', {noteId: node.data.noteId});
|
||||||
|
});
|
||||||
|
|
||||||
|
this.$tree.on("click", ".unhoist-button", e => {
|
||||||
|
const node = $.ui.fancytree.getNode(e);
|
||||||
|
|
||||||
|
this.triggerCommand('unhoist');
|
||||||
|
});
|
||||||
|
|
||||||
// fancytree doesn't support middle click so this is a way to support it
|
// fancytree doesn't support middle click so this is a way to support it
|
||||||
this.$tree.on('mousedown', '.fancytree-title', e => {
|
this.$tree.on('mousedown', '.fancytree-title', e => {
|
||||||
if (e.which === 2) {
|
if (e.which === 2) {
|
||||||
@ -500,14 +504,20 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
|||||||
|
|
||||||
const note = await treeCache.getNote(node.data.noteId);
|
const note = await treeCache.getNote(node.data.noteId);
|
||||||
|
|
||||||
|
if (note.hasLabel('workspace')) {
|
||||||
|
const $enterWorkspaceButton = $('<span class="tree-item-button enter-workspace-button bx bx-door-open" title="Hoist this note (workspace)"></span>');
|
||||||
|
|
||||||
|
$span.append($enterWorkspaceButton);
|
||||||
|
}
|
||||||
|
|
||||||
if (note.type === 'search') {
|
if (note.type === 'search') {
|
||||||
const $refreshSearchButton = $('<span> <span class="refresh-search-button bx bx-refresh" title="Refresh saved search results"></span></span>');
|
const $refreshSearchButton = $('<span class="tree-item-button refresh-search-button bx bx-refresh" title="Refresh saved search results"></span>');
|
||||||
|
|
||||||
$span.append($refreshSearchButton);
|
$span.append($refreshSearchButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (note.type !== 'search') {
|
if (note.type !== 'search') {
|
||||||
const $createChildNoteButton = $('<span> <span class="add-note-button bx bx-plus" title="Create child note"></span></span>');
|
const $createChildNoteButton = $('<span class="tree-item-button add-note-button bx bx-plus" title="Create child note"></span>');
|
||||||
|
|
||||||
$span.append($createChildNoteButton);
|
$span.append($createChildNoteButton);
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,9 @@ const BUILTIN_ATTRIBUTES = [
|
|||||||
{ type: 'label', name: 'noteRevisionsWidgetDisabled' },
|
{ type: 'label', name: 'noteRevisionsWidgetDisabled' },
|
||||||
{ type: 'label', name: 'whatLinksHereWidgetDisabled' },
|
{ type: 'label', name: 'whatLinksHereWidgetDisabled' },
|
||||||
{ type: 'label', name: 'similarNotesWidgetDisabled' },
|
{ type: 'label', name: 'similarNotesWidgetDisabled' },
|
||||||
|
{ type: 'label', name: 'workspace' },
|
||||||
|
{ type: 'label', name: 'workspaceIconClass' },
|
||||||
|
{ type: 'label', name: 'workspaceTabBackgroundColor' },
|
||||||
|
|
||||||
// relation names
|
// relation names
|
||||||
{ type: 'relation', name: 'runOnNoteCreation', isDangerous: true },
|
{ type: 'relation', name: 'runOnNoteCreation', isDangerous: true },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user