mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
copied links from tree should be reference links
This commit is contained in:
parent
c4ab6b4866
commit
e079359c15
@ -82,7 +82,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"electron": "16.0.3",
|
"electron": "16.0.4",
|
||||||
"@electron/remote": "2.0.1",
|
"@electron/remote": "2.0.1",
|
||||||
"electron-builder": "22.14.5",
|
"electron-builder": "22.14.5",
|
||||||
"electron-packager": "15.4.0",
|
"electron-packager": "15.4.0",
|
||||||
|
@ -66,11 +66,12 @@ async function copy(branchIds) {
|
|||||||
clipboardMode = 'copy';
|
clipboardMode = 'copy';
|
||||||
|
|
||||||
if (utils.isElectron()) {
|
if (utils.isElectron()) {
|
||||||
|
// https://github.com/zadam/trilium/issues/2401
|
||||||
const {clipboard} = require('electron');
|
const {clipboard} = require('electron');
|
||||||
const links = [];
|
const links = [];
|
||||||
|
|
||||||
for (const branch of froca.getBranches(clipboardBranchIds)) {
|
for (const branch of froca.getBranches(clipboardBranchIds)) {
|
||||||
const $link = await linkService.createNoteLink(branch.parentNoteId + '/' + branch.noteId);
|
const $link = await linkService.createNoteLink(branch.parentNoteId + '/' + branch.noteId, { referenceLink: true });
|
||||||
links.push($link[0].outerHTML);
|
links.push($link[0].outerHTML);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ async function createNoteLink(notePath, options = {}) {
|
|||||||
const showTooltip = options.showTooltip === undefined ? true : options.showTooltip;
|
const showTooltip = options.showTooltip === undefined ? true : options.showTooltip;
|
||||||
const showNotePath = options.showNotePath === undefined ? false : options.showNotePath;
|
const showNotePath = options.showNotePath === undefined ? false : options.showNotePath;
|
||||||
const showNoteIcon = options.showNoteIcon === undefined ? false : options.showNoteIcon;
|
const showNoteIcon = options.showNoteIcon === undefined ? false : options.showNoteIcon;
|
||||||
|
const referenceLink = options.referenceLink === undefined ? false : options.referenceLink;
|
||||||
|
|
||||||
const {noteId, parentNoteId} = treeService.getNoteIdAndParentIdFromNotePath(notePath);
|
const {noteId, parentNoteId} = treeService.getNoteIdAndParentIdFromNotePath(notePath);
|
||||||
|
|
||||||
@ -48,6 +49,10 @@ async function createNoteLink(notePath, options = {}) {
|
|||||||
$noteLink.addClass("no-tooltip-preview");
|
$noteLink.addClass("no-tooltip-preview");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (referenceLink) {
|
||||||
|
$noteLink.addClass("reference-link");
|
||||||
|
}
|
||||||
|
|
||||||
$container.append($noteLink);
|
$container.append($noteLink);
|
||||||
|
|
||||||
if (showNotePath) {
|
if (showNotePath) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user