Skip to content

Commit

Permalink
Support for file properties links
Browse files Browse the repository at this point in the history
  • Loading branch information
HEmile committed Jul 15, 2023
1 parent e5f28fc commit e3b80d8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export default class SuperchargedLinks extends Plugin {
plugin.registerViewType('starred', plugin, '.nav-file-title-content');
plugin.registerViewType('file-explorer', plugin, '.nav-file-title-content');
plugin.registerViewType('recent-files', plugin, '.nav-file-title-content');
plugin.registerViewType('file-properties', plugin, 'div.internal-link > .multi-select-pill-content');
plugin.registerViewType('bookmarks', plugin, '.tree-item-inner');
// If backlinks in editor is on
// @ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "supercharged-links-obsidian",
"name": "Supercharged Links",
"version": "0.9.7",
"minAppVersion": "0.16.0",
"minAppVersion": "1.4.0",
"description": "Add properties and menu options to links and style them!",
"author": "mdelobelle & Emile",
"authorUrl": "https://github.com/mdelobelle/mdelobelle/tree/main",
Expand Down
10 changes: 10 additions & 0 deletions src/linkAttributes/linkAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ export function updateVisibleLinks(app: App, plugin: SuperchargedLinks) {
const file: TFile = leaf.view.file;
const cachedFile = app.metadataCache.getFileCache(file);

// @ts-ignore
const metadata = leaf.view?.metadataEditor.contentEl;
if (!!metadata) {//
const nodes = metadata.querySelectorAll("div.internal-link > .multi-select-pill-content");
for (let i = 0; i < nodes.length; ++i) {
const el = nodes[i] as HTMLElement;
updateDivExtraAttributes(plugin.app, plugin.settings, el, "");
}
}

//@ts-ignore
const tabHeader: HTMLElement = leaf.tabHeaderInnerTitleEl;
if (settings.enableTabHeader) {
Expand Down

0 comments on commit e3b80d8

Please sign in to comment.