Browse Source

:art: https://github.com/siyuan-note/siyuan/issues/7697

Vanessa 2 years ago
parent
commit
3db0b0cf94

+ 2 - 0
app/appearance/langs/en_US.json

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

+ 2 - 0
app/appearance/langs/es_ES.json

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

+ 2 - 0
app/appearance/langs/fr_FR.json

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

+ 2 - 0
app/appearance/langs/zh_CHT.json

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

+ 2 - 0
app/appearance/langs/zh_CN.json

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

+ 4 - 4
app/src/assets/scss/business/_card.scss

@@ -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;

+ 16 - 4
app/src/card/openCard.ts

@@ -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");
                 }