aboutsummaryrefslogtreecommitdiff
path: root/src/client/views
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views')
-rw-r--r--src/client/views/collections/CollectionCardDeckView.scss2
-rw-r--r--src/client/views/collections/CollectionCardDeckView.tsx4
-rw-r--r--src/client/views/global/globalScripts.ts42
3 files changed, 25 insertions, 23 deletions
diff --git a/src/client/views/collections/CollectionCardDeckView.scss b/src/client/views/collections/CollectionCardDeckView.scss
index a089b248d..8a721a626 100644
--- a/src/client/views/collections/CollectionCardDeckView.scss
+++ b/src/client/views/collections/CollectionCardDeckView.scss
@@ -28,7 +28,7 @@
// width: 300px;
background-color: rgb(218, 218, 218); /* Background color of the container */
border-radius: 50px; /* Rounds the corners of the container */
- transform: translateY(75px);
+ transform: translateY(25px);
// box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Optional: Adds shadow for depth */
align-items: center; /* Centers buttons vertically */
justify-content: start; /* Centers buttons horizontally */
diff --git a/src/client/views/collections/CollectionCardDeckView.tsx b/src/client/views/collections/CollectionCardDeckView.tsx
index 0ca3c5a44..127c4dc48 100644
--- a/src/client/views/collections/CollectionCardDeckView.tsx
+++ b/src/client/views/collections/CollectionCardDeckView.tsx
@@ -254,8 +254,8 @@ export class CollectionCardView extends CollectionSubView() {
} // prettier-ignore
})();
- console.log(ClientUtils.hexToHsv(StrCast(docA.backgroundColor)) ?? 9999 + "docA col")
- console.log(ClientUtils.hexToHsv(StrCast(docB.backgroundColor)) ?? 9999 + "docB col")
+ // console.log(ClientUtils.hexToHsv(StrCast(docA.backgroundColor)) ?? 9999 + "docA col")
+ // console.log(ClientUtils.hexToHsv(StrCast(docB.backgroundColor)) ?? 9999 + "docB col")
const out = typeA < typeB ? -1 : typeA > typeB ? 1 : 0;
diff --git a/src/client/views/global/globalScripts.ts b/src/client/views/global/globalScripts.ts
index 7730ed385..107e21e08 100644
--- a/src/client/views/global/globalScripts.ts
+++ b/src/client/views/global/globalScripts.ts
@@ -135,10 +135,10 @@ ScriptingGlobals.add(function toggleOverlay(checkResult?: boolean) {
});
// eslint-disable-next-line prefer-arrow-callback
-ScriptingGlobals.add(function showFreeform(attr: 'center' | 'grid' | 'snaplines' | 'clusters' | 'viewAll' | 'fitOnce', checkResult?: boolean, persist?: boolean) {
+ScriptingGlobals.add(function showFreeform(attr: 'center' | 'grid' | 'snaplines' | 'clusters' | 'viewAll' | 'fitOnce', checkResult?: boolean, persist?: boolean, ) {
const selected = DocumentView.SelectedDocs().lastElement();
// prettier-ignore
- const map: Map<'flashcards' | 'center' | 'grid' | 'snaplines' | 'clusters' | 'arrange' | 'viewAll' | 'fitOnce' | 'time' | 'docType' | 'color' | 'links' | 'like' | 'star' | 'idea' | 'chat' | '1' | '2' | '3' | '4',
+ const map: Map<'flashcards' | 'center' | 'grid' | 'snaplines' | 'clusters' | 'arrange' | 'viewAll' | 'fitOnce' | "Time" | "Type"| "Color"| "ChatGPT"| "Custom 1"| "Custom 2"| "Custom 3" ,
{
waitForRender?: boolean;
checkResult: (doc: Doc) => any;
@@ -173,48 +173,49 @@ ScriptingGlobals.add(function showFreeform(attr: 'center' | 'grid' | 'snaplines'
checkResult: (doc: Doc) => BoolCast(Doc.UserDoc().defaultToFlashcards, false),
setDoc: (doc: Doc, dv: DocumentView) => Doc.UserDoc().defaultToFlashcards = !Doc.UserDoc().defaultToFlashcards,
}],
- ['time', {
- checkResult: (doc: Doc) => StrCast(doc?.cardSort) === "time",
+ ['Time', {
+ checkResult: (doc: Doc) => {StrCast(doc?.cardSort);
+ console.log(StrCast(doc?.cardSort + "card sort"))},
setDoc: (doc: Doc, dv: DocumentView) => doc.cardSort = "time",
}],
- ['docType', {
- checkResult: (doc: Doc) => StrCast(doc?.cardSort) === "type",
+ ['Type', {
+ checkResult: (doc: Doc) => StrCast(doc?.cardSort),
setDoc: (doc: Doc, dv: DocumentView) => doc.cardSort = "type",
}],
- ['color', {
- checkResult: (doc: Doc) => StrCast(doc?.cardSort) === "color",
+ ['Color', {
+ checkResult: (doc: Doc) => StrCast(doc?.cardSort),
setDoc: (doc: Doc, dv: DocumentView) => doc.cardSort = "color",
}],
- ['links', {
- checkResult: (doc: Doc) => StrCast(doc?.cardSort) === "links",
- setDoc: (doc: Doc, dv: DocumentView) => doc.cardSort = "links",
- }],
- ['like', {
- checkResult: (doc: Doc) => StrCast(doc?.cardSort) === "custom" && StrCast(doc?.cardSort_customField) === "like",
+ // ['links', {
+ // checkResult: (doc: Doc) => StrCast(doc?.cardSort) === "links",
+ // setDoc: (doc: Doc, dv: DocumentView) => doc.cardSort = "links",
+ // }],
+ ['Custom 1', {
+ checkResult: (doc: Doc) => StrCast(doc?.cardSort) + " 1",
setDoc: (doc: Doc, dv: DocumentView) => {
doc.cardSort = "custom";
doc.cardSort_customField = "like";
doc.cardSort_visibleSortGroups = new List<number>();
}
}],
- ['star', {
- checkResult: (doc: Doc) => StrCast(doc?.cardSort) === "custom" && StrCast(doc?.cardSort_customField) === "star",
+ ['Custom 2', {
+ checkResult: (doc: Doc) => StrCast(doc?.cardSort) + " 2",
setDoc: (doc: Doc, dv: DocumentView) => {
doc.cardSort = "custom";
doc.cardSort_customField = "star";
doc.cardSort_visibleSortGroups = new List<number>();
}
}],
- ['idea', {
- checkResult: (doc: Doc) => StrCast(doc?.cardSort) === "custom" && StrCast(doc?.cardSort_customField) === "idea",
+ ['Custom 3', {
+ checkResult: (doc: Doc) => StrCast(doc?.cardSort) + " 3",
setDoc: (doc: Doc, dv: DocumentView) => {
doc.cardSort = "custom";
doc.cardSort_customField = "idea";
doc.cardSort_visibleSortGroups = new List<number>();
}
}],
- ['chat', {
- checkResult: (doc: Doc) => StrCast(doc?.cardSort) === "custom" && StrCast(doc?.cardSort_customField) === "chat",
+ ['ChatGPT', {
+ checkResult: (doc: Doc) => StrCast(doc?.cardSort_customField),
setDoc: (doc: Doc, dv: DocumentView) => {
doc.cardSort = "custom";
doc.cardSort_customField = "chat";
@@ -233,6 +234,7 @@ ScriptingGlobals.add(function showFreeform(attr: 'center' | 'grid' | 'snaplines'
}
if (checkResult) {
+ console.log("HIIIIII")
return map.get(attr)?.checkResult(selected);
}
const batch = map.get(attr)?.waitForRender ? UndoManager.StartBatch('set freeform attribute') : { end: () => {} };