From cea108a2f0b4a64fedb523a415a1d586ca8d126d Mon Sep 17 00:00:00 2001 From: sharkiecodes Date: Fri, 6 Jun 2025 11:10:14 -0400 Subject: clean-up p2 --- .../views/nodes/scrapbook/scrapbookleftover.ts | 42 ---------------------- 1 file changed, 42 deletions(-) delete mode 100644 src/client/views/nodes/scrapbook/scrapbookleftover.ts (limited to 'src') diff --git a/src/client/views/nodes/scrapbook/scrapbookleftover.ts b/src/client/views/nodes/scrapbook/scrapbookleftover.ts deleted file mode 100644 index ee7a858e4..000000000 --- a/src/client/views/nodes/scrapbook/scrapbookleftover.ts +++ /dev/null @@ -1,42 +0,0 @@ - //DocListCast(this.Document.items).map(doc => DocListCast(doc[Doc.LayoutDataKey(doc)]) - - if (placeholder) { - /**Look at the autotags and see what matches*RTFCast(d[Doc.LayoutDataKey(d)])?.Text*/ - // ugh. we have to tell the underlying view not to add the Doc so that we can add it where we want it. - // However, returning 'false' triggers an undo. so this settimeout is needed to make the assignment happen after the undo. - setTimeout( - undoable(() => { - - const slotTagsList: Set[] = placeholder.map(doc => - new Set(StrListCast(doc.$tags_chat)) - ); - // turn docs[0].$tags_chat into a Set - const targetTags = new Set(StrListCast(docs[0].$tags_chat)); - - //StrListCast(placeholder.overrideFields).map(field => (docs[0][field] = placeholder[field])); - // // // shouldn't need to do this for layout fields since the placeholder already overrides its protos - - // find the first placeholder that shares *any* tag - const match = placeholder.find(ph => - ph.accepts_tagType != null && // make sure it actually has one - targetTags.has(StrCast(ph.accepts_tagType)) // test membership in the Set - //StrListCast(ph.$tags_chat).some(tag => targetTags.has(tag)) - ); - if (match) { - match.proto = docs[0]; - } - - /*const chosenPlaceholder = placeholder.find(d => - pl = new Set(StrListCast(d.$tags_chat) - - d.$tags_chat && d.$tags_chat[0].equals(docs[0].$tags_chat)); //why [0] - if (chosenPlaceholder){ - chosenPlaceholder.proto = docs[0];}*/ - //excess if statement?? - }, 'Scrapbook add') - ); - return false; - } - } - return false; - }; \ No newline at end of file -- cgit v1.2.3-70-g09d2