mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
🚨
This commit is contained in:
parent
1525c6c899
commit
02d709ccee
7 changed files with 10 additions and 11 deletions
|
|
@ -185,7 +185,7 @@ export const quickMakeCard = (nodeElement: Element[]) => {
|
||||||
deckID: Constants.QUICK_DECK_ID,
|
deckID: Constants.QUICK_DECK_ID,
|
||||||
blockIDs: ids
|
blockIDs: ids
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ export const openCard = () => {
|
||||||
decksHTML += `<option value="${deck.id}">${deck.name}</option>`;
|
decksHTML += `<option value="${deck.id}">${deck.name}</option>`;
|
||||||
});
|
});
|
||||||
fetchPost("/api/riff/getRiffDueCards", {deckID: ""}, (cardsResponse) => {
|
fetchPost("/api/riff/getRiffDueCards", {deckID: ""}, (cardsResponse) => {
|
||||||
openCardByData(cardsResponse.data, `<select class="b3-select">${decksHTML}</select>`)
|
openCardByData(cardsResponse.data, `<select class="b3-select">${decksHTML}</select>`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -189,7 +189,7 @@ export const openCardByData = (cardsData: ICard[], html = "") => {
|
||||||
});
|
});
|
||||||
const selectElement = dialog.element.querySelector("select");
|
const selectElement = dialog.element.querySelector("select");
|
||||||
if (!selectElement) {
|
if (!selectElement) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
selectElement.addEventListener("change", () => {
|
selectElement.addEventListener("change", () => {
|
||||||
fetchPost("/api/riff/getRiffDueCards", {deckID: selectElement.value}, (cardsChangeResponse) => {
|
fetchPost("/api/riff/getRiffDueCards", {deckID: selectElement.value}, (cardsChangeResponse) => {
|
||||||
|
|
@ -219,4 +219,4 @@ export const openCardByData = (cardsData: ICard[], html = "") => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ export const viewCards = (deckID: string, title: string, cb:(response:IWebSocket
|
||||||
nextElment.classList.add("b3-list-item--focus");
|
nextElment.classList.add("b3-list-item--focus");
|
||||||
}
|
}
|
||||||
target.parentElement.remove();
|
target.parentElement.remove();
|
||||||
cb(removeResponse)
|
cb(removeResponse);
|
||||||
});
|
});
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ export abstract class Constants {
|
||||||
fr_FR: "20210808180117-6v0mkxr",
|
fr_FR: "20210808180117-6v0mkxr",
|
||||||
};
|
};
|
||||||
|
|
||||||
public static readonly QUICK_DECK_ID = "20230218211946-2kw8jgx"
|
public static readonly QUICK_DECK_ID = "20230218211946-2kw8jgx";
|
||||||
|
|
||||||
public static readonly KEYCODE: { [key: string]: string[] } = {
|
public static readonly KEYCODE: { [key: string]: string[] } = {
|
||||||
"186": [";", ":"],
|
"186": [";", ":"],
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import {setStorageVal, writeText} from "../protyle/util/compatibility";
|
||||||
import {openCard} from "../card/openCard";
|
import {openCard} from "../card/openCard";
|
||||||
import {openSetting} from "../config";
|
import {openSetting} from "../config";
|
||||||
import {getAllDocks} from "../layout/getAll";
|
import {getAllDocks} from "../layout/getAll";
|
||||||
import {getDockByType, resizeTabs} from "../layout/util";
|
import {getDockByType} from "../layout/util";
|
||||||
import {lockScreen} from "../dialog/processSystem";
|
import {lockScreen} from "../dialog/processSystem";
|
||||||
import {showMessage} from "../dialog/message";
|
import {showMessage} from "../dialog/message";
|
||||||
import {unicode2Emoji} from "../emoji";
|
import {unicode2Emoji} from "../emoji";
|
||||||
|
|
|
||||||
|
|
@ -669,7 +669,7 @@ export class Gutter {
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
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,
|
||||||
iconHTML: `<svg class="b3-menu__icon" style="color:var(--b3-theme-primary)"><use xlink:href="#iconRiffCard"></use></svg>`,
|
iconHTML: "<svg class=\"b3-menu__icon\" style=\"color:var(--b3-theme-primary)\"><use xlink:href=\"#iconRiffCard\"></use></svg>",
|
||||||
icon: "iconRiffCard",
|
icon: "iconRiffCard",
|
||||||
click() {
|
click() {
|
||||||
quickMakeCard(selectsElement);
|
quickMakeCard(selectsElement);
|
||||||
|
|
@ -1442,7 +1442,7 @@ export class Gutter {
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
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,
|
||||||
iconHTML: `<svg class="b3-menu__icon" style="color:var(--b3-theme-primary)"><use xlink:href="#iconRiffCard"></use></svg>`,
|
iconHTML: "<svg class=\"b3-menu__icon\" style=\"color:var(--b3-theme-primary)\"><use xlink:href=\"#iconRiffCard\"></use></svg>",
|
||||||
icon: "iconRiffCard",
|
icon: "iconRiffCard",
|
||||||
click() {
|
click() {
|
||||||
quickMakeCard([nodeElement]);
|
quickMakeCard([nodeElement]);
|
||||||
|
|
|
||||||
|
|
@ -995,7 +995,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.quickMakeCard.custom, event)) {
|
if (matchHotKey(window.siyuan.config.keymap.editor.general.quickMakeCard.custom, event)) {
|
||||||
const selectElement: Element[] = []
|
const selectElement: Element[] = [];
|
||||||
nodeElement.classList.add("protyle-wysiwyg--select");
|
nodeElement.classList.add("protyle-wysiwyg--select");
|
||||||
let isRemove = true;
|
let isRemove = true;
|
||||||
const removeIds: string[] = [];
|
const removeIds: string[] = [];
|
||||||
|
|
@ -1012,7 +1012,6 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
fetchPost("/api/riff/removeRiffCards", {
|
fetchPost("/api/riff/removeRiffCards", {
|
||||||
deckID: Constants.QUICK_DECK_ID,
|
deckID: Constants.QUICK_DECK_ID,
|
||||||
blockIDs: removeIds
|
blockIDs: removeIds
|
||||||
}, (removeResponse) => {
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
quickMakeCard(selectElement);
|
quickMakeCard(selectElement);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue