diff --git a/.gitignore b/.gitignore index 93bec09..c36d3ad 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,6 @@ AGENTS.md # Changelog Changelog.md + +# Code snippets +snippets/ \ No newline at end of file diff --git a/manifest.json b/manifest.json index 725be75..c376f37 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "mediaviewer", "name": "Media Viewer", - "version": "2.1.4", + "version": "2.1.5", "minAppVersion": "1.8.7", "description": "View and manage media files within your notes.", "author": "Devon22", diff --git a/package-lock.json b/package-lock.json index 47fa2ac..8caf914 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mediaviewer", - "version": "2.1.4", + "version": "2.1.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mediaviewer", - "version": "2.1.4", + "version": "2.1.5", "license": "MIT", "devDependencies": { "@types/node": "^16.11.6", diff --git a/package.json b/package.json index 5a38181..653507f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mediaviewer", - "version": "2.1.4", + "version": "2.1.5", "description": "View and manage media files within your notes.", "main": "main.js", "scripts": { diff --git a/src/galleryBlock.ts b/src/galleryBlock.ts index c5b2272..70ed35a 100644 --- a/src/galleryBlock.ts +++ b/src/galleryBlock.ts @@ -1,4 +1,4 @@ -import { App, TFile, Menu, Notice, Platform, Modal, Setting } from 'obsidian'; +import { App, TFile, Menu, Notice, Platform, Modal, Setting } from 'obsidian'; import MediaViewPlugin from './main'; import { FullScreenModal } from './fullscreen'; import { MediaViewSettings } from './settings'; @@ -1160,6 +1160,7 @@ export class GalleryBlock { const img = activeDocument.createElement('img'); img.src = item.thumbnail; img.className = 'mvgb-note-thumbnail-image'; + img.toggleClass('is-pointer-disabled', Platform.isMobile); notePreview.appendChild(img); } else { // 否則使用預設圖示 @@ -1386,6 +1387,7 @@ export class GalleryBlock { img.src = media.thumbnail; img.alt = media.path || ''; img.className = 'mvgb-video-thumbnail'; + img.toggleClass('is-pointer-disabled', Platform.isMobile); container.appendChild(img); } else { const video = activeDocument.createElement('video'); @@ -1417,6 +1419,7 @@ export class GalleryBlock { img.src = media.thumbnail; img.alt = media.path || ''; img.className = 'mvgb-video-thumbnail'; + img.toggleClass('is-pointer-disabled', Platform.isMobile); container.appendChild(img); } else { const audio = activeDocument.createElement('audio'); @@ -1531,7 +1534,7 @@ export class GalleryBlock { modal.open(); window.setTimeout(() => { const allUrls = modal.mediaUrls; - const targetIndex = allUrls.findIndex(m => m.url === media.url); + const targetIndex = allUrls.findIndex(m => (media.path && m.path === media.path) || m.url === media.url); if (targetIndex !== -1) { void modal.showMedia(targetIndex); } diff --git a/styles.css b/styles.css index 45f6096..8b00e09 100644 --- a/styles.css +++ b/styles.css @@ -917,8 +917,8 @@ .mvgb-btn-drag { top: 8px; left: 8px; - width: 28px; - height: 28px; + width: 32px; + height: 32px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: white;