aboutsummaryrefslogtreecommitdiff
path: root/src/client/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/util')
-rw-r--r--src/client/util/CurrentUserUtils.ts42
-rw-r--r--src/client/util/HypothesisUtils.ts2
-rw-r--r--src/client/util/Import & Export/DirectoryImportBox.tsx4
-rw-r--r--src/client/util/SettingsManager.scss6
4 files changed, 30 insertions, 24 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index 7a1c193c1..2f08aa928 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -49,21 +49,6 @@ export class CurrentUserUtils {
// sets up the default User Templates - slideView, queryView, descriptionView
static setupUserTemplateButtons(doc: Doc) {
- if (doc["template-button-query"] === undefined) {
- const queryTemplate = Docs.Create.MulticolumnDocument(
- [
- Docs.Create.SearchDocument({ _viewType: CollectionViewType.Schema, ignoreClick: true, forceActive: true, _chromeStatus: "disabled", lockedPosition: true, title: "query", _height: 200, system: true }),
- Docs.Create.FreeformDocument([], { title: "data", _height: 100, system: true })
- ],
- { _width: 400, _height: 300, title: "queryView", _chromeStatus: "disabled", _xMargin: 3, _yMargin: 3, system: true }
- );
- queryTemplate.isTemplateDoc = makeTemplate(queryTemplate);
- doc["template-button-query"] = CurrentUserUtils.ficon({
- onDragStart: ScriptField.MakeFunction('copyDragFactory(this.dragFactory)'),
- dragFactory: new PrefetchProxy(queryTemplate) as any as Doc,
- removeDropProperties: new List<string>(["dropAction"]), title: "query view", icon: "question-circle"
- });
- }
// Prototype for mobile button (not sure if 'Advanced Item Prototypes' is ideal location)
if (doc["template-mobile-button"] === undefined) {
const queryTemplate = this.mobileButton({
@@ -245,15 +230,36 @@ export class CurrentUserUtils {
removeDropProperties: new List<string>(["dropAction"]), title: "detail view", icon: "window-maximize", system: true
});
}
+ if (doc["template-button-simple"] === 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 shared = { _chromeStatus: "disabled", _autoHeight: true, _xMargin: 0 };
+ const detailViewOpts = { title: "detailView", _width: 300, _fontFamily: "Arial", _fontSize: "12pt" };
+ const detailView = Docs.Create.StackingDocument([carousel], { ...shared, ...detailViewOpts, system: true });
+ detailView.isTemplateDoc = makeTemplate(detailView);
+
+ doc["template-button-simple"] = CurrentUserUtils.ficon({
+ onDragStart: ScriptField.MakeFunction('copyDragFactory(this.dragFactory)'),
+ dragFactory: new PrefetchProxy(detailView) as any as Doc,
+ removeDropProperties: new List<string>(["dropAction"]), title: "simple view", icon: "window-maximize", system: true
+ });
+ }
const requiredTypes = [
doc["template-button-slides"] as Doc,
doc["template-button-description"] as Doc,
- doc["template-button-query"] as Doc,
doc["template-mobile-button"] as Doc,
doc["template-button-detail"] as Doc,
+ doc["template-button-simple"] as Doc,
doc["template-button-link"] as Doc,
- doc["template-button-switch"] as Doc];
+ //doc["template-button-switch"] as Doc]
+ ];
if (doc["template-buttons"] === undefined) {
doc["template-buttons"] = new PrefetchProxy(Docs.Create.MasonryDocument(requiredTypes, {
title: "Advanced Item Prototypes", _xMargin: 0, _showTitle: "title",
@@ -439,7 +445,7 @@ export class CurrentUserUtils {
{ _width: 250, _height: 250, title: "container", system: true, cloneFieldFilter: new List<string>(["system"]) });
}
if (doc.emptyWebpage === undefined) {
- doc.emptyWebpage = Docs.Create.WebDocument("", { title: "webpage", _nativeWidth: 850, _nativeHeight: 962, _width: 400, useCors: true, system: true, cloneFieldFilter: new List<string>(["system"]) });
+ doc.emptyWebpage = Docs.Create.WebDocument("", { title: "webpage", _nativeWidth: 850, _height: 512, _width: 400, useCors: true, system: true, cloneFieldFilter: new List<string>(["system"]) });
}
if (doc.activeMobileMenu === undefined) {
this.setupActiveMobileMenu(doc);
diff --git a/src/client/util/HypothesisUtils.ts b/src/client/util/HypothesisUtils.ts
index 4a5b52e1e..8cb523093 100644
--- a/src/client/util/HypothesisUtils.ts
+++ b/src/client/util/HypothesisUtils.ts
@@ -21,7 +21,7 @@ export namespace Hypothesis {
export const getSourceWebDoc = async (uri: string) => {
const result = await findWebDoc(uri);
console.log(result ? "existing doc found" : "existing doc NOT found");
- return result || Docs.Create.WebDocument(uri, { title: uri, _nativeWidth: 850, _nativeHeight: 962, _width: 400, useCors: true }); // create and return a new Web doc with given uri if no matching docs are found
+ return result || Docs.Create.WebDocument(uri, { title: uri, _nativeWidth: 850, _height: 512, _width: 400, useCors: true }); // create and return a new Web doc with given uri if no matching docs are found
};
diff --git a/src/client/util/Import & Export/DirectoryImportBox.tsx b/src/client/util/Import & Export/DirectoryImportBox.tsx
index d04270afa..7f01966b9 100644
--- a/src/client/util/Import & Export/DirectoryImportBox.tsx
+++ b/src/client/util/Import & Export/DirectoryImportBox.tsx
@@ -11,7 +11,7 @@ import { List } from "../../../fields/List";
import { listSpec } from "../../../fields/Schema";
import { SchemaHeaderField } from "../../../fields/SchemaHeaderField";
import { BoolCast, Cast, NumCast } from "../../../fields/Types";
-import { AcceptibleMedia, Upload } from "../../../server/SharedMediaTypes";
+import { AcceptableMedia, Upload } from "../../../server/SharedMediaTypes";
import { Utils } from "../../../Utils";
import { GooglePhotos } from "../../apis/google_docs/GooglePhotosClientUtils";
import { Docs, DocumentOptions, DocUtils } from "../../documents/Documents";
@@ -87,7 +87,7 @@ export class DirectoryImportBox extends React.Component<FieldViewProps> {
const file = files.item(i);
if (file && !unsupported.includes(file.type)) {
const ext = path.extname(file.name).toLowerCase();
- if (AcceptibleMedia.imageFormats.includes(ext)) {
+ if (AcceptableMedia.imageFormats.includes(ext)) {
validated.push(file);
}
}
diff --git a/src/client/util/SettingsManager.scss b/src/client/util/SettingsManager.scss
index 68e0b91b0..badba35f4 100644
--- a/src/client/util/SettingsManager.scss
+++ b/src/client/util/SettingsManager.scss
@@ -159,14 +159,15 @@
.preferences-content {
display: flex;
margin-top: 4px;
+ color: black;
+ font-size: 11;
.preferences-color {
display: flex;
margin-top: 2px;
+ width: 55;
.preferences-color-text {
- color: black;
- font-size: 11;
margin-top: 4;
margin-right: 4;
}
@@ -179,7 +180,6 @@
.preferences-font-text {
color: black;
- font-size: 11;
margin-top: 4;
margin-right: 4;
}