aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-05-15 07:31:10 -0400
committerbobzel <zzzman@gmail.com>2024-05-15 07:31:10 -0400
commit8c4e20892671946012d28a1db78a2ac63bb369fc (patch)
tree369ad9b06cc88720cc72a5ff7c971e4e685b69a4
parent9e40cc8cf9e6ebbe44fa0f600fb1b134d14cd827 (diff)
removing console logs, unused code and text color changing
-rw-r--r--src/client/util/DocumentManager.ts4
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormPannableContents.tsx2
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx41
-rw-r--r--src/client/views/global/globalScripts.ts4
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx24
5 files changed, 0 insertions, 75 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 8b4fec20f..4b4422a40 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -282,7 +282,6 @@ export class DocumentManager {
};
if (rootContextView) {
- // try commenting out
const target = await this.focusViewsInPath(rootContextView, options, childViewIterator);
this.restoreDocView(target.viewSpec, target.docView, options, target.contextView ?? target.docView, targetDoc);
finished?.(target.focused);
@@ -296,9 +295,7 @@ export class DocumentManager {
) => {
let contextView: DocumentView | undefined; // view containing context that contains target
let focused = false;
- let count = 0;
while (true) {
- console.log('Count: ', count);
if (docView.Document.layout_fieldKey === 'layout_icon') {
await new Promise<void>(res => docView.iconify(res));
options.didMove = true;
@@ -309,7 +306,6 @@ export class DocumentManager {
if (!childDocView) return { viewSpec: options.anchorDoc ?? viewSpec ?? docView.Document, docView, contextView, focused };
contextView = options.anchorDoc?.layout_unrendered && !childDocView.Document.layout_unrendered ? childDocView : docView;
docView = childDocView;
- count += 1;
}
};
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormPannableContents.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormPannableContents.tsx
index a140dd4b1..69cbae86f 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormPannableContents.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormPannableContents.tsx
@@ -40,8 +40,6 @@ export class CollectionFreeFormPannableContents extends React.Component<Collecti
);
render() {
- console.log('transofmr', this.props.transform());
- console.log('transition', this.props.transition);
return (
<div
className={'collectionfreeformview' + (this.props.viewDefDivClick ? '-viewDef' : '-none')}
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 88fe10bfd..45edeafb6 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1658,44 +1658,6 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
}
};
- printDoc = (doc: Doc) => {
- console.log('Printing keys');
- Object.keys(doc).forEach(key => {
- console.log(key, ':', doc[key]);
- });
- };
-
- @action
- openProperties = () => {
- SettingsManager.Instance.propertiesWidth = 300;
- };
-
- choosePath(url: URL) {
- if (!url?.href) return '';
- const lower = url.href.toLowerCase();
- if (url.protocol === 'data') return url.href;
- if (url.href.indexOf(window.location.origin) === -1 && url.href.indexOf('dashblobstore') === -1) return Utils.CorsProxy(url.href);
- if (!/\.(png|jpg|jpeg|gif|webp)$/.test(lower)) return `/assets/unknown-file-icon-hi.png`;
-
- const ext = extname(url.href);
- return url.href.replace(ext, '_m' + ext);
- }
-
- @action
- smartLayout = async () => {};
-
- roundToRoundNumber = (num: number) => {
- return Math.round(num / 10) * 10;
- };
-
- // gpt layout
- @action
- gptLayout = async () => {};
-
- // gpt styling
- @action
- gptStyling = async () => {};
-
onContextMenu = (e: React.MouseEvent) => {
if (this._props.isAnnotationOverlay || !ContextMenu.Instance) return;
@@ -1725,9 +1687,6 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
optionItems.push({ description: (this._showAnimTimeline ? 'Close' : 'Open') + ' Animation Timeline', event: action(() => (this._showAnimTimeline = !this._showAnimTimeline)), icon: 'eye' });
this._props.renderDepth && optionItems.push({ description: 'Use Background Color as Default', event: () => (Cast(Doc.UserDoc().emptyCollection, Doc, null).backgroundColor = StrCast(this.layoutDoc.backgroundColor)), icon: 'palette' });
this._props.renderDepth && optionItems.push({ description: 'Fit Content Once', event: this.fitContentOnce, icon: 'object-group' });
- // Want to condense into a Smart Organize button
- this._props.renderDepth && optionItems.push({ description: 'Style with AI', event: this.gptStyling, icon: 'paint-brush' });
- this._props.renderDepth && optionItems.push({ description: 'Smart Layout', event: this.gptLayout, icon: 'object-group' });
// this._props.renderDepth && optionItems.push({ description: 'Smart Organize', event: this.smartOrganize, icon: 'object-group' });
if (!Doc.noviceMode) {
optionItems.push({ description: (!Doc.NativeWidth(this.layoutDoc) || !Doc.NativeHeight(this.layoutDoc) ? 'Freeze' : 'Unfreeze') + ' Aspect', event: this.toggleNativeDimensions, icon: 'snowflake' });
diff --git a/src/client/views/global/globalScripts.ts b/src/client/views/global/globalScripts.ts
index 8000cce29..2a5732708 100644
--- a/src/client/views/global/globalScripts.ts
+++ b/src/client/views/global/globalScripts.ts
@@ -33,10 +33,6 @@ ScriptingGlobals.add(function setView(view: string) {
selected ? (selected._type_collection = view) : console.log('[FontIconBox.tsx] changeView failed');
});
-ScriptingGlobals.add(function setSettingBgColor(isSetting: boolean) {
- Doc.UserDoc().settingBgColor = isSetting;
-});
-
// toggle: Set overlay status of selected document
ScriptingGlobals.add(function setBackgroundColor(color?: string, checkResult?: boolean) {
const selectedViews = SelectionManager.Views;
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index 34f03399a..94227a927 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -67,8 +67,6 @@ import { RichTextMenu, RichTextMenuPlugin } from './RichTextMenu';
import { RichTextRules } from './RichTextRules';
import { schema } from './schema_rts';
import { SummaryView } from './SummaryView';
-import { isDarkMode } from '../../../util/reportManager/reportManagerUtils';
-import Select from 'react-select';
// import * as applyDevTools from 'prosemirror-dev-tools';
interface FormattedTextBoxProps extends FieldViewProps {
@@ -1201,24 +1199,6 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FormattedTextB
return Doc.NativeAspect(this.Document, this.dataDoc, false) ? this._props.NativeDimScaling?.() || 1 : 1;
}
- @action
- checkBackgroundColor() {
- console.log('checking bg color 1');
- if (BoolCast(Doc.UserDoc().settingBgColor)) return;
- console.log('checking bg color 2');
- let fontColor = '#000000';
- if (isDarkMode(StrCast(this.Document._backgroundColor))) {
- fontColor = '#ffffff';
- }
- // set text to white
- if (!this._editorView) return;
- const tr = this._editorView?.state.tr;
-
- tr.setSelection(TextSelection.create(tr.doc, 0, tr.doc.content.size));
- tr.addMark(0, tr.doc.content.size, schema.marks.pFontColor.create({ color: fontColor }));
- this._editorView.dispatch(tr);
- }
-
componentDidMount() {
!this._props.dontSelectOnLoad && this._props.setContentViewBox?.(this); // this tells the DocumentView that this AudioBox is the "content" of the document. this allows the DocumentView to indirectly call getAnchor() on the AudioBox when making a link.
this._cachedLinks = LinkManager.Links(this.Document);
@@ -1241,10 +1221,6 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FormattedTextB
({ width, scrollHeight, layout_autoHeight }) => width && layout_autoHeight && this.resetNativeHeight(scrollHeight),
{ fireImmediately: true }
);
- this._disposers.bgColor = reaction(
- () => this.Document._backgroundColor,
- color => this.checkBackgroundColor()
- );
this._disposers.componentHeights = reaction(
// set the document height when one of the component heights changes and layout_autoHeight is on
() => ({ sidebarHeight: this.sidebarHeight, textHeight: this.textHeight, layout_autoHeight: this.layout_autoHeight, marginsHeight: this.layout_autoHeightMargins }),