diff options
-rw-r--r-- | src/client/documents/Documents.ts | 14 | ||||
-rw-r--r-- | src/client/views/collections/CollectionPivotView.tsx | 2 | ||||
-rw-r--r-- | src/client/views/collections/CollectionTreeView.tsx | 6 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 10 | ||||
-rw-r--r-- | src/scraping/buxton/scraper.py | 4 |
5 files changed, 22 insertions, 14 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 821185518..91085cd0f 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -673,28 +673,28 @@ export namespace Docs { const field = target[fieldKey]; const resolved = options || {}; if (field instanceof ImageField) { - created = Docs.Create.ImageDocument((field as ImageField).url.href, resolved); + created = Docs.Create.ImageDocument((field).url.href, resolved); layout = ImageBox.LayoutString; } else if (field instanceof Doc) { created = field; } else if (field instanceof VideoField) { - created = Docs.Create.VideoDocument((field as VideoField).url.href, resolved); + created = Docs.Create.VideoDocument((field).url.href, resolved); layout = VideoBox.LayoutString; } else if (field instanceof PdfField) { - created = Docs.Create.PdfDocument((field as PdfField).url.href, resolved); + created = Docs.Create.PdfDocument((field).url.href, resolved); layout = PDFBox.LayoutString; } else if (field instanceof IconField) { - created = Docs.Create.IconDocument((field as IconField).icon, resolved); + created = Docs.Create.IconDocument((field).icon, resolved); layout = IconBox.LayoutString; } else if (field instanceof AudioField) { - created = Docs.Create.AudioDocument((field as AudioField).url.href, resolved); + created = Docs.Create.AudioDocument((field).url.href, resolved); layout = AudioBox.LayoutString; } else if (field instanceof HistogramField) { - created = Docs.Create.HistogramDocument((field as HistogramField).HistoOp, resolved); + created = Docs.Create.HistogramDocument((field).HistoOp, resolved); layout = HistogramBox.LayoutString; } else if (field instanceof InkField) { const { selectedColor, selectedWidth, selectedTool } = InkingControl.Instance; - created = Docs.Create.InkDocument(selectedColor, selectedTool, Number(selectedWidth), (field as InkField).inkData, resolved); + created = Docs.Create.InkDocument(selectedColor, selectedTool, Number(selectedWidth), (field).inkData, resolved); layout = InkingStroke.LayoutString; } else if (field instanceof List && field[0] instanceof Doc) { created = Docs.Create.StackingDocument(DocListCast(field), resolved); diff --git a/src/client/views/collections/CollectionPivotView.tsx b/src/client/views/collections/CollectionPivotView.tsx index 53ad433b3..ad2e05908 100644 --- a/src/client/views/collections/CollectionPivotView.tsx +++ b/src/client/views/collections/CollectionPivotView.tsx @@ -76,7 +76,7 @@ export class CollectionPivotView extends CollectionSubView(doc => doc) { facetValues.add(child[facet]?.toString() || "(null)"); }); - const newFacetVals = facetValues.toArray().map(val => Docs.Create.TextDocument({ title: val.toString() })); + const newFacetVals = facetValues.toArray().sort().map(val => Docs.Create.TextDocument({ title: val.toString() })); const newFacet = Docs.Create.FreeformDocument(newFacetVals, { title: facet, treeViewOpen: true, isFacetFilter: true }); Doc.AddDocToList(facetCollection, "data", newFacet); } diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx index a48208bd9..3a208038c 100644 --- a/src/client/views/collections/CollectionTreeView.tsx +++ b/src/client/views/collections/CollectionTreeView.tsx @@ -32,6 +32,7 @@ import { ScriptBox } from '../ScriptBox'; import { ImageBox } from '../nodes/ImageBox'; import { makeTemplate } from '../../util/DropConverter'; import { CollectionDockingView } from './CollectionDockingView'; +import { CollectionViewType } from './CollectionView'; export interface TreeViewProps { @@ -636,10 +637,7 @@ export class CollectionTreeView extends CollectionSubView(Document) { const { TextDocument, ImageDocument } = Docs.Create; const wrapper = Docs.Create.StackingDocument([ ImageDocument("http://www.cs.brown.edu/~bcz/face.gif", { title: "hero" }), - TextDocument({ title: "year" }), - TextDocument({ title: "degrees_of_freedom" }), - TextDocument({ title: "company" }), - TextDocument({ title: "short_description" }), + ...["short_description", "year", "company", "degrees_of_freedom"].map(key => TextDocument({ title: key })) ], { autoHeight: true, chromeStatus: "disabled" }); wrapper.disableLOD = true; makeTemplate(wrapper, true); diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index c35a44860..43e06cfdc 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -850,7 +850,15 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu return (showTitle && !showTitleHover ? 0 : 0) + 1; } - @computed get finalLayoutKey() { return this.props.layoutKey || "layout"; } + @computed get finalLayoutKey() { + const { layoutKey } = this.props; + if (typeof layoutKey === "string") { + return layoutKey; + } + // return "layout"; + const fallback = Cast(this.props.Document.layoutKey, "string"); + return typeof fallback === "string" ? fallback : "layout"; + } childScaling = () => (this.layoutDoc.fitWidth ? this.props.PanelWidth() / this.nativeWidth : this.props.ContentScaling()); @computed get contents() { TraceMobx(); diff --git a/src/scraping/buxton/scraper.py b/src/scraping/buxton/scraper.py index 2d1a5ca32..e80979616 100644 --- a/src/scraping/buxton/scraper.py +++ b/src/scraping/buxton/scraper.py @@ -191,7 +191,9 @@ def write_image(folder, name): "x": 10, "y": 10, "width": min(800, native_width), - "zIndex": 2 + "zIndex": 2, + "widthUnit": "*", + "widthMagnitude": 1 }, "__type": "Doc" } |