Skip to content

Commit

Permalink
Merge pull request #22 from iiz00/develop
Browse files Browse the repository at this point in the history
Support for canvas and List Callouts, other improvements
  • Loading branch information
iiz00 committed Mar 4, 2024
2 parents 37d0c91 + 8095f0f commit 618fe65
Show file tree
Hide file tree
Showing 14 changed files with 396 additions and 128 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,21 @@ If you like my plugin, I would appreciate it if you could buy me a cup of coffee
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/iiz00)<br><br>

## Changelog
- 0.5.0
- New function
- Canvas support
- When a canvas file is selected, notes in the canvas file are displayed as link elements and cards are displayed as list itmes in the outline. So when a canvas file is selected as the main target file in File view, the outlines of notes in the canvas file can also be displayed at once.
- Support for List Callouts plugin
- List items marked by List Callouts plugin by @mgmeyers are displayed with coloring.
- Improvements
- Increased the maximum width of tooltip preview
- Embedded links are now treated as link outline elements
- Added setting to hide outgoing links in outgoing link files section and backlinks in backlink files section (Settings -> File View -> Hide minor 2 hop links)
- You can now specify whether to save the history sequentially (Settings -> Recent/favorites -> Save recent view).
- Turning this off may cause some history to be lost when Obsidian exits, but will reduce the frequency of data.json rewrites.
- View history is now synchronized across devices. This requires Obsidian v1.5.8 or later.
- Changed
- Setting changes made by clicking UI icons (headings, links, list items, and backlinks) are now not saved sequentially. This reduces the frequency of data.json rewriting, although some of the history of these changes may be lost when Obsidian exits. If you switch settings from the settings screen, the settings are saved each time.
- 0.4.0
- Improvements
- You can now choose whether to open the location of the element or the linked file when you click on a link element.
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "multiple-notes-outline",
"name": "Multiple Notes Outline",
"version": "0.4.0",
"minAppVersion": "1.3.0",
"version": "0.5.0",
"minAppVersion": "1.5.8",
"description": "Add custom views which show outlines of multiple notes with headings, links, tags and list items.",
"author": "iiz",
"authorUrl": "https://github.com/iiz00",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "multiple-notes-outline",
"version": "0.4.0",
"version": "0.5.0",
"description": "Add custom views which shows outline of multiple notes at once",
"main": "main.js",
"scripts": {
Expand Down
13 changes: 9 additions & 4 deletions src/FavAndRecent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@ export async function updateFavAndRecent(targetPath: string, category: 'file'|'f
this.settings.recent[category].pop();
}
}
await this.plugin.saveSettings();
if (this.settings.saveRecentView || this.suggestType =='favorite'){
await this.plugin.saveSettings();
}
}

export async function deleteFavAndRecent(targetPath: string, category: 'file'|'folder', suggestType: 'recent'|'favorite'):Promise<void> {
this.settings[suggestType][category] = this.settings[suggestType][category].filter(
(value: string) => targetPath !== value
);

await this.plugin.saveSettings();
if (this.settings.saveRecentView || this.suggestType =='favorite'){
await this.plugin.saveSettings();
}
}

export class ModalJump extends SuggestModal<string>{
Expand Down Expand Up @@ -89,7 +92,9 @@ export class ModalJump extends SuggestModal<string>{

async onChooseSuggestion(item: string, evt: MouseEvent | KeyboardEvent) {
updateFavAndRecent.call(this.view, item, this.category, this.suggestType);
await this.view.plugin.saveSettings();
if (this.view.settings.saveRecentView || this.suggestType == 'favorite'){
await this.view.plugin.saveSettings();
}
this.onSubmit(item);

}
Expand Down

0 comments on commit 618fe65

Please sign in to comment.