Skip to content

Commit

Permalink
feat(Juggl): ✨ Parse for Juggl links even if Juggl isn't installed
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Aug 14, 2021
1 parent f885c90 commit e1a8f39
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/BreadcrumbsSettingTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,20 @@ export class BreadcrumbsSettingTab extends PluginSettingTab {
})
);

new Setting(generalDetails)
.setName("Use Juggl link syntax without having Juggl installed")
.setDesc(
"Should Breadcrumbs look for [Juggl links](https://juggl.io/Link+Types) even if you don't have Juggl installed? If you do have Juggl installed, it will always look for Juggl links."
)
.addToggle((toggle) =>
toggle
.setValue(plugin.settings.parseJugglLinksWithoutJuggl)
.onChange(async (value) => {
plugin.settings.parseJugglLinksWithoutJuggl = value;
await plugin.saveSettings();
})
);

if (this.app.plugins.plugins.dataview !== undefined) {
new Setting(generalDetails)
.setName("Dataview Wait Time")
Expand Down
1 change: 1 addition & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface BreadcrumbsSettings {
userHierarchies: userHierarchy[];
indexNote: string[];
refreshIndexOnActiveLeafChange: boolean;
parseJugglLinksWithoutJuggl: boolean;
dvWaitTime: number;
refreshIntervalTime: number;
defaultView: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const DEFAULT_SETTINGS: BreadcrumbsSettings = {
userHierarchies: [],
indexNote: [""],
refreshIndexOnActiveLeafChange: false,
parseJugglLinksWithoutJuggl: false,
dvWaitTime: 5000,
refreshIntervalTime: 0,
defaultView: true,
Expand Down
5 changes: 4 additions & 1 deletion src/sharedFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@ export async function getNeighbourObjArr(
const { userHierarchies } = plugin.settings;

let jugglLinks: JugglLink[] = [];
if (plugin.app.plugins.plugins.juggl !== undefined) {
if (
plugin.app.plugins.plugins.juggl !== undefined ||
plugin.settings.parseJugglLinksWithoutJuggl
) {
debug(plugin.settings, "Using Juggl");
jugglLinks = await getJugglLinks(plugin.app, plugin.settings);
debug(plugin.settings, { jugglLinks });
Expand Down

0 comments on commit e1a8f39

Please sign in to comment.