mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
♻️
This commit is contained in:
parent
1e4bb45540
commit
3f6aec2775
10 changed files with 48 additions and 51 deletions
|
|
@ -285,7 +285,7 @@ export const bindCardEvent = async (options: {
|
||||||
fetchPost("/api/riff/getRiffDecks", {}, (response) => {
|
fetchPost("/api/riff/getRiffDecks", {}, (response) => {
|
||||||
window.siyuan.menus.menu.remove();
|
window.siyuan.menus.menu.remove();
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.all,
|
label: window.siyuan.languages.all,
|
||||||
click() {
|
click() {
|
||||||
filterElement.setAttribute("data-id", "");
|
filterElement.setAttribute("data-id", "");
|
||||||
|
|
@ -294,7 +294,7 @@ export const bindCardEvent = async (options: {
|
||||||
},
|
},
|
||||||
}).element);
|
}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.fileTree,
|
label: window.siyuan.languages.fileTree,
|
||||||
click() {
|
click() {
|
||||||
movePathTo((toPath, toNotebook) => {
|
movePathTo((toPath, toNotebook) => {
|
||||||
|
|
@ -309,7 +309,7 @@ export const bindCardEvent = async (options: {
|
||||||
}
|
}
|
||||||
if (options.title) {
|
if (options.title) {
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: escapeHtml(options.title),
|
label: escapeHtml(options.title),
|
||||||
click() {
|
click() {
|
||||||
filterElement.setAttribute("data-id", options.id);
|
filterElement.setAttribute("data-id", options.id);
|
||||||
|
|
@ -321,7 +321,7 @@ export const bindCardEvent = async (options: {
|
||||||
}
|
}
|
||||||
response.data.forEach((deck: { id: string, name: string }) => {
|
response.data.forEach((deck: { id: string, name: string }) => {
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: escapeHtml(deck.name),
|
label: escapeHtml(deck.name),
|
||||||
click() {
|
click() {
|
||||||
filterElement.setAttribute("data-id", deck.id);
|
filterElement.setAttribute("data-id", deck.id);
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ export const initStatus = (isWindow = false) => {
|
||||||
JSON.parse(target.getAttribute("data-tasks")).forEach((item: { action: string }) => {
|
JSON.parse(target.getAttribute("data-tasks")).forEach((item: { action: string }) => {
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
type: "readonly",
|
type: "readonly",
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: item.action
|
label: item.action
|
||||||
}).element);
|
}).element);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -280,7 +280,7 @@ export const openFileAttr = (attrs: IObject, focusName = "bookmark", protyle?: I
|
||||||
window.siyuan.menus.menu.remove();
|
window.siyuan.menus.menu.remove();
|
||||||
if (response.data.length === 0) {
|
if (response.data.length === 0) {
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.emptyContent,
|
label: window.siyuan.languages.emptyContent,
|
||||||
type: "readonly",
|
type: "readonly",
|
||||||
}).element);
|
}).element);
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ const initMultiMenu = (selectItemElements: NodeListOf<Element>, app: App) => {
|
||||||
}
|
}
|
||||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||||
const riffCardMenu = [{
|
const riffCardMenu = [{
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
accelerator: window.siyuan.config.keymap.editor.general.quickMakeCard.custom,
|
accelerator: window.siyuan.config.keymap.editor.general.quickMakeCard.custom,
|
||||||
label: window.siyuan.languages.quickMakeCard,
|
label: window.siyuan.languages.quickMakeCard,
|
||||||
click: () => {
|
click: () => {
|
||||||
|
|
@ -78,7 +78,7 @@ const initMultiMenu = (selectItemElements: NodeListOf<Element>, app: App) => {
|
||||||
}]);
|
}]);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: `${window.siyuan.languages.cancel} <b>${window.siyuan.languages.quickMakeCard}</b>`,
|
label: `${window.siyuan.languages.cancel} <b>${window.siyuan.languages.quickMakeCard}</b>`,
|
||||||
click: () => {
|
click: () => {
|
||||||
transaction(undefined, [{
|
transaction(undefined, [{
|
||||||
|
|
@ -94,7 +94,7 @@ const initMultiMenu = (selectItemElements: NodeListOf<Element>, app: App) => {
|
||||||
}];
|
}];
|
||||||
if (window.siyuan.config.flashcard.deck) {
|
if (window.siyuan.config.flashcard.deck) {
|
||||||
riffCardMenu.push({
|
riffCardMenu.push({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.addToDeck,
|
label: window.siyuan.languages.addToDeck,
|
||||||
click: () => {
|
click: () => {
|
||||||
makeCard(app, blockIDs);
|
makeCard(app, blockIDs);
|
||||||
|
|
@ -193,7 +193,7 @@ export const initNavigationMenu = (app: App, liElement: HTMLElement) => {
|
||||||
type: "submenu",
|
type: "submenu",
|
||||||
icon: "iconRiffCard",
|
icon: "iconRiffCard",
|
||||||
submenu: [{
|
submenu: [{
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.spaceRepetition,
|
label: window.siyuan.languages.spaceRepetition,
|
||||||
accelerator: window.siyuan.config.keymap.editor.general.spaceRepetition.custom,
|
accelerator: window.siyuan.config.keymap.editor.general.spaceRepetition.custom,
|
||||||
click: () => {
|
click: () => {
|
||||||
|
|
@ -205,7 +205,7 @@ export const initNavigationMenu = (app: App, liElement: HTMLElement) => {
|
||||||
/// #endif
|
/// #endif
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.manage,
|
label: window.siyuan.languages.manage,
|
||||||
click: () => {
|
click: () => {
|
||||||
viewCards(app, notebookId, name, "Notebook");
|
viewCards(app, notebookId, name, "Notebook");
|
||||||
|
|
@ -467,7 +467,7 @@ export const initFileMenu = (app: App, notebookId: string, pathString: string, l
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
const riffCardMenu = [{
|
const riffCardMenu = [{
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.spaceRepetition,
|
label: window.siyuan.languages.spaceRepetition,
|
||||||
accelerator: window.siyuan.config.keymap.editor.general.spaceRepetition.custom,
|
accelerator: window.siyuan.config.keymap.editor.general.spaceRepetition.custom,
|
||||||
click: () => {
|
click: () => {
|
||||||
|
|
@ -479,7 +479,7 @@ export const initFileMenu = (app: App, notebookId: string, pathString: string, l
|
||||||
/// #endif
|
/// #endif
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.manage,
|
label: window.siyuan.languages.manage,
|
||||||
click: () => {
|
click: () => {
|
||||||
fetchPost("/api/filetree/getHPathByID", {
|
fetchPost("/api/filetree/getHPathByID", {
|
||||||
|
|
@ -492,7 +492,7 @@ export const initFileMenu = (app: App, notebookId: string, pathString: string, l
|
||||||
/// #endif
|
/// #endif
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
accelerator: window.siyuan.config.keymap.editor.general.quickMakeCard.custom,
|
accelerator: window.siyuan.config.keymap.editor.general.quickMakeCard.custom,
|
||||||
label: window.siyuan.languages.quickMakeCard,
|
label: window.siyuan.languages.quickMakeCard,
|
||||||
click: () => {
|
click: () => {
|
||||||
|
|
@ -507,7 +507,7 @@ export const initFileMenu = (app: App, notebookId: string, pathString: string, l
|
||||||
}]);
|
}]);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: `${window.siyuan.languages.cancel} <b>${window.siyuan.languages.quickMakeCard}</b>`,
|
label: `${window.siyuan.languages.cancel} <b>${window.siyuan.languages.quickMakeCard}</b>`,
|
||||||
click: () => {
|
click: () => {
|
||||||
transaction(undefined, [{
|
transaction(undefined, [{
|
||||||
|
|
@ -523,7 +523,7 @@ export const initFileMenu = (app: App, notebookId: string, pathString: string, l
|
||||||
}];
|
}];
|
||||||
if (window.siyuan.config.flashcard.deck) {
|
if (window.siyuan.config.flashcard.deck) {
|
||||||
riffCardMenu.push({
|
riffCardMenu.push({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.addToDeck,
|
label: window.siyuan.languages.addToDeck,
|
||||||
click: () => {
|
click: () => {
|
||||||
makeCard(app, [id]);
|
makeCard(app, [id]);
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ export const workspaceMenu = (app: App, rect: DOMRect) => {
|
||||||
workspaceSubMenu.push({type: "separator"});
|
workspaceSubMenu.push({type: "separator"});
|
||||||
response.data.forEach((item: IWorkspace) => {
|
response.data.forEach((item: IWorkspace) => {
|
||||||
workspaceSubMenu.push({
|
workspaceSubMenu.push({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
action: "iconCloseRound",
|
action: "iconCloseRound",
|
||||||
current: window.siyuan.config.system.workspaceDir === item.path,
|
current: window.siyuan.config.system.workspaceDir === item.path,
|
||||||
label: pathPosix().basename(item.path),
|
label: pathPosix().basename(item.path),
|
||||||
|
|
@ -223,7 +223,7 @@ export const workspaceMenu = (app: App, rect: DOMRect) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const layoutSubMenu: IMenu[] = [{
|
const layoutSubMenu: IMenu[] = [{
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.save,
|
label: window.siyuan.languages.save,
|
||||||
click() {
|
click() {
|
||||||
const saveDialog = new Dialog({
|
const saveDialog = new Dialog({
|
||||||
|
|
@ -278,7 +278,7 @@ export const workspaceMenu = (app: App, rect: DOMRect) => {
|
||||||
}
|
}
|
||||||
window.siyuan.storage[Constants.LOCAL_LAYOUTS].forEach((item: ISaveLayout) => {
|
window.siyuan.storage[Constants.LOCAL_LAYOUTS].forEach((item: ISaveLayout) => {
|
||||||
layoutSubMenu.push({
|
layoutSubMenu.push({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
action: "iconCloseRound",
|
action: "iconCloseRound",
|
||||||
label: item.name,
|
label: item.name,
|
||||||
bind(menuElement) {
|
bind(menuElement) {
|
||||||
|
|
@ -348,14 +348,14 @@ export const workspaceMenu = (app: App, rect: DOMRect) => {
|
||||||
type: "submenu",
|
type: "submenu",
|
||||||
icon: "iconRiffCard",
|
icon: "iconRiffCard",
|
||||||
submenu: [{
|
submenu: [{
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.spaceRepetition,
|
label: window.siyuan.languages.spaceRepetition,
|
||||||
accelerator: window.siyuan.config.keymap.general.riffCard.custom,
|
accelerator: window.siyuan.config.keymap.general.riffCard.custom,
|
||||||
click: () => {
|
click: () => {
|
||||||
openCard(app);
|
openCard(app);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.manage,
|
label: window.siyuan.languages.manage,
|
||||||
click: () => {
|
click: () => {
|
||||||
viewCards(app, "", window.siyuan.languages.all, "");
|
viewCards(app, "", window.siyuan.languages.all, "");
|
||||||
|
|
@ -455,7 +455,7 @@ const workspaceItem = (item: IWorkspace) => {
|
||||||
${originalPath().basename(item.path)}
|
${originalPath().basename(item.path)}
|
||||||
</div>`,
|
</div>`,
|
||||||
current: !item.closed,
|
current: !item.closed,
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
type: "submenu",
|
type: "submenu",
|
||||||
submenu: [{
|
submenu: [{
|
||||||
icon: "iconOpenWindow",
|
icon: "iconOpenWindow",
|
||||||
|
|
|
||||||
|
|
@ -514,13 +514,10 @@ export class Breadcrumb {
|
||||||
}
|
}
|
||||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
type: "readonly",
|
type: "readonly",
|
||||||
label: `<div class="fn__flex">${window.siyuan.languages.runeCount}<span class="fn__space fn__flex-1"></span>${response.data.runeCount}</div>
|
// 不能换行,否则移动端间距过大
|
||||||
<div class="fn__flex">${window.siyuan.languages.wordCount}<span class="fn__space fn__flex-1"></span>${response.data.wordCount}</div>
|
label: `<div class="fn__flex">${window.siyuan.languages.runeCount}<span class="fn__space fn__flex-1"></span>${response.data.runeCount}</div><div class="fn__flex">${window.siyuan.languages.wordCount}<span class="fn__space fn__flex-1"></span>${response.data.wordCount}</div><div class="fn__flex">${window.siyuan.languages.linkCount}<span class="fn__space fn__flex-1"></span>${response.data.linkCount}</div><div class="fn__flex">${window.siyuan.languages.imgCount}<span class="fn__space fn__flex-1"></span>${response.data.imageCount}</div><div class="fn__flex">${window.siyuan.languages.refCount}<span class="fn__space fn__flex-1"></span>${response.data.refCount}</div>`,
|
||||||
<div class="fn__flex">${window.siyuan.languages.linkCount}<span class="fn__space fn__flex-1"></span>${response.data.linkCount}</div>
|
|
||||||
<div class="fn__flex">${window.siyuan.languages.imgCount}<span class="fn__space fn__flex-1"></span>${response.data.imageCount}</div>
|
|
||||||
<div class="fn__flex">${window.siyuan.languages.refCount}<span class="fn__space fn__flex-1"></span>${response.data.refCount}</div>`,
|
|
||||||
}).element);
|
}).element);
|
||||||
/// #if MOBILE
|
/// #if MOBILE
|
||||||
window.siyuan.menus.menu.fullscreen();
|
window.siyuan.menus.menu.fullscreen();
|
||||||
|
|
|
||||||
|
|
@ -1683,7 +1683,7 @@ export class Gutter {
|
||||||
updateHTML = `${window.siyuan.languages.modifiedAt} ${dayjs(updateHTML).format("YYYY-MM-DD HH:mm:ss")}<br>`;
|
updateHTML = `${window.siyuan.languages.modifiedAt} ${dayjs(updateHTML).format("YYYY-MM-DD HH:mm:ss")}<br>`;
|
||||||
}
|
}
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
type: "readonly",
|
type: "readonly",
|
||||||
label: `${updateHTML}${window.siyuan.languages.createdAt} ${dayjs(id.substr(0, 14)).format("YYYY-MM-DD HH:mm:ss")}`,
|
label: `${updateHTML}${window.siyuan.languages.createdAt} ${dayjs(id.substr(0, 14)).format("YYYY-MM-DD HH:mm:ss")}`,
|
||||||
}).element);
|
}).element);
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
const riffCardMenu = [{
|
const riffCardMenu = [{
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.spaceRepetition,
|
label: window.siyuan.languages.spaceRepetition,
|
||||||
accelerator: window.siyuan.config.keymap.editor.general.spaceRepetition.custom,
|
accelerator: window.siyuan.config.keymap.editor.general.spaceRepetition.custom,
|
||||||
click: () => {
|
click: () => {
|
||||||
|
|
@ -121,7 +121,7 @@ export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.manage,
|
label: window.siyuan.languages.manage,
|
||||||
click: () => {
|
click: () => {
|
||||||
fetchPost("/api/filetree/getHPathByID", {
|
fetchPost("/api/filetree/getHPathByID", {
|
||||||
|
|
@ -131,7 +131,7 @@ export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.quickMakeCard,
|
label: window.siyuan.languages.quickMakeCard,
|
||||||
accelerator: window.siyuan.config.keymap.editor.general.quickMakeCard.custom,
|
accelerator: window.siyuan.config.keymap.editor.general.quickMakeCard.custom,
|
||||||
click: () => {
|
click: () => {
|
||||||
|
|
@ -146,7 +146,7 @@ export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
||||||
}];
|
}];
|
||||||
if (window.siyuan.config.flashcard.deck) {
|
if (window.siyuan.config.flashcard.deck) {
|
||||||
riffCardMenu.push({
|
riffCardMenu.push({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.addToDeck,
|
label: window.siyuan.languages.addToDeck,
|
||||||
click: () => {
|
click: () => {
|
||||||
makeCard(protyle.app, [protyle.block.rootID]);
|
makeCard(protyle.app, [protyle.block.rootID]);
|
||||||
|
|
@ -246,10 +246,10 @@ export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
|
||||||
}
|
}
|
||||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
type: "readonly",
|
type: "readonly",
|
||||||
label: `${window.siyuan.languages.modifiedAt} ${dayjs(response.data.ial.updated).format("YYYY-MM-DD HH:mm:ss")}<br>
|
// 不能换行,否则移动端间距过大
|
||||||
${window.siyuan.languages.createdAt} ${dayjs(response.data.ial.id.substr(0, 14)).format("YYYY-MM-DD HH:mm:ss")}`
|
label: `${window.siyuan.languages.modifiedAt} ${dayjs(response.data.ial.updated).format("YYYY-MM-DD HH:mm:ss")}<br>${window.siyuan.languages.createdAt} ${dayjs(response.data.ial.id.substr(0, 14)).format("YYYY-MM-DD HH:mm:ss")}`
|
||||||
}).element);
|
}).element);
|
||||||
/// #if MOBILE
|
/// #if MOBILE
|
||||||
window.siyuan.menus.menu.fullscreen();
|
window.siyuan.menus.menu.fullscreen();
|
||||||
|
|
|
||||||
|
|
@ -353,7 +353,7 @@ export const assetMethodMenu = (target: HTMLElement, cb: () => void) => {
|
||||||
window.siyuan.menus.menu.remove();
|
window.siyuan.menus.menu.remove();
|
||||||
window.siyuan.menus.menu.element.setAttribute("data-name", "searchAssetMethod");
|
window.siyuan.menus.menu.element.setAttribute("data-name", "searchAssetMethod");
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.keyword,
|
label: window.siyuan.languages.keyword,
|
||||||
current: method === 0,
|
current: method === 0,
|
||||||
click() {
|
click() {
|
||||||
|
|
@ -362,7 +362,7 @@ export const assetMethodMenu = (target: HTMLElement, cb: () => void) => {
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.querySyntax,
|
label: window.siyuan.languages.querySyntax,
|
||||||
current: method === 1,
|
current: method === 1,
|
||||||
click() {
|
click() {
|
||||||
|
|
@ -371,7 +371,7 @@ export const assetMethodMenu = (target: HTMLElement, cb: () => void) => {
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.regex,
|
label: window.siyuan.languages.regex,
|
||||||
current: method === 3,
|
current: method === 3,
|
||||||
click() {
|
click() {
|
||||||
|
|
@ -440,7 +440,7 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void)
|
||||||
window.siyuan.menus.menu.element.setAttribute("data-name", "searchAssetMore");
|
window.siyuan.menus.menu.element.setAttribute("data-name", "searchAssetMore");
|
||||||
const localData = window.siyuan.storage[Constants.LOCAL_SEARCHASSET];
|
const localData = window.siyuan.storage[Constants.LOCAL_SEARCHASSET];
|
||||||
const sortMenu = [{
|
const sortMenu = [{
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.sortByRankAsc,
|
label: window.siyuan.languages.sortByRankAsc,
|
||||||
current: localData.sort === 1,
|
current: localData.sort === 1,
|
||||||
click() {
|
click() {
|
||||||
|
|
@ -448,7 +448,7 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void)
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.sortByRankDesc,
|
label: window.siyuan.languages.sortByRankDesc,
|
||||||
current: localData.sort === 0,
|
current: localData.sort === 0,
|
||||||
click() {
|
click() {
|
||||||
|
|
@ -456,7 +456,7 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void)
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.modifiedASC,
|
label: window.siyuan.languages.modifiedASC,
|
||||||
current: localData.sort === 3,
|
current: localData.sort === 3,
|
||||||
click() {
|
click() {
|
||||||
|
|
@ -464,7 +464,7 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void)
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.modifiedDESC,
|
label: window.siyuan.languages.modifiedDESC,
|
||||||
current: localData.sort === 2,
|
current: localData.sort === 2,
|
||||||
click() {
|
click() {
|
||||||
|
|
@ -473,18 +473,18 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void)
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.sort,
|
label: window.siyuan.languages.sort,
|
||||||
type: "submenu",
|
type: "submenu",
|
||||||
submenu: sortMenu,
|
submenu: sortMenu,
|
||||||
}).element);
|
}).element);
|
||||||
/// #if !MOBILE
|
/// #if !MOBILE
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.layout,
|
label: window.siyuan.languages.layout,
|
||||||
type: "submenu",
|
type: "submenu",
|
||||||
submenu: [{
|
submenu: [{
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.topBottomLayout,
|
label: window.siyuan.languages.topBottomLayout,
|
||||||
current: localData.layout === 0,
|
current: localData.layout === 0,
|
||||||
click() {
|
click() {
|
||||||
|
|
@ -501,7 +501,7 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void)
|
||||||
setStorageVal(Constants.LOCAL_SEARCHASSET, window.siyuan.storage[Constants.LOCAL_SEARCHASSET]);
|
setStorageVal(Constants.LOCAL_SEARCHASSET, window.siyuan.storage[Constants.LOCAL_SEARCHASSET]);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.leftRightLayout,
|
label: window.siyuan.languages.leftRightLayout,
|
||||||
current: localData.layout === 1,
|
current: localData.layout === 1,
|
||||||
click() {
|
click() {
|
||||||
|
|
@ -521,7 +521,7 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void)
|
||||||
}).element);
|
}).element);
|
||||||
/// #endif
|
/// #endif
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.rebuildIndex,
|
label: window.siyuan.languages.rebuildIndex,
|
||||||
click() {
|
click() {
|
||||||
if (!isPaidUser()) {
|
if (!isPaidUser()) {
|
||||||
|
|
|
||||||
|
|
@ -699,11 +699,11 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
|
||||||
const localData = window.siyuan.storage[Constants.LOCAL_SEARCHKEYS];
|
const localData = window.siyuan.storage[Constants.LOCAL_SEARCHKEYS];
|
||||||
const isPopover = hasClosestByClassName(element, "b3-dialog__container");
|
const isPopover = hasClosestByClassName(element, "b3-dialog__container");
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.layout,
|
label: window.siyuan.languages.layout,
|
||||||
type: "submenu",
|
type: "submenu",
|
||||||
submenu: [{
|
submenu: [{
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.topBottomLayout,
|
label: window.siyuan.languages.topBottomLayout,
|
||||||
current: isPopover ? localData.layout === 0 : localData.layoutTab === 0,
|
current: isPopover ? localData.layout === 0 : localData.layoutTab === 0,
|
||||||
click() {
|
click() {
|
||||||
|
|
@ -724,7 +724,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
|
||||||
setStorageVal(Constants.LOCAL_SEARCHKEYS, window.siyuan.storage[Constants.LOCAL_SEARCHKEYS]);
|
setStorageVal(Constants.LOCAL_SEARCHKEYS, window.siyuan.storage[Constants.LOCAL_SEARCHKEYS]);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
iconHTML: Constants.ZWSP,
|
iconHTML: "",
|
||||||
label: window.siyuan.languages.leftRightLayout,
|
label: window.siyuan.languages.leftRightLayout,
|
||||||
current: isPopover ? localData.layout === 1 : localData.layoutTab === 1,
|
current: isPopover ? localData.layout === 1 : localData.layoutTab === 1,
|
||||||
click() {
|
click() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue