From 439bb6f1460c8d658df5780795bef10593bce5f3 Mon Sep 17 00:00:00 2001 From: Devon22 Date: Sat, 30 Aug 2025 01:59:51 +0800 Subject: [PATCH] 2.9.14 --- manifest.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/main.ts | 13 +++++++++---- styles.css | 1 - versions.json | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/manifest.json b/manifest.json index 6c92e64..5dca73f 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "gridexplorer", "name": "GridExplorer", - "version": "2.9.13", + "version": "2.9.14", "minAppVersion": "1.1.0", "description": "Browse note files in a grid view.", "author": "Devon22", diff --git a/package-lock.json b/package-lock.json index c270d20..0b7a0e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gridexplorer", - "version": "2.9.13", + "version": "2.9.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gridexplorer", - "version": "2.9.13", + "version": "2.9.14", "license": "MIT", "devDependencies": { "@types/node": "^16.11.6", diff --git a/package.json b/package.json index 087e3ca..22e4ccd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gridexplorer", - "version": "2.9.13", + "version": "2.9.14", "description": "Browse note files in a grid view.", "main": "main.js", "scripts": { diff --git a/src/main.ts b/src/main.ts index 3c57ae7..a5b57f7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,7 @@ import { Plugin, TFolder, TFile, App, Menu, WorkspaceLeaf } from 'obsidian'; import { GridView } from './GridView'; import { ExplorerView, EXPLORER_VIEW_TYPE } from './ExplorerView'; -import { updateCustomDocumentExtensions } from './fileUtils'; +import { updateCustomDocumentExtensions, isMediaFile } from './fileUtils'; import { showFolderSelectionModal } from './modal/folderSelectionModal'; import { showNoteSettingsModal } from './modal/noteSettingsModal'; import { GallerySettings, DEFAULT_SETTINGS, GridExplorerSettingTab } from './settings'; @@ -249,9 +249,10 @@ export default class GridExplorerPlugin extends Plugin { } }); // 搜尋選取的筆記名稱 - const link = this.app.fileManager.generateMarkdownLink(file, ""); + const link = isMediaFile(file) ? file.name : this.app.fileManager.generateMarkdownLink(file, ""); const truncatedText = file.basename.length > 8 ? file.basename.substring(0, 8) + '...' : file.basename; - const menuItemTitle = t('search_selection_in_grid_view').replace('...', ` [[${truncatedText}]]`); // 假設翻譯中有...代表要替換的部分,或者直接格式化 + const displayText = isMediaFile(file) ? ` ${truncatedText}` : ` [[${truncatedText}]]`; + const menuItemTitle = t('search_selection_in_grid_view').replace('...', displayText); // 假設翻譯中有...代表要替換的部分,或者直接格式化 menu.addItem(item => { item .setTitle(menuItemTitle) @@ -391,11 +392,15 @@ export default class GridExplorerPlugin extends Plugin { } }, true); // 用 capture,可在其他 listener 前先吃到 + // 攔截Breadcrumb導航點擊事件 this.registerDomEvent(document, 'click', async (evt: MouseEvent) => { // 如果未啟用攔截Breadcrumb導航點擊事件,則跳過 if (!this.settings.interceptBreadcrumbClicks) return; + //如果有按著Ctrl鍵,則跳過 + if (evt.ctrlKey || evt.metaKey) return; + const target = evt.target as HTMLElement; const breadcrumbEl = target.closest('.view-header-breadcrumb'); @@ -451,7 +456,7 @@ export default class GridExplorerPlugin extends Plugin { await view.setSource('folder', folderPath, true, ''); } }, true); // 使用 capture 階段以確保優先處理 - + // 設定 Canvas 拖曳處理 this.setupCanvasDropHandlers(); diff --git a/styles.css b/styles.css index d9a84a4..ae3643f 100644 --- a/styles.css +++ b/styles.css @@ -744,7 +744,6 @@ span.ge-mode-title { border-radius: 6px; background-color: var(--background-modifier-hover); text-decoration: none; - border-color: var(--interactive-accent); } .ge-settings-gear { diff --git a/versions.json b/versions.json index 313493d..459b469 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,3 @@ { - "2.9.13": "1.1.0" + "2.9.14": "1.1.0" } \ No newline at end of file