Skip to content

Commit

Permalink
🎨 #10645
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Mar 22, 2024
1 parent c455f87 commit 09b4304
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 30 deletions.
2 changes: 2 additions & 0 deletions app/appearance/langs/en_US.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"video": "Video",
"audio": "Audio",
"updateAll": "Update all",
"confirmUpdateAll": "Are you sure you want to update all?",
"confirmUpdate": "Are you sure you want to update?",
Expand Down
2 changes: 2 additions & 0 deletions app/appearance/langs/es_ES.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"vídeo": "Vídeo",
"audio": "Audio",
"updateAll": "Actualizar todo",
"confirmUpdateAll": "¿Estás seguro de que deseas actualizar todo?",
"confirmUpdate": "¿Estás seguro de que deseas actualizar?",
Expand Down
2 changes: 2 additions & 0 deletions app/appearance/langs/fr_FR.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"video": "Vidéo",
"audio": "Audio",
"updateAll": "Tout mettre à jour",
"confirmUpdateAll": "Etes-vous sûr de vouloir tout mettre à jour ?",
"confirmUpdate": "Êtes-vous sûr de vouloir mettre à jour ?",
Expand Down
2 changes: 2 additions & 0 deletions app/appearance/langs/zh_CHT.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"video": "影片",
"audio": "音訊",
"updateAll": "全部更新",
"confirmUpdateAll": "確定全部更新嗎?",
"confirmUpdate": "確定更新嗎?",
Expand Down
2 changes: 2 additions & 0 deletions app/appearance/langs/zh_CN.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"video": "视频",
"audio": "音频",
"updateAll": "全部更新",
"confirmUpdateAll": "确定全部更新吗?",
"confirmUpdate": "确定更新吗?",
Expand Down
42 changes: 41 additions & 1 deletion app/src/config/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,43 @@ export const query = {
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="databaseBlock" type="checkbox"${window.siyuan.config.search.databaseBlock ? " checked" : ""}/>
</label>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconVideo"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.video}
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="videoBlock" type="checkbox"${window.siyuan.config.search.videoBlock ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconRecord"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.audio}
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="audioBlock" type="checkbox"${window.siyuan.config.search.audioBlock ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconLanguage"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
IFrame
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="iFrameBlock" type="checkbox"${window.siyuan.config.search.iFrameBlock ? " checked" : ""}/>
</label>
<label class="fn__flex">
<svg class="svg"><use xlink:href="#iconBoth"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1">
${window.siyuan.languages.widget}
</div>
<span class="fn__space"></span>
<input class="b3-switch" id="widgetBlock" type="checkbox"${window.siyuan.config.search.widgetBlock ? " checked" : ""}/>
</label>
</div>
</div>
<div class="b3-label">
Expand Down Expand Up @@ -279,6 +315,10 @@ export const query = {
htmlBlock: (query.element.querySelector("#htmlBlock") as HTMLInputElement).checked,
embedBlock: (query.element.querySelector("#embedBlock") as HTMLInputElement).checked,
databaseBlock: (query.element.querySelector("#databaseBlock") as HTMLInputElement).checked,
audioBlock: (query.element.querySelector("#audioBlock") as HTMLInputElement).checked,
videoBlock: (query.element.querySelector("#videoBlock") as HTMLInputElement).checked,
iFrameBlock: (query.element.querySelector("#iFrameBlock") as HTMLInputElement).checked,
widgetBlock: (query.element.querySelector("#widgetBlock") as HTMLInputElement).checked,
mathBlock: (query.element.querySelector("#mathBlock") as HTMLInputElement).checked,
table: (query.element.querySelector("#table") as HTMLInputElement).checked,
blockquote: (query.element.querySelector("#blockquote") as HTMLInputElement).checked,
Expand Down
36 changes: 36 additions & 0 deletions app/src/search/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,42 @@ export const filterMenu = (config: ISearchOption, cb: () => void) => {
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" data-type="databaseBlock" type="checkbox"${config.types.databaseBlock ? " checked" : ""}>
</label>
<label class="fn__flex b3-label">
<svg class="ft__on-surface svg fn__flex-center"><use xlink:href="#iconVideo"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1 fn__flex-center">
${window.siyuan.languages.video}
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" data-type="videoBlock" type="checkbox"${config.types.videoBlock ? " checked" : ""}>
</label>
<label class="fn__flex b3-label">
<svg class="ft__on-surface svg fn__flex-center"><use xlink:href="#iconRecord"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1 fn__flex-center">
${window.siyuan.languages.audio}
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" data-type="audioBlock" type="checkbox"${config.types.audioBlock ? " checked" : ""}>
</label>
<label class="fn__flex b3-label">
<svg class="ft__on-surface svg fn__flex-center"><use xlink:href="#iconLanguage"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1 fn__flex-center">
IFrame
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" data-type="iFrameBlock" type="checkbox"${config.types.iFrameBlock ? " checked" : ""}>
</label>
<label class="fn__flex b3-label">
<svg class="ft__on-surface svg fn__flex-center"><use xlink:href="#iconBoth"></use></svg>
<span class="fn__space"></span>
<div class="fn__flex-1 fn__flex-center">
${window.siyuan.languages.widget}
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" data-type="widgetBlock" type="checkbox"${config.types.widgetBlock ? " checked" : ""}>
</label>
</div>
<div class="b3-dialog__action">
<button class="b3-button b3-button--cancel">${window.siyuan.languages.cancel}</button><div class="fn__space"></div>
Expand Down
8 changes: 8 additions & 0 deletions app/src/search/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
r: "",
page: 1,
types: {
audioBlock: window.siyuan.config.search.audioBlock,
videoBlock: window.siyuan.config.search.videoBlock,
iFrameBlock: window.siyuan.config.search.iFrameBlock,
widgetBlock: window.siyuan.config.search.widgetBlock,
document: window.siyuan.config.search.document,
heading: window.siyuan.config.search.heading,
list: window.siyuan.config.search.list,
Expand Down Expand Up @@ -763,6 +767,10 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
r: "",
page: 1,
types: {
audioBlock: window.siyuan.config.search.audioBlock,
videoBlock: window.siyuan.config.search.videoBlock,
iFrameBlock: window.siyuan.config.search.iFrameBlock,
widgetBlock: window.siyuan.config.search.widgetBlock,
document: window.siyuan.config.search.document,
heading: window.siyuan.config.search.heading,
list: window.siyuan.config.search.list,
Expand Down
51 changes: 22 additions & 29 deletions app/src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,26 +268,32 @@ interface ISearchOption {
idPath: string[]
k: string
r: string
types: {
mathBlock: boolean
table: boolean
blockquote: boolean
superBlock: boolean
paragraph: boolean
document: boolean
heading: boolean
list: boolean
listItem: boolean
codeBlock: boolean
htmlBlock: boolean
embedBlock: boolean
databaseBlock: boolean
},
types: ISearchType,
replaceTypes: {
[key: string]: boolean;
},
}

interface ISearchType {
audioBlock: boolean
videoBlock: boolean
iFrameBlock: boolean
widgetBlock: boolean
mathBlock: boolean
table: boolean
blockquote: boolean
superBlock: boolean
paragraph: boolean
document: boolean
heading: boolean
list: boolean
listItem: boolean
codeBlock: boolean
htmlBlock: boolean
embedBlock: boolean
databaseBlock: boolean
}

interface ITextOption {
color?: string,
type: string
Expand Down Expand Up @@ -823,20 +829,7 @@ interface IConfig {
tag: {
sort: number
}
search: {
databaseBlock: boolean
embedBlock: boolean
htmlBlock: boolean
document: boolean
heading: boolean
list: boolean
listItem: boolean
codeBlock: boolean
mathBlock: boolean
table: boolean
blockquote: boolean
superBlock: boolean
paragraph: boolean
search: ISearchType & {
name: boolean
alias: boolean
memo: boolean
Expand Down

0 comments on commit 09b4304

Please sign in to comment.