Procházet zdrojové kódy

:art: fix https://github.com/siyuan-note/siyuan/issues/10452

Vanessa před 1 rokem
rodič
revize
a5ce4139a6

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

@@ -1,4 +1,5 @@
 {
 {
+  "noSupportTip": "This function does not support the use of card packages",
   "insertRowTip": "The newly added rows have been filtered and can be viewed by canceling filtering/searching/sorting",
   "insertRowTip": "The newly added rows have been filtered and can be viewed by canceling filtering/searching/sorting",
   "insertRowTip2": "New rows do not participate in sorting",
   "insertRowTip2": "New rows do not participate in sorting",
   "insertPhoto": "Take a photo and insert it",
   "insertPhoto": "Take a photo and insert it",

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

@@ -1,4 +1,5 @@
 {
 {
+  "noSupportTip": "Esta función no admite el uso de paquetes de tarjetas",
   "insertRowTip": "Las filas recién agregadas se han filtrado y se pueden ver cancelando el filtrado/búsqueda/clasificación",
   "insertRowTip": "Las filas recién agregadas se han filtrado y se pueden ver cancelando el filtrado/búsqueda/clasificación",
   "insertRowTip2": "Las filas nuevas no participan en la clasificación",
   "insertRowTip2": "Las filas nuevas no participan en la clasificación",
   "insertPhoto": "Toma una foto e insértala",
   "insertPhoto": "Toma una foto e insértala",

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

@@ -1,4 +1,5 @@
 {
 {
+  "noSupportTip": "Cette fonction ne prend pas en charge l'utilisation de packages de cartes",
   "insertRowTip": "Les lignes nouvellement ajoutées ont été filtrées et peuvent être visualisées en annulant le filtrage/recherche/tri",
   "insertRowTip": "Les lignes nouvellement ajoutées ont été filtrées et peuvent être visualisées en annulant le filtrage/recherche/tri",
   "insertRowTip2": "Les nouvelles lignes ne participent pas au tri",
   "insertRowTip2": "Les nouvelles lignes ne participent pas au tri",
   "insertPhoto": "Prendre une photo et l'insérer",
   "insertPhoto": "Prendre une photo et l'insérer",

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

@@ -1,4 +1,5 @@
 {
 {
+  "noSupportTip": "此功能暫不支援卡包使用",
   "insertRowTip": "新增行已被過濾,可取消過濾/搜尋/排序進行查看",
   "insertRowTip": "新增行已被過濾,可取消過濾/搜尋/排序進行查看",
   "insertRowTip2": "新增行不參與排序",
   "insertRowTip2": "新增行不參與排序",
   "insertPhoto": "拍照並插入",
   "insertPhoto": "拍照並插入",

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

@@ -1,4 +1,5 @@
 {
 {
+  "noSupportTip": "该功能暂不支持卡包使用",
   "insertRowTip": "新增行已被过滤,可取消过滤/搜索/排序进行查看",
   "insertRowTip": "新增行已被过滤,可取消过滤/搜索/排序进行查看",
   "insertRowTip2": "新增行不参与排序",
   "insertRowTip2": "新增行不参与排序",
   "insertPhoto": "拍照并插入",
   "insertPhoto": "拍照并插入",

+ 51 - 0
app/src/card/openCard.ts

@@ -265,6 +265,57 @@ export const bindCardEvent = async (options: {
                 event.preventDefault();
                 event.preventDefault();
                 return;
                 return;
             }
             }
+            const moreElement = hasClosestByAttribute(target, "data-type", "more");
+            if (moreElement) {
+                event.stopPropagation();
+                event.preventDefault();
+                if (filterElement.getAttribute("data-cardtype") === "all") {
+                    showMessage(window.siyuan.languages.noSupportTip);
+                    return;
+                }
+                const menu = new Menu();
+                menu.addItem({
+                    icon: "iconClock",
+                    label: window.siyuan.languages.updatedTime,
+                    click() {
+
+                    }
+                })
+                menu.addItem({
+                    icon: "iconRefresh",
+                    label: window.siyuan.languages.reset,
+                    click() {
+
+                    }
+                })
+                menu.addItem({
+                    icon: "iconTrashcan",
+                    label: `${window.siyuan.languages.remove} <b>${window.siyuan.languages.riffCard}</b>`,
+                    click() {
+                        actionElements[0].classList.add("fn__none");
+                        actionElements[1].classList.remove("fn__none");
+                        if (options.cardsData.cards[index].state === 0) {
+                            options.cardsData.unreviewedNewCardCount--;
+                        } else  {
+                            options.cardsData.unreviewedOldCardCount--;
+                        }
+                        options.element.dispatchEvent(new CustomEvent("click", {detail: "0"}));
+                        transaction(undefined, [{
+                            action: "removeFlashcards",
+                            deckID: Constants.QUICK_DECK_ID,
+                            blockIDs: [options.cardsData.cards[index].blockID]
+                        }]);
+                        options.cardsData.cards.splice(index, 1);
+                        index--;
+                    }
+                })
+                const rect = target.getBoundingClientRect();
+                menu.open({
+                    x: rect.left,
+                    y: rect.bottom
+                });
+                return;
+            }
             /// #if !MOBILE
             /// #if !MOBILE
             const sticktabElement = hasClosestByAttribute(target, "data-type", "sticktab");
             const sticktabElement = hasClosestByAttribute(target, "data-type", "sticktab");
             if (sticktabElement) {
             if (sticktabElement) {