aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/CurrentUserUtils.ts
diff options
context:
space:
mode:
authorgeireann <>2022-03-17 15:47:22 -0400
committergeireann <>2022-03-17 15:47:22 -0400
commit73ba1a0395167ab5949f71d0c82fa7188d37ab5c (patch)
tree101251328b31c1532595e33bbde389157c69f868 /src/client/util/CurrentUserUtils.ts
parent5a385e46937a2f79d557b4ee929e78ba78aca8bf (diff)
removed buxton importer stuff. removed libxmljs needed by buxtonimporter which was breaking npm install
Diffstat (limited to 'src/client/util/CurrentUserUtils.ts')
-rw-r--r--src/client/util/CurrentUserUtils.ts56
1 files changed, 1 insertions, 55 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index c7f293f2c..f02c5a5a1 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -1,4 +1,5 @@
import { computed, observable, reaction } from "mobx";
+import * as rp from 'request-promise';
import { DataSym, Doc, DocListCast, DocListCastAsync } from "../../fields/Doc";
import { Id } from "../../fields/FieldSymbols";
import { InkTool } from "../../fields/InkField";
@@ -6,7 +7,6 @@ import { List } from "../../fields/List";
import { PrefetchProxy } from "../../fields/Proxy";
import { RichTextField } from "../../fields/RichTextField";
import { listSpec } from "../../fields/Schema";
-import { SchemaHeaderField } from "../../fields/SchemaHeaderField";
import { ComputedField, ScriptField } from "../../fields/ScriptField";
import { BoolCast, Cast, DateCast, NumCast, PromiseValue, StrCast } from "../../fields/Types";
import { nullAudio } from "../../fields/URLField";
@@ -36,7 +36,6 @@ import { ColorScheme } from "./SettingsManager";
import { SharingManager } from "./SharingManager";
import { SnappingManager } from "./SnappingManager";
import { UndoManager } from "./UndoManager";
-import * as rp from 'request-promise';
interface Button {
title?: string;
@@ -191,59 +190,6 @@ export class CurrentUserUtils {
// });
// }
- if (doc["template-button-detail"] === undefined) {
- const { TextDocument, MasonryDocument, CarouselDocument } = Docs.Create;
-
- const openInTarget = ScriptField.MakeScript("openOnRight(self.doubleClickView)");
- const carousel = CarouselDocument([], {
- title: "data", _height: 350, _itemIndex: 0, "_carousel-caption-xMargin": 10, "_carousel-caption-yMargin": 10,
- onChildDoubleClick: openInTarget, backgroundColor: "#9b9b9b3F", system: true
- });
-
- const details = TextDocument("", { title: "details", _height: 200, _autoHeight: true, system: true });
- const short = TextDocument("", { title: "shortDescription", treeViewOpen: true, treeViewExpandedView: "layout", _height: 75, _autoHeight: true, system: true });
- const long = TextDocument("", { title: "longDescription", treeViewOpen: false, treeViewExpandedView: "layout", _height: 150, _autoHeight: true, system: true });
-
- const buxtonFieldKeys = ["year", "originalPrice", "degreesOfFreedom", "company", "attribute", "primaryKey", "secondaryKey", "dimensions"];
- const detailedTemplate = {
- doc: {
- type: "doc", content: buxtonFieldKeys.map(fieldKey => ({
- type: "paragraph",
- content: [{ type: "dashField", attrs: { fieldKey } }]
- }))
- },
- selection: { type: "text", anchor: 1, head: 1 },
- storedMarks: []
- };
- details.text = new RichTextField(JSON.stringify(detailedTemplate), buxtonFieldKeys.join(" "));
-
- const shared = { _autoHeight: true, _xMargin: 0 };
- const detailViewOpts = { title: "detailView", _width: 300, _fontFamily: "Arial", _fontSize: "12px" };
- const descriptionWrapperOpts = { title: "descriptions", _height: 300, _columnWidth: -1, treeViewHideTitle: true, _pivotField: "title", system: true };
-
- const descriptionWrapper = MasonryDocument([details, short, long], { ...shared, ...descriptionWrapperOpts });
- descriptionWrapper._columnHeaders = new List<SchemaHeaderField>([
- new SchemaHeaderField("[A Short Description]", "dimgray", undefined, undefined, undefined, false),
- new SchemaHeaderField("[Long Description]", "dimgray", undefined, undefined, undefined, true),
- new SchemaHeaderField("[Details]", "dimgray", undefined, undefined, undefined, true),
- ]);
- const detailView = Docs.Create.StackingDocument([carousel, descriptionWrapper], { ...shared, ...detailViewOpts, _chromeHidden: true, system: true });
- detailView.isTemplateDoc = makeTemplate(detailView);
-
- details.title = "Details";
- short.title = "A Short Description";
- long.title = "Long Description";
-
- doc["template-button-detail"] = CurrentUserUtils.createToolButton({
- onDragStart: ScriptField.MakeFunction('copyDragFactory(this.dragFactory)'),
- dragFactory: new PrefetchProxy(detailView) as any as Doc,
- title: "detailView",
- icon: "window-maximize",
- system: true,
- btnType: ButtonType.ToolButton,
- });
- }
-
const requiredTypes = [
doc["template-button-slides"] as Doc,
doc["template-mobile-button"] as Doc,