mirror of
https://github.com/devon22/obsidian-mediaviewer.git
synced 2026-07-22 11:50:28 +00:00
2.1.5
This commit is contained in:
parent
b4d944562b
commit
945337d105
6 changed files with 14 additions and 8 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -30,3 +30,6 @@ AGENTS.md
|
|||
|
||||
# Changelog
|
||||
Changelog.md
|
||||
|
||||
# Code snippets
|
||||
snippets/
|
||||
|
|
@ -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",
|
||||
|
|
|
|||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue