Skip to content

Commit 5c98535

Browse files
committed
feat: fada to fad
1 parent 1924956 commit 5c98535

14 files changed

Lines changed: 25 additions & 26 deletions

File tree

electron-builder.json5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
],
5454
"fileAssociations": [
5555
{
56-
"ext": "fada",
56+
"ext": "fad",
5757
"name": "FocusAny Data File",
5858
"role": "Editor"
5959
}
@@ -123,7 +123,7 @@
123123
],
124124
"fileAssociations": [
125125
{
126-
"ext": "fada",
126+
"ext": "fad",
127127
"name": "FocusAny Data File",
128128
"role": "Editor"
129129
}
@@ -180,7 +180,7 @@
180180
],
181181
"fileAssociations": [
182182
{
183-
"ext": "fada",
183+
"ext": "fad",
184184
"name": "FocusAny Data File",
185185
"role": "Editor"
186186
}

electron/mapi/manager/editor/index.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const ManagerEditor = {
2020
return this.faDataTypeCache[file]
2121
}
2222
const fileExt = nodePath.extname(file).toLowerCase()
23-
if (fileExt !== '.fada') {
23+
if (fileExt !== '.fad') {
2424
return null
2525
}
2626
try {
@@ -29,17 +29,16 @@ export const ManagerEditor = {
2929
})
3030
const json = JSON.parse(result)
3131
this.faDataTypeCache[file] = json['type']
32-
return null
3332
} catch (e) {
3433
this.faDataTypeCache[file] = null
3534
}
36-
return null
35+
return this.faDataTypeCache[file]
3736
},
38-
async filterFaDataType(files: FileItem[], types: string[]) {
37+
async filterFadType(files: FileItem[], types: string[]) {
3938
const newFiles = []
4039
for (const file of files) {
4140
const fileExt = nodePath.extname(file.path).toLowerCase()
42-
if (fileExt !== '.fada') {
41+
if (fileExt !== '.fad') {
4342
continue
4443
}
4544
const fileType = await this.getFaDataTypeCached(file.path)

electron/mapi/manager/manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ export const Manager = {
348348
if ('extensions' in m) {
349349
files = files.filter(f => f.isFile && (m as ActionMatchEditor).extensions.includes(f.fileExt))
350350
}
351-
if ('faDataTypes' in m) {
352-
files = await ManagerEditor.filterFaDataType(files, (m as ActionMatchEditor).faDataTypes)
351+
if ('fadTypes' in m) {
352+
files = await ManagerEditor.filterFadType(files, (m as ActionMatchEditor).fadTypes)
353353
}
354354
if (files.length <= 0) {
355355
continue

electron/preload/focusany.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ export const FocusAny = {
577577
}
578578
},
579579

580-
fada: {
580+
fad: {
581581
async read(type: string, path: string): Promise<any> {
582582
const fileData = await ipcSendAsync('fileRead', {path})
583583
if (!fileData) {

sdk/config.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245
"type": "string"
246246
}
247247
},
248-
"faDataTypes": {
248+
"fadTypes": {
249249
"type": "array",
250250
"description": "FocusAny 数据类型",
251251
"items": {

sdk/focusany.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ declare type ActionMatchWindow = ActionMatchBase & {
108108

109109
declare type ActionMatchEditor = ActionMatchBase & {
110110
extensions: string[],
111-
faDataTypes: string[],
111+
fadTypes: string[],
112112
}
113113

114114
interface PluginAction {
@@ -748,7 +748,7 @@ interface FocusAnyApi {
748748
/**
749749
* 快捷文件
750750
*/
751-
fada: {
751+
fad: {
752752
/**
753753
* 读取快捷文件内容
754754
* @param type

sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "focusany-sdk",
3-
"version": "0.2.7",
3+
"version": "0.2.8",
44
"description": "TypeScript definitions for FocusAny",
55
"repository": {
66
"type": "git",

src/components/common/FileExt.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import unknown from './FileExtAssets/unknown.svg'
2727
import xls from './FileExtAssets/xls.svg'
2828
import xlsx from './FileExtAssets/xlsx.svg'
2929
import zip from './FileExtAssets/zip.svg'
30-
import fada from './FileExtAssets/fada.svg'
30+
import fad from './FileExtAssets/fad.svg'
3131
import {computed} from "vue";
3232
3333
const images = {
@@ -59,7 +59,7 @@ const images = {
5959
xls,
6060
xlsx,
6161
zip,
62-
fada
62+
fad
6363
}
6464
6565
const props = withDefaults(defineProps<{
File renamed without changes.

src/pages/Main/Lib/searchOperate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export const useSearchOperate = (emit) => {
5252
if (file.isDirectory) {
5353
result.extName = 'ext.folder';
5454
}
55-
if (result.name.endsWith('.fada')) {
56-
result.name = result.name.substring(0, result.name.length - 5);
55+
if (result.name.endsWith('.fad')) {
56+
result.name = result.name.substring(0, result.name.length - 4);
5757
}
5858
return result;
5959
}

0 commit comments

Comments
 (0)