aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/documents/Documents.ts21
-rw-r--r--src/client/util/SettingsManager.scss2
-rw-r--r--src/client/views/collections/CollectionTimeView.scss17
-rw-r--r--src/client/views/collections/CollectionTimeView.tsx12
-rw-r--r--src/client/views/nodes/ImageBox.tsx2
-rw-r--r--src/client/views/nodes/SliderBox-components.tsx10
-rw-r--r--src/client/views/nodes/SliderBox.tsx27
7 files changed, 53 insertions, 38 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 027d7129e..49d1820f5 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -355,13 +355,18 @@ export namespace Docs {
_LODdisable: true
});
Networking.FetchFromServer("/buxton").then(response => {
- const parentProto = Doc.GetProto(parent);
- parentProto.data = new List<Doc>();
const devices = JSON.parse(response);
if (!Array.isArray(devices)) {
- alert("Improper Buxton import formatting!");
+ if ("error" in devices) {
+ loading.title = devices.error;
+ } else {
+ console.log(devices);
+ alert("The importer returned an unexpected import format. Check the console.");
+ }
return;
}
+ const parentProto = Doc.GetProto(parent);
+ parentProto.data = new List<Doc>();
devices.forEach(device => {
const { __images } = device;
delete device.__images;
@@ -370,9 +375,9 @@ export namespace Docs {
const constructed = __images.map(relative => Utils.prepend(relative));
const deviceImages = constructed.map((url, i) => ImageDocument(url, { title: `image${i}.${extname(url)}` }));
const doc = StackingDocument(deviceImages, { title: device.title, _LODdisable: true });
- const protoDoc = Doc.GetProto(doc);
- protoDoc.hero = new ImageField(constructed[0]);
- Docs.Get.DocumentHierarchyFromJson(device, undefined, protoDoc);
+ const deviceProto = Doc.GetProto(doc);
+ deviceProto.hero = new ImageField(constructed[0]);
+ Docs.Get.DocumentHierarchyFromJson(device, undefined, deviceProto);
Doc.AddDocToList(parentProto, "data", doc);
}
});
@@ -507,10 +512,6 @@ export namespace Docs {
return doc;
}
- export function IconDocument(icon: string, options: DocumentOptions = {}) {
- return InstanceFromProto(Prototypes.get(DocumentType.ICON), new IconField(icon), options);
- }
-
export function PdfDocument(url: string, options: DocumentOptions = {}) {
return InstanceFromProto(Prototypes.get(DocumentType.PDF), new PdfField(new URL(url)), options);
}
diff --git a/src/client/util/SettingsManager.scss b/src/client/util/SettingsManager.scss
index 7a0fb0741..6513cb223 100644
--- a/src/client/util/SettingsManager.scss
+++ b/src/client/util/SettingsManager.scss
@@ -1,6 +1,6 @@
@import "../views/globalCssVariables";
-.dialogue-box {
+.settings-interface {
background-color: whitesmoke !important;
color: grey;
width: 450px;
diff --git a/src/client/views/collections/CollectionTimeView.scss b/src/client/views/collections/CollectionTimeView.scss
index 02ef4e2d2..2dffb3ea0 100644
--- a/src/client/views/collections/CollectionTimeView.scss
+++ b/src/client/views/collections/CollectionTimeView.scss
@@ -1,21 +1,26 @@
-.collectionTimeView, .collectionTimeView-pivot {
+.collectionTimeView,
+.collectionTimeView-pivot {
display: flex;
flex-direction: row;
position: absolute;
height: 100%;
width: 100%;
overflow: hidden;
+
.collectionTimeView-backBtn {
background: green;
display: inline;
margin-right: 20px;
}
+
.collectionFreeform-customText {
text-align: left;
}
+
.collectionFreeform-customDiv {
position: absolute;
}
+
.collectionTimeView-thumb {
position: absolute;
width: 30px;
@@ -28,14 +33,17 @@
border-radius: 9px;
opacity: 0.25;
}
+
.collectionTimeView-thumb-min {
- margin-left:25%;
+ margin-left: 25%;
}
+
.collectionTimeView-thumb-max {
- margin-left:75%;
+ margin-left: 75%;
}
+
.collectionTimeView-thumb-mid {
- margin-left:50%;
+ margin-left: 50%;
}
.collectionTimeView-flyout {
@@ -118,6 +126,7 @@
left: -10px;
}
}
+
.collectionTimeView-pivot {
.collectionFreeform-customText {
text-align: center;
diff --git a/src/client/views/collections/CollectionTimeView.tsx b/src/client/views/collections/CollectionTimeView.tsx
index db176d0bc..808144c18 100644
--- a/src/client/views/collections/CollectionTimeView.tsx
+++ b/src/client/views/collections/CollectionTimeView.tsx
@@ -46,7 +46,7 @@ export class CollectionTimeView extends CollectionSubView(doc => doc) {
this.props.Document._fitToBox = true;
}
if (!this.props.Document.onViewDefClick) {
- this.props.Document.onViewDefDivClick = ScriptField.MakeScript("pivotColumnClick(this,payload)", { payload: "any" })
+ this.props.Document.onViewDefDivClick = ScriptField.MakeScript("pivotColumnClick(this,payload)", { payload: "any" });
}
}
@@ -164,7 +164,7 @@ export class CollectionTimeView extends CollectionSubView(doc => doc) {
typeof (pair.layout[fieldKey]) === "string").map(fieldKey => keySet.add(fieldKey)));
Array.from(keySet).map(fieldKey =>
docItems.push({ description: ":" + fieldKey, event: () => this.props.Document._pivotField = fieldKey, icon: "compress-arrows-alt" }));
- docItems.push({ description: ":(null)", event: () => this.props.Document._pivotField = undefined, icon: "compress-arrows-alt" })
+ docItems.push({ description: ":(null)", event: () => this.props.Document._pivotField = undefined, icon: "compress-arrows-alt" });
ContextMenu.Instance.addItem({ description: "Pivot Fields ...", subitems: docItems, icon: "eye" });
const pt = this.props.ScreenToLocalTransform().inverse().transformPoint(x, y);
ContextMenu.Instance.displayMenu(x, y, ":");
@@ -282,9 +282,9 @@ export class CollectionTimeView extends CollectionSubView(doc => doc) {
const layoutItems: ContextMenuProps[] = [];
const doc = this.props.Document;
- layoutItems.push({ description: "Force Timeline", event: () => { doc._forceRenderEngine = "timeline" }, icon: "compress-arrows-alt" });
- layoutItems.push({ description: "Force Pivot", event: () => { doc._forceRenderEngine = "pivot" }, icon: "compress-arrows-alt" });
- layoutItems.push({ description: "Auto Time/Pivot layout", event: () => { doc._forceRenderEngine = undefined }, icon: "compress-arrows-alt" });
+ layoutItems.push({ description: "Force Timeline", event: () => { doc._forceRenderEngine = "timeline"; }, icon: "compress-arrows-alt" });
+ layoutItems.push({ description: "Force Pivot", event: () => { doc._forceRenderEngine = "pivot"; }, icon: "compress-arrows-alt" });
+ layoutItems.push({ description: "Auto Time/Pivot layout", event: () => { doc._forceRenderEngine = undefined; }, icon: "compress-arrows-alt" });
layoutItems.push({ description: "Sync with presentation", event: () => CollectionTimeView.SyncTimelineToPresentation(doc), icon: "compress-arrows-alt" });
ContextMenu.Instance.addItem({ description: "Pivot/Time Options ...", subitems: layoutItems, icon: "eye" });
@@ -331,7 +331,7 @@ export class CollectionTimeView extends CollectionSubView(doc => doc) {
<div className={"collectionTimeView" + (doTimeline ? "" : "-pivot")} onContextMenu={this.specificMenu}
style={{ height: `calc(100% - ${this.props.Document._chromeStatus === "enabled" ? 51 : 0}px)` }}>
<div className={"pivotKeyEntry"}>
- <button className="collectionTimeView-backBtn" style={{ width: 50, height: 20, background: "green" }}
+ <button className="collectionTimeView-backBtn"
onClick={action(() => {
let prevFilterIndex = NumCast(this.props.Document._prevFilterIndex);
if (prevFilterIndex > 0) {
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index 896ac1685..99c6fde34 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -207,7 +207,7 @@ export class ImageBox extends DocAnnotatableComponent<FieldViewProps, ImageDocum
return url.href;
} else if (url.href.indexOf(window.location.origin) === -1) {
return Utils.CorsProxy(url.href);
- } else if (!(lower.endsWith(".png") || lower.endsWith(".jpg") || lower.endsWith(".jpeg"))) {
+ } else if (!/\.(png|jpg|jpeg|gif)$/.test(lower)) {
return url.href;//Why is this here
}
const ext = path.extname(url.href);
diff --git a/src/client/views/nodes/SliderBox-components.tsx b/src/client/views/nodes/SliderBox-components.tsx
index a38cad459..874a1108f 100644
--- a/src/client/views/nodes/SliderBox-components.tsx
+++ b/src/client/views/nodes/SliderBox-components.tsx
@@ -47,12 +47,12 @@ export class TooltipRail extends Component<TooltipRailProps> {
onMouseEnter = () => {
document.addEventListener("mousemove", this.onMouseMove);
- };
+ }
onMouseLeave = () => {
this.setState({ value: null, percent: null });
document.removeEventListener("mousemove", this.onMouseMove);
- };
+ }
onMouseMove = (e: Event) => {
const { activeHandleID, getEventData } = this.props;
@@ -62,7 +62,7 @@ export class TooltipRail extends Component<TooltipRailProps> {
} else {
this.setState(getEventData(e));
}
- };
+ }
render() {
const { value, percent } = this.state;
@@ -120,11 +120,11 @@ export class Handle extends Component<HandleProps> {
onMouseEnter = () => {
this.setState({ mouseOver: true });
- };
+ }
onMouseLeave = () => {
this.setState({ mouseOver: false });
- };
+ }
render() {
const {
diff --git a/src/client/views/nodes/SliderBox.tsx b/src/client/views/nodes/SliderBox.tsx
index 2c9effe24..844d95d11 100644
--- a/src/client/views/nodes/SliderBox.tsx
+++ b/src/client/views/nodes/SliderBox.tsx
@@ -50,11 +50,11 @@ export class SliderBox extends DocComponent<FieldViewProps, SliderDocument>(Slid
onChange = (values: readonly number[]) => runInAction(() => {
this.Document._sliderMinThumb = values[0];
this.Document._sliderMaxThumb = values[1];
- Cast(this.Document.onThumbChanged, ScriptField, null)?.script.run({ range: values, this: this.props.Document })
+ Cast(this.Document.onThumbChanged, ScriptField, null)?.script.run({ range: values, this: this.props.Document });
})
render() {
- const domain = [NumCast(this.props.Document._sliderMin), NumCast(this.props.Document._sliderMax)]
+ const domain = [NumCast(this.props.Document._sliderMin), NumCast(this.props.Document._sliderMax)];
const defaultValues = [NumCast(this.props.Document._sliderMinThumb), NumCast(this.props.Document._sliderMaxThumb)];
return (
<div className="sliderBox-outerDiv" onContextMenu={this.specificContextMenu} onPointerDown={e => e.stopPropagation()}
@@ -76,15 +76,20 @@ export class SliderBox extends DocComponent<FieldViewProps, SliderDocument>(Slid
<Handles>
{({ handles, activeHandleID, getHandleProps }) => (
<div className="slider-handles">
- {handles.map(handle => (
- <Handle
- key={handle.id}
- handle={handle}
- domain={domain}
- isActive={handle.id === activeHandleID}
- getHandleProps={getHandleProps}
- />
- ))}
+ {handles.map((handle, i) => {
+ const value = i === 0 ? this.Document._sliderMinThumb : this.Document._sliderMaxThumb;
+ return (
+ <div title={String(value)}>
+ <Handle
+ key={handle.id}
+ handle={handle}
+ domain={domain}
+ isActive={handle.id === activeHandleID}
+ getHandleProps={getHandleProps}
+ />
+ </div>
+ );
+ })}
</div>
)}
</Handles>