From f8bdde10a37e7a5968abf6cfc6f720fabb547604 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 18 Aug 2023 10:13:57 +0200 Subject: [PATCH] display full path in view if required --- src/view.ts | 4 +++- styles.css | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/view.ts b/src/view.ts index d7711cc..95c6837 100644 --- a/src/view.ts +++ b/src/view.ts @@ -19,7 +19,9 @@ export class JSPView extends ItemView { for (let shared of this.plugin.settings.shared) { let file = this.plugin.app.vault.getAbstractFileByPath(shared.path) as TFile; let div = content.createDiv({cls: "just-share-please-shared-item"}); - div.createSpan({cls: "just-share-please-shared-name", text: removeExtension(shared.path)}); + div.createSpan({cls: "just-share-please-shared-name", text: removeExtension(shared.path).split(/[/\\]/g).pop()}); + if (file?.path.match(/[/\\]/)) + div.createSpan({cls: "just-share-please-shared-path", text: removeExtension(file.path)}); new ButtonComponent(div) .setClass("clickable-icon") .setTooltip("Copy JSP link") diff --git a/styles.css b/styles.css index f7b5435..5d8c9c8 100644 --- a/styles.css +++ b/styles.css @@ -14,6 +14,12 @@ padding-bottom: 5px; } +.just-share-please-shared-path { + display: block; + padding-bottom: 5px; + font-size: 13px; +} + .just-share-please-shared-item { margin-bottom: 20px; }