Show "dashboard" icon for excalidraw files
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
getAliasesFromMetadata,
|
||||
getTagsFromMetadata,
|
||||
isFileCanvas,
|
||||
isFileFromDataloomPlugin,
|
||||
isFileFromDataloom,
|
||||
isFileImage,
|
||||
isFileOffice,
|
||||
isFilePDF,
|
||||
@@ -135,7 +135,7 @@ export class CacheManager {
|
||||
}
|
||||
|
||||
// ** Dataloom plugin **
|
||||
else if (isFileFromDataloomPlugin(path)) {
|
||||
else if (isFileFromDataloom(path)) {
|
||||
try {
|
||||
const data = JSON.parse(await app.vault.cachedRead(file))
|
||||
// data is a json object, we recursively iterate the keys
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import type { ResultNote } from '../globals'
|
||||
import {
|
||||
getExtension,
|
||||
isFileCanvas,
|
||||
isFileCanvas, isFileExcalidraw,
|
||||
isFileImage,
|
||||
isFilePDF,
|
||||
pathWithoutFilename,
|
||||
@@ -44,11 +44,18 @@
|
||||
setIcon(elFolderPathIcon, 'folder-open')
|
||||
}
|
||||
if (elFilePathIcon) {
|
||||
if (isFileImage(note.path)) setIcon(elFilePathIcon, 'image')
|
||||
else if (isFilePDF(note.path)) setIcon(elFilePathIcon, 'file-text')
|
||||
else if (isFileCanvas(note.path))
|
||||
if (isFileImage(note.path)) {
|
||||
setIcon(elFilePathIcon, 'image')
|
||||
}
|
||||
else if (isFilePDF(note.path)) {
|
||||
setIcon(elFilePathIcon, 'file-text')
|
||||
}
|
||||
else if (isFileCanvas(note.path) || isFileExcalidraw(note.path)) {
|
||||
setIcon(elFilePathIcon, 'layout-dashboard')
|
||||
else setIcon(elFilePathIcon, 'file')
|
||||
}
|
||||
else {
|
||||
setIcon(elFilePathIcon, 'file')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { removeAnchors } from './tools/notes'
|
||||
import type { IndexedDocument } from './globals'
|
||||
import {
|
||||
isFileCanvas,
|
||||
isFileFromDataloomPlugin,
|
||||
isFileFromDataloom,
|
||||
isFileImage,
|
||||
isFilePDF,
|
||||
logDebug,
|
||||
@@ -49,7 +49,7 @@ export class NotesIndexer {
|
||||
return (
|
||||
this.isFilePlaintext(path) ||
|
||||
isFileCanvas(path) ||
|
||||
isFileFromDataloomPlugin(path) ||
|
||||
isFileFromDataloom(path) ||
|
||||
(canIndexPDF && isFilePDF(path)) ||
|
||||
(canIndexImages && isFileImage(path))
|
||||
)
|
||||
@@ -60,7 +60,7 @@ export class NotesIndexer {
|
||||
this.canIndexUnsupportedFiles() ||
|
||||
this.isFilePlaintext(path) ||
|
||||
isFileCanvas(path) ||
|
||||
isFileFromDataloomPlugin(path)
|
||||
isFileFromDataloom(path)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,11 @@ export function isFileCanvas(path: string): boolean {
|
||||
return path.endsWith('.canvas')
|
||||
}
|
||||
|
||||
export function isFileFromDataloomPlugin(path: string): boolean {
|
||||
export function isFileExcalidraw(path: string): boolean {
|
||||
return path.endsWith('.excalidraw')
|
||||
}
|
||||
|
||||
export function isFileFromDataloom(path: string): boolean {
|
||||
return path.endsWith('.loom')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user