mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🐛 search config
This commit is contained in:
parent
d11b50b180
commit
eae9991e7b
5 changed files with 27 additions and 19 deletions
|
|
@ -12,8 +12,8 @@ export const initConfigSearch = (element: HTMLElement) => {
|
||||||
const configIndex = [
|
const configIndex = [
|
||||||
// 编辑器
|
// 编辑器
|
||||||
getLang(["config", "fullWidth",
|
getLang(["config", "fullWidth",
|
||||||
"editor", "md2", "md3", "md12", "md16", "md27", "md28", "md29", "md30", "md31", "md32", "md33", "md34", "md39", "md40",
|
"editor", "md2", "md3", "md12", "md16", "md27", "md28", "md29", "md30", "md31", "md32", "md33", "md34",
|
||||||
"fontSizeTip", "fontSize", "font", "font1", "generateHistory", "generateHistoryInterval",
|
"md39", "md40", "fontSizeTip", "fontSize", "font", "font1", "generateHistory", "generateHistoryInterval",
|
||||||
"historyRetentionDays", "historyRetentionDaysTip", "clearHistory", "katexMacros", "katexMacrosTip"
|
"historyRetentionDays", "historyRetentionDaysTip", "clearHistory", "katexMacros", "katexMacrosTip"
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
|
@ -26,17 +26,19 @@ export const initConfigSearch = (element: HTMLElement) => {
|
||||||
getLang(["assets", "clearUnused"]),
|
getLang(["assets", "clearUnused"]),
|
||||||
|
|
||||||
// 导出
|
// 导出
|
||||||
getLang(["paragraphBeginningSpace", "md4", "export", "export1", "export2", "export5", "export11", "export13", "export14", "export15", "export19", "export20", "blockRef", "blockEmbed"]),
|
getLang(["paragraphBeginningSpace", "md4", "export", "export1", "export2", "export5", "export11",
|
||||||
|
"export13", "export14", "export15", "export19", "export20", "blockRef", "blockEmbed"]),
|
||||||
|
|
||||||
// 外观
|
// 外观
|
||||||
window.siyuan.config.appearance.darkThemes.concat(window.siyuan.config.appearance.icons).concat(window.siyuan.config.appearance.lightThemes)
|
window.siyuan.config.appearance.darkThemes.concat(window.siyuan.config.appearance.icons).concat(window.siyuan.config.appearance.lightThemes)
|
||||||
.concat(Constants.SIYUAN_CONFIG_APPEARANCE_DARK_CODE)
|
.concat(Constants.SIYUAN_CONFIG_APPEARANCE_DARK_CODE)
|
||||||
.concat(Constants.SIYUAN_CONFIG_APPEARANCE_LIGHT_CODE)
|
.concat(Constants.SIYUAN_CONFIG_APPEARANCE_LIGHT_CODE)
|
||||||
.concat(["English", "简体中文"]).concat(getLang(["language", "language1"]))
|
.concat(["English", "简体中文"]).concat(getLang(["language", "language1"]))
|
||||||
.concat(getLang(["appearance", "appearance1", "appearance2", "appearance3", "appearance4", "appearance5",
|
.concat(getLang(["appearance", "appearance1", "appearance2", "appearance3", "appearance4",
|
||||||
"appearance6", "appearance7", "appearance8", "appearance9", "appearance10", "appearance11", "appearance14", "appearance15",
|
"appearance5", "appearance6", "appearance8", "appearance9", "appearance10", "appearance11",
|
||||||
"resetLayout", "reset", "icon", "themeLight", "themeDark", "open", "close",
|
"appearance14", "appearance15", "appearance16", "appearance17",
|
||||||
"theme", "theme2", "theme11", "theme12", "theme13", "theme14", "customEmoji"])),
|
"resetLayout", "reset", "icon", "themeLight", "themeDark", "open", "close", "themeOS", "theme",
|
||||||
|
"theme2", "theme11", "theme12", "theme13", "theme14", "customEmoji", "customEmojiTip", "refresh"])),
|
||||||
|
|
||||||
// 集市
|
// 集市
|
||||||
getLang(["bazaar", "theme", "template", "icon", "widget"]),
|
getLang(["bazaar", "theme", "template", "icon", "widget"]),
|
||||||
|
|
@ -54,18 +56,21 @@ export const initConfigSearch = (element: HTMLElement) => {
|
||||||
.concat(Object.keys(Constants.SIYUAN_KEYMAP.editor.table))),
|
.concat(Object.keys(Constants.SIYUAN_KEYMAP.editor.table))),
|
||||||
|
|
||||||
// 云端
|
// 云端
|
||||||
getLang(["sync", "cloudSpace", "backup", "cdn", "total", "cloudBackup", "updatePath", "cloudSync",
|
getLang(["cloudStorage", "trafficStat", "sync", "backup", "cdn", "total", "sizeLimit", "cloudBackup",
|
||||||
"syncTip", "reposTip", "openSyncTip1", "openSyncTip2", "cloudSyncDir"]),
|
"cloudBackupTip", "updatePath", "cloudSync", "upload", "download", "syncMode", "syncModeTip",
|
||||||
|
"syncMode1", "syncMode2", "reposTip", "openSyncTip1", "openSyncTip2", "cloudSyncDir", "config"]),
|
||||||
|
|
||||||
// 账号
|
// 账号
|
||||||
getLang(["accountTip", "accountName", "password", "captcha", "forgetPassword", "login", "register", "twoFactorCaptcha",
|
getLang(["accountTip", "accountName", "password", "captcha", "forgetPassword", "login", "register",
|
||||||
"account1", "account2", "account5", "networkProxy"]),
|
"twoFactorCaptcha", "account1", "account2", "account5"]),
|
||||||
|
|
||||||
// 关于
|
// 关于
|
||||||
getLang(["about", "about1", "about2", "about3", "about4", "about5", "about6", "about7", "about8",
|
getLang(["about", "about1", "about2", "about3", "about4", "about5", "about6", "about7", "about8",
|
||||||
"about11", "about12", "about13", "about14", "about15", "about16",
|
"about9", "about10", "about11", "about12", "about13", "about14", "about17", "config", "dataRepoKey",
|
||||||
"slogan", "currentVer", "checkUpdate", "updatePath", "snapshotPassword", "systemLog",
|
"dataRepoKeyTip1", "dataRepoKeyTip2", "slogan", "currentVer", "checkUpdate", "updatePath", "systemLog",
|
||||||
"autoDownloadUpdatePkg"]),
|
"importKey", "genKey", "genKeyByPW", "copyKey", "resetRepo", "systemLogTip", "export", "visitAnnouncements",
|
||||||
|
"safeQuit", "directConnection", "siyuanNote", "key", "password", "copied", "resetRepoTip",
|
||||||
|
"autoDownloadUpdatePkg", "autoDownloadUpdatePkgTip", "networkProxy", "keyPlaceholder", "initRepoKeyTip"]),
|
||||||
];
|
];
|
||||||
const inputElement = element.querySelector(".b3-form__icon input") as HTMLInputElement;
|
const inputElement = element.querySelector(".b3-form__icon input") as HTMLInputElement;
|
||||||
if (window.siyuan.config.system.container !== "ios") {
|
if (window.siyuan.config.system.container !== "ios") {
|
||||||
|
|
@ -75,7 +80,10 @@ export const initConfigSearch = (element: HTMLElement) => {
|
||||||
const indexList: number[] = [];
|
const indexList: number[] = [];
|
||||||
const inputValue = inputElement.value;
|
const inputValue = inputElement.value;
|
||||||
configIndex.map((item, index) => {
|
configIndex.map((item, index) => {
|
||||||
item.map(subItem => {
|
item.map((subItem) => {
|
||||||
|
if (!subItem) {
|
||||||
|
console.warn("Search config miss language: ", item, index)
|
||||||
|
}
|
||||||
if (subItem && (inputValue.toLowerCase().indexOf(subItem) > -1 || subItem.toLowerCase().indexOf(inputValue) > -1)) {
|
if (subItem && (inputValue.toLowerCase().indexOf(subItem) > -1 || subItem.toLowerCase().indexOf(inputValue) > -1)) {
|
||||||
indexList.push(index);
|
indexList.push(index);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ export abstract class Constants {
|
||||||
graphView: {default: "⌥8", custom: "⌥8"},
|
graphView: {default: "⌥8", custom: "⌥8"},
|
||||||
globalGraph: {default: "⌥9", custom: "⌥9"},
|
globalGraph: {default: "⌥9", custom: "⌥9"},
|
||||||
config: {default: "⌥P", custom: "⌥P"},
|
config: {default: "⌥P", custom: "⌥P"},
|
||||||
history: {default: "⌥H", custom: "⌥H"},
|
dataHistory: {default: "⌥H", custom: "⌥H"},
|
||||||
toggleWin: {default: "⌥M", custom: "⌥M"},
|
toggleWin: {default: "⌥M", custom: "⌥M"},
|
||||||
lockScreen: {default: "⌥N", custom: "⌥N"},
|
lockScreen: {default: "⌥N", custom: "⌥N"},
|
||||||
move: {default: "", custom: ""},
|
move: {default: "", custom: ""},
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ export class Toolbar {
|
||||||
});
|
});
|
||||||
const types = this.getCurrentType();
|
const types = this.getCurrentType();
|
||||||
types.forEach(item => {
|
types.forEach(item => {
|
||||||
if (["a", "block-ref", "text", "file-annotation-ref", "inline-math", "inline-memo", ""].includes(item)) {
|
if (["a", "block-ref", "virtual-block-ref", "text", "file-annotation-ref", "inline-math", "inline-memo", ""].includes(item)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.element.querySelector(`[data-type="${item}"]`).classList.add("protyle-toolbar__item--current");
|
this.element.querySelector(`[data-type="${item}"]`).classList.add("protyle-toolbar__item--current");
|
||||||
|
|
|
||||||
|
|
@ -391,7 +391,7 @@ export const globalShortcut = () => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (matchHotKey(window.siyuan.config.keymap.general.history.custom, event)) {
|
if (matchHotKey(window.siyuan.config.keymap.general.dataHistory.custom, event)) {
|
||||||
openHistory();
|
openHistory();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ const initBar = () => {
|
||||||
<use xlink:href="#iconSearch"></use>
|
<use xlink:href="#iconSearch"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<div id="barHistory" class="toolbar__item b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.languages.dataHistory} ${updateHotkeyTip(window.siyuan.config.keymap.general.history.custom)}">
|
<div id="barHistory" class="toolbar__item b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.languages.dataHistory} ${updateHotkeyTip(window.siyuan.config.keymap.general.dataHistory.custom)}">
|
||||||
<svg>
|
<svg>
|
||||||
<use xlink:href="#iconVideo"></use>
|
<use xlink:href="#iconVideo"></use>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue