From 88506531339d5a79273c115b014a37b56014b00d Mon Sep 17 00:00:00 2001 From: Tom Norris Date: Tue, 12 Sep 2023 19:26:53 -0700 Subject: [PATCH] - Don't suggest tags allready on image - Don't resize for small resize increases - Don't redraw for resizes unless there is column shifting - New optional setting for max image height - Fix for meta file not immediately being available for edit after inital creation --- README.md | 14 ++--- src/DisplayObjects/GalleryInfo.ts | 3 +- src/DisplayObjects/ImageGrid.ts | 78 +++++++++++++++++++----- src/DisplayObjects/SuggestionDropdown.ts | 6 ++ src/block.ts | 6 +- src/settings.ts | 57 ++++++++++++++--- src/utils.ts | 13 +++- src/view.ts | 28 +++------ 8 files changed, 152 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index a841d45..9a7196c 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,12 @@ # Release Notes +## 1.0.0 RC1 + - Fuzzy search auto completer field added to tag block + - tag block has Xs to delete tags + - Fixed refresh bug in main gallery view + - some CICD work to make builds run smoother that was not smooth to set up + ## 0.8.1 - Added button to copy current main gallery filter in a format that can be pasted in a note to generate a block gallery - Added another button to paste the same information back in as a filter to use in the gallery @@ -48,10 +54,4 @@ ## v0.7.1 - Fixing critical bug with meta file templates - Improves display of gallery filter on mobile - - Image info blocks now try to resolve the image if the path has changed, and provides some info if it fails - -## v0.7.0 -- Total image count now only count file the gallery thinks it can display in the first place -- More large gallery optimization -- Added a setting for default hidden info -- Added the option to set your own template file for the meta files \ No newline at end of file + - Image info blocks now try to resolve the image if the path has changed, and provides some info if it fails \ No newline at end of file diff --git a/src/DisplayObjects/GalleryInfo.ts b/src/DisplayObjects/GalleryInfo.ts index 9ad8446..c22cb93 100644 --- a/src/DisplayObjects/GalleryInfo.ts +++ b/src/DisplayObjects/GalleryInfo.ts @@ -150,7 +150,7 @@ export class GalleryInfo const newTagEl = currentVal.createEl("input", {cls: "new-tag-input"}); newTagEl.name = "new-tag"; newTagEl.placeholder = "New Tag"; - new SuggestionDropdown(newTagEl, () =>{ + const suggetions = new SuggestionDropdown(newTagEl, () =>{ const files = this.plugin.app.vault.getMarkdownFiles(); const allTags: string[] = [] for(let i = 0; i < files.length; i++) @@ -192,6 +192,7 @@ export class GalleryInfo (document.querySelector("input[name='new-tag']") as HTMLInputElement).focus(); }); }); + suggetions.ignoreList = this.tagList; } if(!this.infoList.contains("backlinks")) diff --git a/src/DisplayObjects/ImageGrid.ts b/src/DisplayObjects/ImageGrid.ts index 494770d..7e537ee 100644 --- a/src/DisplayObjects/ImageGrid.ts +++ b/src/DisplayObjects/ImageGrid.ts @@ -17,12 +17,15 @@ export class ImageGrid exclusive: boolean = false reverse : boolean = false maxWidth : number + maxHeight : number imgResources!: ImageResources imgList: string[] = [] totalCount: number = 0 #tempImg: string - #columnCount: number + #redraw: boolean + #oldWidth: number = 0 + #columnEls: HTMLDivElement[] = [] constructor(parent: HTMLElement, plugin: GalleryTagsPlugin) { @@ -30,14 +33,24 @@ export class ImageGrid this.parent = parent; this.path = this.plugin.settings.galleryLoadPath; this.maxWidth = this.plugin.settings.width; + if(this.plugin.settings.useMaxHeight) + { + this.maxHeight = this.plugin.settings.maxHeight; + } this.#tempImg = "data:image/gif;base64,R0lGODlhQABAAPeUMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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ged(): boolean { - const newColumnCount = Math.ceil(this.parent.innerWidth/this.maxWidth); + const columnCount = Math.ceil(this.parent.offsetWidth/this.maxWidth); + const result = columnCount != this.#columnEls.length; + + if(result) + { + this.#redraw = true; + } - return this.#columnCount != newColumnCount; + return result; } async updateData() @@ -56,28 +69,48 @@ export class ImageGrid { this.imgList = this.imgList.reverse() } + + this.#redraw = true; } updateDisplay() { - if(this.parent.innerWidth <= 0) + if(this.parent.offsetWidth <= 0) + { + return; + } + + if(!this.#redraw + && this.parent.offsetWidth >= this.#oldWidth + && this.parent.offsetWidth - this.#oldWidth < 20) + { + return; + } + + this.#oldWidth = this.parent.offsetWidth; + + if(!this.#redraw && !this.haveColumnsChanged()) { + this.#resize(); return; } + + this.parent.empty(); + this.#columnEls = []; - this.#columnCount = Math.ceil(this.parent.innerWidth/this.maxWidth); - const columnWidth = (this.parent.innerWidth-15)/this.#columnCount; - const columnEls: HTMLDivElement[] = []; + const columnCount = Math.ceil(this.parent.offsetWidth/this.maxWidth); + const columnWidth = (this.parent.offsetWidth-55)/columnCount; - for(let col = 0; col < this.#columnCount; col++) + for(let col = 0; col < columnCount; col++) { - columnEls.push(this.parent.createDiv({ cls: 'gallery-grid-column' })); + this.#columnEls.push(this.parent.createDiv({ cls: 'gallery-grid-column' })); + this.#columnEls[col].style.width = columnWidth+"px"; } let index = 0; while(index < this.imgList.length) { - for(let col = 0; col < this.#columnCount; col++) + for(let col = 0; col < this.#columnEls.length; col++) { if(index >= this.imgList.length) { @@ -89,26 +122,43 @@ export class ImageGrid if(source.match(VIDEO_REGEX)) { - const vid = columnEls[col].createEl("video"); + const vid = this.#columnEls[col].createEl("video"); vid.src = source; vid.classList.add("gallery-grid-vid"); vid.controls = true; - vid.width = columnWidth; + if(this.maxHeight > 10) + { + vid.style.maxHeight = this.maxHeight+"px"; + } } else { - const img = columnEls[col].createEl("img"); + const img = this.#columnEls[col].createEl("img"); img.src = this.#tempImg; img.classList.add("gallery-grid-img"); img.classList.add("lazy"); img.loading = "lazy"; img.alt = "testing alt text"; img.dataset.src = source; - img.width = columnWidth; + if(this.maxHeight > 10) + { + img.style.maxHeight = this.maxHeight+"px"; + } } } } + this.#redraw = false; setLazyLoading(); } + + #resize() + { + const columnWidth = (this.parent.offsetWidth-55)/this.#columnEls.length; + + for(let col = 0; col < this.#columnEls.length; col++) + { + this.#columnEls[col].style.width = columnWidth+"px"; + } + } } \ No newline at end of file diff --git a/src/DisplayObjects/SuggestionDropdown.ts b/src/DisplayObjects/SuggestionDropdown.ts index 558fc50..61015be 100644 --- a/src/DisplayObjects/SuggestionDropdown.ts +++ b/src/DisplayObjects/SuggestionDropdown.ts @@ -4,6 +4,7 @@ export class SuggestionDropdown { target: HTMLInputElement showOnClick: boolean = true + ignoreList: string[] onGetItems: () => string[] onSubmit: (submission: string) => void onEmptyBackspace: () => void @@ -167,6 +168,11 @@ export class SuggestionDropdown const matches: [string,number][] = [] for (let i = 1; i < items.length; i++) { + if(this.ignoreList.contains(items[i])) + { + continue; + } + const result = fuzzySearch({fuzzy: input.split(""), query: input, tokens: input.split(" ") }, items[i]); if(result) { diff --git a/src/block.ts b/src/block.ts index 2ae21d7..5fbd914 100644 --- a/src/block.ts +++ b/src/block.ts @@ -25,6 +25,7 @@ export class GalleryProcessor exclusive: 'false', matchCase: 'false', imgWidth: 200, + imgHeight: 0, divWidth: 100, divAlign: 'left', reverseOrder: 'false', @@ -60,6 +61,10 @@ export class GalleryProcessor imageGrid.tag = args.tags; imageGrid.reverse = args.reverseOrder === 'true'; imageGrid.maxWidth = args.imgWidth; + if(args.imgHeight > 10) + { + imageGrid.maxHeight = args.imgHeight; + } imageGrid.exclusive = args.exclusive === 'true'; imageGrid.matchCase = args.matchCase === 'true'; imageGrid.reverse = args.reverseOrder === 'true'; @@ -75,7 +80,6 @@ export class GalleryProcessor imageGrid.updateDisplay(); plugin.onResize = () => { - imagesContainer.empty(); imageGrid.updateDisplay(); } diff --git a/src/settings.ts b/src/settings.ts index 3a14f7f..69b76dd 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -45,17 +45,17 @@ export class GallerySettingTab extends PluginSettingTab // Gallery search bar new Setting(containerEl) - .setName('Filter starts open in main gallery') - .setDesc('Toggle this option to have the filter header start open.') - .addToggle((toggle) => - { - toggle.setValue(this.plugin.settings.filterStartOpen) - toggle.onChange(async (value) => + .setName('Filter starts open in main gallery') + .setDesc('Toggle this option to have the filter header start open.') + .addToggle((toggle) => { - this.plugin.settings.filterStartOpen = value - await this.plugin.saveSettings() - }); - }) + toggle.setValue(this.plugin.settings.filterStartOpen) + toggle.onChange(async (value) => + { + this.plugin.settings.filterStartOpen = value + await this.plugin.saveSettings() + }); + }) // Default image width new Setting(containerEl) @@ -74,6 +74,43 @@ export class GallerySettingTab extends PluginSettingTab this.plugin.settings.width = Math.abs(numValue) await this.plugin.saveSettings() })) + + + // Use max height? + new Setting(containerEl) + .setName('Use max image height') + .setDesc('Toggle this option to set a max image height for images to display in collumns.') + .addToggle((toggle) => + { + toggle.setValue(this.plugin.settings.useMaxHeight) + toggle.onChange(async (value) => + { + this.plugin.settings.useMaxHeight = value; + await this.plugin.saveSettings(); + this.display(); + }); + }) + + // Max image height + if(this.plugin.settings.useMaxHeight) + { + new Setting(containerEl) + .setName('Max image height') + .setDesc('Max image height in `pixels` for images to display in collumns.') + .addText(text => text + .setPlaceholder(`${this.plugin.settings.maxHeight}`) + .onChange(async (value) => + { + const numValue = parseInt(value) + if (isNaN(numValue)) + { + return; + } + + this.plugin.settings.maxHeight = Math.abs(numValue) + await this.plugin.saveSettings() + })) + } // Hidden meta fields new Setting(containerEl) diff --git a/src/utils.ts b/src/utils.ts index 8598c58..4ee5023 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -8,6 +8,8 @@ export interface GallerySettings galleryLoadPath: string imgmetaTemplatePath: string | null width: number + useMaxHeight: boolean + maxHeight: number hiddenInfo: string | null filterStartOpen: boolean } @@ -29,6 +31,7 @@ export interface GalleryBlockArgs exclusive: string matchCase: string imgWidth: number + imgHeight: number divWidth: number divAlign: string reverseOrder: string @@ -46,6 +49,8 @@ export const SETTINGS: GallerySettings = { galleryLoadPath: '/', imgmetaTemplatePath: null, width: 400, + useMaxHeight: false, + maxHeight: 400, hiddenInfo: "tags;palette", filterStartOpen: false } @@ -214,9 +219,13 @@ export const getImgInfo = async (imgPath: string, vault: Vault, metadata: Metada template = await plugin.app.vault.read(templateTFile); } - infoFile = await vault.create(normalizePath(`${plugin.settings.imgDataFolder}/${fileName}.md`), initializeInfo(template, imgPath, imgName)); + const filepath = normalizePath(`${plugin.settings.imgDataFolder}/${fileName}.md`); + await vault.create(filepath, initializeInfo(template, imgPath, imgName)); + // TODO: this waits a moment for the metadatacache to catch up with the new backlinks, but boy does it feel gross. Need to find out if there's another way to do this + await new Promise(f => setTimeout(f, 50)); + infoFile = plugin.app.vault.getAbstractFileByPath(filepath) as TFile } - return infoFile + return infoFile } // Specified Resources folder does not exist diff --git a/src/view.ts b/src/view.ts index 052cb51..4f3d327 100644 --- a/src/view.ts +++ b/src/view.ts @@ -30,7 +30,6 @@ export class GalleryView extends ItemView super(leaf) this.plugin = plugin - this.updateDisplay = this.updateDisplay.bind(this) // Get View Container Element this.headerEl = this.containerEl.querySelector('.view-header') // Get View Container Element @@ -109,7 +108,7 @@ export class GalleryView extends ItemView { this.imageGrid.path = pathFilterEl.value.trim(); await this.updateData(); - this.updateDisplay(); + this.imageGrid.updateDisplay(); }); // Filter by Name @@ -123,7 +122,7 @@ export class GalleryView extends ItemView { this.imageGrid.name = nameFilterEl.value.trim(); await this.updateData(); - this.updateDisplay(); + this.imageGrid.updateDisplay(); }); // Should display order be reversed @@ -146,7 +145,7 @@ export class GalleryView extends ItemView { this.imageGrid.reverse = sortReverseEl.checked; await this.updateData(); - this.updateDisplay(); + this.imageGrid.updateDisplay(); }); // file filter counts @@ -165,7 +164,7 @@ export class GalleryView extends ItemView { this.imageGrid.tag = tagFilterEl.value.trim(); await this.updateData(); - this.updateDisplay(); + this.imageGrid.updateDisplay(); }); // Filter Match Case @@ -188,7 +187,7 @@ export class GalleryView extends ItemView { this.imageGrid.matchCase = matchFilterEl.checked; await this.updateData(); - this.updateDisplay(); + this.imageGrid.updateDisplay(); }); // Filter Exclusive or inclusive @@ -211,7 +210,7 @@ export class GalleryView extends ItemView { this.imageGrid.exclusive = exclusiveFilterEl.checked; await this.updateData(); - this.updateDisplay(); + this.imageGrid.updateDisplay(); }); // image width scaler @@ -230,7 +229,7 @@ export class GalleryView extends ItemView this.imageGrid.maxWidth = parseInt(this.widthScaleEl.value); if(this.imageGrid.haveColumnsChanged()) { - this.updateDisplay(); + this.imageGrid.updateDisplay(); } }); @@ -307,7 +306,7 @@ export class GalleryView extends ItemView } await this.updateData(); - this.updateDisplay(); + this.imageGrid.updateDisplay(); }); } } @@ -319,13 +318,6 @@ export class GalleryView extends ItemView this.countEl.setText(this.imageGrid.imgList.length+"/"+this.imageGrid.totalCount); } - updateDisplay() - { - this.imagesContainer.empty() - - this.imageGrid.updateDisplay(); - } - getViewType(): string { return OB_GALLERY @@ -344,7 +336,7 @@ export class GalleryView extends ItemView onResize(): void { this.widthScaleEl.max = (this.imagesContainer.innerWidth+50)+""; - this.updateDisplay(); + this.imageGrid.updateDisplay(); } async onClose(): Promise @@ -367,7 +359,7 @@ export class GalleryView extends ItemView this.imageGrid.exclusive = false; this.imageGrid.reverse = false; await this.updateData(); - this.updateDisplay(); + this.imageGrid.updateDisplay(); // Open Info panel const workspace = this.app.workspace