Vanessa 2023-03-19 14:50:08 +08:00
parent 41e0d66d22
commit 3db0b0cf94
7 changed files with 30 additions and 8 deletions

View file

@ -1,4 +1,6 @@
{
"skip": "Skip",
"reboot": "Reboot",
"saveLayout": "Save Layout",
"ai": "Artificial Intelligence",
"aiContinueWrite": "Continue writing",

View file

@ -1,4 +1,6 @@
{
"skip": "barco",
"reboot": "Reiniciar",
"saveLayout": "Guardar diseño",
"ai": "Inteligencia Artificial",
"aiContinueWrite": "Continuar escribiendo",

View file

@ -1,4 +1,6 @@
{
"skip": "Navire",
"reboot": "Redémarrer",
"saveLayout": "Enregistrer la mise en page",
"ai": "Intelligence Artificielle",
"aiContinueWrite": "Continuer à écrire",

View file

@ -1,4 +1,6 @@
{
"skip": "跳過",
"reboot": "重啟",
"saveLayout": "保存佈局",
"ai": "人工智能",
"aiContinueWrite": "續寫",

View file

@ -1,4 +1,6 @@
{
"skip": "跳过",
"reboot": "重启",
"saveLayout": "保存布局",
"ai": "人工智能",
"aiContinueWrite": "续写",

View file

@ -15,13 +15,12 @@
}
&__action {
padding: 8px 16px;
padding: 8px 4px;
.b3-button {
padding: 8px;
padding: 8px 0;
display: block;
margin: 0 auto;
width: 90%;
width: 100%;
& > div {
font-size: 32px;
@ -33,6 +32,7 @@
& > div {
flex: 1;
margin: 0 4px;
& > span {
display: flex;

View file

@ -58,6 +58,13 @@ export const openCardByData = (cardsData: ICard[], html = "") => {
<button data-type="-1" class="b3-button fn__flex-1">${window.siyuan.languages.cardShowAnswer} (${window.siyuan.languages.space})</button>
</div>
<div class="fn__flex card__action fn__none">
<div>
<span>${window.siyuan.languages.reboot}</span>
<button data-type="-3" aria-label="0" class="b3-button b3-button--error b3-tooltips__s b3-tooltips">
<div>💤</div>
${window.siyuan.languages.skip} (0)
</button>
</div>
<div>
<span></span>
<button data-type="0" aria-label="1 / j" class="b3-button b3-button--error b3-tooltips__s b3-tooltips">
@ -137,6 +144,8 @@ export const openCardByData = (cardsData: ICard[], html = "") => {
type = "-1";
} else if (event.detail === "p") {
type = "-2";
} else if (event.detail === "0") {
type = "-3";
}
}
if (!type) {
@ -158,7 +167,9 @@ export const openCardByData = (cardsData: ICard[], html = "") => {
editor.protyle.element.classList.remove("card__block--hide");
actionElements[0].classList.add("fn__none");
actionElements[1].querySelectorAll(".b3-button").forEach((element, btnIndex) => {
element.previousElementSibling.textContent = blocks[index].nextDues[btnIndex];
if (btnIndex !== 0) {
element.previousElementSibling.textContent = blocks[index].nextDues[btnIndex - 1];
}
});
actionElements[1].classList.remove("fn__none");
return;
@ -180,14 +191,15 @@ export const openCardByData = (cardsData: ICard[], html = "") => {
}
return;
}
if (["0", "1", "2", "3"].includes(type) && actionElements[0].classList.contains("fn__none")) {
fetchPost("/api/riff/reviewRiffCard", {
if (["0", "1", "2", "3", "-3"].includes(type) && actionElements[0].classList.contains("fn__none")) {
fetchPost(type === "-3" ? "/api/riff/skipReviewRiffCard" : "/api/riff/reviewRiffCard", {
deckID: blocks[index].deckID,
cardID: blocks[index].cardID,
rating: parseInt(type)
}, () => {
/// #if MOBILE
if ((0 !== window.siyuan.config.sync.provider || (0 === window.siyuan.config.sync.provider && !needSubscribe(""))) &&
if (type !== "-3" &&
(0 !== window.siyuan.config.sync.provider || (0 === window.siyuan.config.sync.provider && !needSubscribe(""))) &&
window.siyuan.config.repo.key && window.siyuan.config.sync.enabled) {
document.getElementById("toolbarSync").classList.remove("fn__none");
}