mirror of
https://github.com/devon22/obsidian-gridexplorer.git
synced 2026-07-22 05:38:16 +00:00
3.4.19
This commit is contained in:
parent
ce13321edd
commit
5d93b16e8d
6 changed files with 31 additions and 9 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "gridexplorer",
|
"id": "gridexplorer",
|
||||||
"name": "GridExplorer",
|
"name": "GridExplorer",
|
||||||
"version": "3.4.18",
|
"version": "3.4.19",
|
||||||
"minAppVersion": "1.8.7",
|
"minAppVersion": "1.8.7",
|
||||||
"description": "Browse and organize note files visually in a flexible grid layout.",
|
"description": "Browse and organize note files visually in a flexible grid layout.",
|
||||||
"author": "Devon22",
|
"author": "Devon22",
|
||||||
|
|
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "gridexplorer",
|
"name": "gridexplorer",
|
||||||
"version": "3.4.18",
|
"version": "3.4.19",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "gridexplorer",
|
"name": "gridexplorer",
|
||||||
"version": "3.4.18",
|
"version": "3.4.19",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jszip": "^3.10.1"
|
"jszip": "^3.10.1"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "gridexplorer",
|
"name": "gridexplorer",
|
||||||
"version": "3.4.18",
|
"version": "3.4.19",
|
||||||
"description": "Browse and organize note files visually in a flexible grid layout.",
|
"description": "Browse and organize note files visually in a flexible grid layout.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -1541,6 +1541,7 @@ export class GridView extends ItemView {
|
||||||
// Markdown 檔案尋找內部圖片
|
// Markdown 檔案尋找內部圖片
|
||||||
if (imageUrl) {
|
if (imageUrl) {
|
||||||
const img = imageArea.createEl('img');
|
const img = imageArea.createEl('img');
|
||||||
|
img.referrerPolicy = 'no-referrer';
|
||||||
img.src = imageUrl;
|
img.src = imageUrl;
|
||||||
img.draggable = false;
|
img.draggable = false;
|
||||||
imageArea.setAttribute('data-loaded', 'true');
|
imageArea.setAttribute('data-loaded', 'true');
|
||||||
|
|
|
||||||
|
|
@ -186,21 +186,24 @@ async function resolveUrl(app: App, url: string): Promise<string | null> {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function validateRemoteImage(url: string): Promise<string | null> {
|
async function validateRemoteImage(url: string): Promise<string | null> {
|
||||||
|
const headers = {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36'
|
||||||
|
};
|
||||||
try {
|
try {
|
||||||
const headResponse = await requestUrl({ url, method: 'HEAD' });
|
const headResponse = await requestUrl({ url, method: 'HEAD', headers });
|
||||||
if (isSuccessfulStatus(headResponse)) {
|
if (isSuccessfulStatus(headResponse)) {
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headResponse.status === 405 || headResponse.status === 501) {
|
if (headResponse.status === 405 || headResponse.status === 501) {
|
||||||
const getResponse = await requestUrl({ url });
|
const getResponse = await requestUrl({ url, headers });
|
||||||
if (isSuccessfulStatus(getResponse)) {
|
if (isSuccessfulStatus(getResponse)) {
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
try {
|
try {
|
||||||
const getResponse = await requestUrl({ url });
|
const getResponse = await requestUrl({ url, headers });
|
||||||
if (isSuccessfulStatus(getResponse)) {
|
if (isSuccessfulStatus(getResponse)) {
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
@ -209,7 +212,8 @@ async function validateRemoteImage(url: string): Promise<string | null> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
// 即使驗證失敗,只要 URL 格式符合圖片規格,仍傳回原網址讓瀏覽器嘗試載入
|
||||||
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSuccessfulStatus(response: RequestUrlResponse): boolean {
|
function isSuccessfulStatus(response: RequestUrlResponse): boolean {
|
||||||
|
|
|
||||||
19
styles.css
19
styles.css
|
|
@ -2323,6 +2323,7 @@ a.ge-current-folder:hover {
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
container-type: inline-size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 筆記頂部按鈕列 */
|
/* 筆記頂部按鈕列 */
|
||||||
|
|
@ -2354,7 +2355,8 @@ a.ge-current-folder:hover {
|
||||||
/* 捲動區域 */
|
/* 捲動區域 */
|
||||||
.ge-note-scroll-container {
|
.ge-note-scroll-container {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
overflow: auto;
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
background-color: var(--background-primary);
|
background-color: var(--background-primary);
|
||||||
font-size: var(--font-text-size);
|
font-size: var(--font-text-size);
|
||||||
}
|
}
|
||||||
|
|
@ -2457,6 +2459,21 @@ a.ge-current-folder:hover {
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 讓圖片延展到包含卷軸的介面寬度 (僅限行動裝置,且排除程式碼區塊、表格、清單等特殊容器內的圖片) */
|
||||||
|
.is-mobile .ge-note-content img:not(pre *, code *, [class*="block-language-"] *, .callout *, table *, ul *, ol *, blockquote *),
|
||||||
|
.is-mobile .ge-note-content .internal-embed:has(img):not(pre *, code *, [class*="block-language-"] *, .callout *, table *, ul *, ol *, blockquote *) {
|
||||||
|
width: 100cqw;
|
||||||
|
max-width: 100cqw;
|
||||||
|
margin-left: calc(50% - 50cqw);
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-mobile .ge-note-content .internal-embed:has(img):not(pre *, code *, [class*="block-language-"] *, .callout *, table *, ul *, ol *, blockquote *) img {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.ge-note-content h1,
|
.ge-note-content h1,
|
||||||
.ge-note-content h2,
|
.ge-note-content h2,
|
||||||
.ge-note-content h3,
|
.ge-note-content h3,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue