aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/util/CurrentUserUtils.ts36
-rw-r--r--src/client/views/LightboxView.tsx3
-rw-r--r--src/client/views/MainView.tsx12
-rw-r--r--src/client/views/PropertiesButtons.scss9
-rw-r--r--src/client/views/PropertiesButtons.tsx8
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx2
-rw-r--r--src/client/views/nodes/button/FontIconBox.tsx4
-rw-r--r--src/client/views/nodes/trails/PresBox.tsx4
8 files changed, 47 insertions, 31 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index f6ec74482..56807c63b 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -55,6 +55,7 @@ interface Button {
width?: number;
list?: string[];
ignoreClick?: boolean;
+ buttonText?: string;
}
export let resolvedPorts: { server: number, socket: number };
@@ -830,16 +831,17 @@ export class CurrentUserUtils {
static async setupPresentations(doc: Doc) {
await doc.myTrails;
if (doc.myTrails === undefined) {
+ const newTrail = ScriptField.MakeScript(`createNewPresentation()`);
+ const newTrailButton:Doc = Docs.Create.FontIconDocument({ onClick: newTrail, _forceActive: true, toolTip: "New trail", _stayInCollection: true, _hideContextMenu: true, title: "New trail", btnType: ButtonType.ClickButton, _width: 30, _height: 30, buttonText: "New trail", icon: "plus", system: true });
doc.myTrails = new PrefetchProxy(Docs.Create.TreeDocument([], {
title: "My Trails", _showTitle: "title", _height: 100,
- treeViewHideTitle: true, _xMargin: 5, _yMargin: 5, _gridGap: 5, _forceActive: true, childDropAction: "alias",
- treeViewTruncateTitleWidth: 150, ignoreClick: true,
- _lockedPosition: true, boxShadow: "0 0", childDontRegisterViews: true, targetDropAction: "same", system: true
+ treeViewHideTitle: true, _xMargin: 5, _yMargin: 5, _fitWidth: true, _gridGap: 5, _forceActive: true, childDropAction: "alias",
+ treeViewTruncateTitleWidth: 150, ignoreClick: true, buttonMenu: true, buttonMenuDoc: newTrailButton,
+ _lockedPosition: true, boxShadow: "0 0", childDontRegisterViews: true, targetDropAction: "same", system: true,
+ explainer: "All of the trails that you have created will appear here."
}));
- const newPresentations = ScriptField.MakeScript(`createNewPresentation()`);
- (doc.myTrails as any as Doc).contextMenuScripts = new List<ScriptField>([newPresentations!]);
+ (doc.myTrails as any as Doc).contextMenuScripts = new List<ScriptField>([newTrail!]);
(doc.myTrails as any as Doc).contextMenuLabels = new List<string>(["Create New Trail"]);
- const presentations = doc.myTrails as any as Doc;
}
return doc.myTrails as any as Doc;
}
@@ -848,14 +850,19 @@ export class CurrentUserUtils {
await doc.myFilesystem;
if (doc.myFilesystem === undefined) {
doc.myFileOrphans = Docs.Create.TreeDocument([], { title: "Unfiled", _stayInCollection: true, system: true, isFolder: true });
- doc.myFileRoot = Docs.Create.TreeDocument([], { title: "file root", _stayInCollection: true, system: true, isFolder: true });
- doc.myFilesystem = new PrefetchProxy(Docs.Create.TreeDocument([doc.myFileRoot as Doc, doc.myFileOrphans as Doc], {
- title: "My Documents", _showTitle: "title", _height: 100,
+ // doc.myFileRoot = Docs.Create.TreeDocument([], { title: "file root", _stayInCollection: true, system: true, isFolder: true });
+ const newFolder = ScriptField.MakeFunction(`doc.makeFolder()`, { doc: doc.myFilesystem })!;
+ const newFolderButton:Doc = Docs.Create.FontIconDocument({ onClick: newFolder, _forceActive: true, toolTip: "New folder", _stayInCollection: true, _hideContextMenu: true, title: "New folder", btnType: ButtonType.ClickButton, _width: 30, _height: 30, buttonText: "New folder", icon: "folder-plus", system: true });
+ doc.myFilesystem = new PrefetchProxy(Docs.Create.TreeDocument([doc.myFileOrphans as Doc], {
+ title: "My Documents", _showTitle: "title", buttonMenu: true, buttonMenuDoc: newFolderButton, _height: 100,
treeViewHideTitle: true, _xMargin: 5, _yMargin: 5, _gridGap: 5, _forceActive: true, childDropAction: "alias",
treeViewTruncateTitleWidth: 150, ignoreClick: true,
isFolder: true, treeViewType: "fileSystem", childHideLinkButton: true,
- _lockedPosition: true, boxShadow: "0 0", childDontRegisterViews: true, targetDropAction: "proto", system: true
+ _lockedPosition: true, boxShadow: "0 0", childDontRegisterViews: true, targetDropAction: "proto", system: true,
+ explainer: "This is your file manager where you can create folders to keep track of documents independently of your dashboard."
}));
+ (doc.myTrails as any as Doc).contextMenuScripts = new List<ScriptField>([newFolder!]);
+ (doc.myTrails as any as Doc).contextMenuLabels = new List<string>(["Create new folder"]);
}
return doc.myFilesystem as any as Doc;
}
@@ -869,7 +876,7 @@ export class CurrentUserUtils {
treeViewHideTitle: true, _xMargin: 5, _yMargin: 5, _gridGap: 5, _forceActive: true, childDropAction: "alias",
treeViewTruncateTitleWidth: 150, ignoreClick: true,
_lockedPosition: true, boxShadow: "0 0", childDontRegisterViews: true, targetDropAction: "same", system: true,
- explainer: "Documents that you close will appear here so you can easily access them again. You can choose to clear this menu in which case you might lose these documents."
+ explainer: "Recently closed documents appear in this menu. They will only be deleted if you explicity empty this list."
}));
(doc.myRecentlyClosedDocs as any as Doc).contextMenuScripts = new List<ScriptField>([clearAll!]);
@@ -1004,6 +1011,9 @@ export class CurrentUserUtils {
title: "Show preview",
toolTip: "Show preview of selected document",
btnType: ButtonType.ToggleButton,
+ switchToggle: true,
+ width: 100,
+ buttonText: "Show Preview",
icon: "eye",
click: 'toggleSchemaPreview()',
checkResult: 'toggleSchemaPreview(true)'
@@ -1184,7 +1194,7 @@ export class CurrentUserUtils {
title: "My SharedDocs", childDropAction: "alias", system: true, contentPointerEvents: "all", childLimitHeight: 0, _yMargin: 50, _gridGap: 15,
_showTitle: "title", treeViewHideTitle: true, ignoreClick: true, _lockedPosition: true, "acl-Public": SharingPermissions.Augment, "_acl-Public": SharingPermissions.Augment,
_chromeHidden: true, boxShadow: "0 0",
- explainer: "All of the documents that you receive will appear here. They must be shared by other users. If you receive a Dashboard you can add it to your Dashboards by right clicking and clicking 'Add to Dashboards'"
+ explainer: "This is where documents or dashboards that other users have shared with you will appear."
}, sharingDocumentId + "outer", sharingDocumentId);
(sharedDocs as Doc)["acl-Public"] = (sharedDocs as Doc)[DataSym]["acl-Public"] = SharingPermissions.Augment;
}
@@ -1209,7 +1219,7 @@ export class CurrentUserUtils {
doc.myUploadDocs = new PrefetchProxy(Docs.Create.StackingDocument([], {
title: "My Uploads", _forceActive: true, buttonMenu: true, buttonMenuDoc: newUploadButton, ignoreClick: true, _showTitle: "title", _stayInCollection: true, _hideContextMenu: true, childLimitHeight: 0,
childDropAction: "copy", _autoHeight: true, _yMargin: 50, _gridGap: 15, boxShadow: "0 0", _lockedPosition: true, system: true, _chromeHidden: true,
- explainer: "All of the documents that are imported into Dash will go here and stay here unless they are explicitly removed."
+ explainer: "This is where documents that are uploaded into Dash will go."
}));
}
}
diff --git a/src/client/views/LightboxView.tsx b/src/client/views/LightboxView.tsx
index 88739fe91..ec30a6a5d 100644
--- a/src/client/views/LightboxView.tsx
+++ b/src/client/views/LightboxView.tsx
@@ -16,6 +16,7 @@ import { TabDocView } from './collections/TabDocView';
import "./LightboxView.scss";
import { DocumentView } from './nodes/DocumentView';
import { DefaultStyleProvider, wavyBorderPath } from './StyleProvider';
+import { CollectionMenu } from './collections/CollectionMenu';
interface LightboxViewProps {
PanelWidth: number;
@@ -213,6 +214,7 @@ export class LightboxView extends React.Component<LightboxViewProps> {
LightboxView.SetLightboxDoc(undefined);
}
}} >
+
<div className="lightboxView-contents" style={{
left: this.leftBorder,
top: this.topBorder,
@@ -220,6 +222,7 @@ export class LightboxView extends React.Component<LightboxViewProps> {
height: this.lightboxHeight(),
clipPath: `path('${Doc.UserDoc().renderStyle === "comic" ? wavyBorderPath(this.lightboxWidth(), this.lightboxHeight()) : undefined}')`
}}>
+ {/* <CollectionMenu /> TODO:glr This is where it would go*/}
<DocumentView ref={action((r: DocumentView | null) => {
LightboxView._docView = r !== null ? r : undefined;
r && setTimeout(action(() => {
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 9047951ee..440bb6bd5 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -173,7 +173,7 @@ export class MainView extends React.Component {
fa.faArrowAltCircleDown, fa.faArrowAltCircleUp, fa.faArrowAltCircleLeft, fa.faArrowAltCircleRight, fa.faStopCircle, fa.faCheckCircle, fa.faGripVertical,
fa.faSortUp, fa.faSortDown, fa.faTable, fa.faTh, fa.faThList, fa.faProjectDiagram, fa.faSignature, fa.faColumns, fa.faChevronCircleUp, fa.faUpload, fa.faBorderAll,
fa.faBraille, fa.faChalkboard, fa.faPencilAlt, fa.faEyeSlash, fa.faSmile, fa.faIndent, fa.faOutdent, fa.faChartBar, fa.faBan, fa.faPhoneSlash, fa.faGripLines,
- fa.faSave, fa.faBookmark, fa.faList, fa.faListOl);
+ fa.faSave, fa.faBookmark, fa.faList, fa.faListOl, fa.faFolderPlus, fa.faLightbulb, fa.faBookOpen);
this.initAuthenticationRouters();
}
@@ -227,16 +227,16 @@ export class MainView extends React.Component {
@action
createNewPresentation = async () => {
- if (!await this.userDoc.myPresentations) {
- this.userDoc.myPresentations = new PrefetchProxy(Docs.Create.TreeDocument([], {
- title: "PRESENTATION TRAILS", childDontRegisterViews: true, _height: 100, _forceActive: true, boxShadow: "0 0", _lockedPosition: true, treeViewOpen: true, system: true
+ if (!await this.userDoc.myTrails) {
+ this.userDoc.myTrails = new PrefetchProxy(Docs.Create.TreeDocument([], {
+ title: "TRAILS", childDontRegisterViews: true, _height: 100, _forceActive: true, boxShadow: "0 0", _lockedPosition: true, treeViewOpen: true, system: true
}));
}
const pres = Docs.Create.PresDocument(new List<Doc>(),
- { title: "Untitled Presentation", _viewType: CollectionViewType.Stacking, _width: 400, _height: 500, targetDropAction: "alias", _chromeHidden: true, boxShadow: "0 0" });
+ { title: "Untitled Trail", _viewType: CollectionViewType.Stacking, _width: 400, _height: 500, targetDropAction: "alias", _chromeHidden: true, boxShadow: "0 0" });
CollectionDockingView.AddSplit(pres, "right");
this.userDoc.activePresentation = pres;
- Doc.AddDocToList(this.userDoc.myPresentations as Doc, "data", pres);
+ Doc.AddDocToList(this.userDoc.myTrails as Doc, "data", pres);
}
getPWidth = () => this._panelWidth - this.propertiesWidth();
diff --git a/src/client/views/PropertiesButtons.scss b/src/client/views/PropertiesButtons.scss
index 77686a710..36b2df73e 100644
--- a/src/client/views/PropertiesButtons.scss
+++ b/src/client/views/PropertiesButtons.scss
@@ -44,14 +44,15 @@ $linkGap : 3px;
}
}
.propertiesButtons-linkButton-empty.toggle-on {
- background-color: white;
- color: $dark-gray;
+ background-color: $medium-blue;
+ color: $white;
}
.propertiesButtons-linkButton-empty.toggle-hover {
- background-color: gray;
- color: $dark-gray;
+ background-color: $light-blue;
+ color: $black;
}
.propertiesButtons-linkButton-empty.toggle-off {
+ background-color: $dark-gray;
color: white;
}
diff --git a/src/client/views/PropertiesButtons.tsx b/src/client/views/PropertiesButtons.tsx
index 4fde1124f..286365fa6 100644
--- a/src/client/views/PropertiesButtons.tsx
+++ b/src/client/views/PropertiesButtons.tsx
@@ -66,10 +66,10 @@ export class PropertiesButtons extends React.Component<{}, {}> {
return this.propertyToggleBtn("Lock\xA0View", "_lockedTransform", on => `${on ? "Unlock" : "Lock"} panning of view`, on => "lock");
}
@computed get fitContentButton() {
- return this.propertyToggleBtn("View All", "_fitToBox", on => `${on ? "Don't" : ""} fit content to container visible area`, on => "eye");
+ return this.propertyToggleBtn("View All", "_fitToBox", on => `${on ? "Don't" : "Do"} fit content to container visible area`, on => "eye");
}
@computed get fitWidthButton() {
- return this.propertyToggleBtn("Fit\xA0Width", "_fitWidth", on => `${on ? "Don't" : ""} fit content to width of container`, on => "arrows-alt-h");
+ return this.propertyToggleBtn("Fit\xA0Width", "_fitWidth", on => `${on ? "Don't" : "Do"} fit content to width of container`, on => "arrows-alt-h");
}
@computed get captionButton() {
return this.propertyToggleBtn("Caption", "_showCaption", on => `${on ? "Hide" : "Show"} caption footer`, on => "closed-captioning", (dv, doc) => (dv?.rootDoc || doc)._showCaption = (dv?.rootDoc || doc)._showCaption === undefined ? "caption" : undefined);
@@ -211,13 +211,13 @@ export class PropertiesButtons extends React.Component<{}, {}> {
{toggle(this.titleButton)}
{toggle(this.captionButton)}
{toggle(this.lockButton)}
- {toggle(this.dictationButton)}
+ {toggle(this.dictationButton, { display: isNovice ? "none" : "" })}
{toggle(this.onClickButton)}
{toggle(this.fitWidthButton, { display: isNovice ? "none" : "" })}
{toggle(this.fitContentButton, { display: !isFreeForm ? "none" : "" })}
{toggle(this.autoHeightButton, { display: !isText && !isStacking && !isTree ? "none" : "" })}
{toggle(this.maskButton, { display: !isInk ? "none" : "" })}
- {toggle(this.chromeButton, { display: isCollection ? "" : "none" })}
+ {toggle(this.chromeButton, { display: !isCollection || isNovice ? "none" : "" })}
{toggle(this.gridButton, { display: isCollection ? "" : "none" })}
{toggle(this.snapButton, { display: isCollection ? "" : "none" })}
{toggle(this.clustersButton, { display: !isFreeForm ? "none" : "" })}
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index 3c9084f64..c92b259d0 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -579,7 +579,7 @@ export class CollectionStackingView extends CollectionSubView<StackingDocument,
<>
{buttonMenu || noviceExplainer ? <div className="documentButtonMenu">
{buttonMenu ? this.buttonMenu : null}
- {Doc.UserDoc().isNovice && noviceExplainer ?
+ {Doc.UserDoc().noviceMode && noviceExplainer ?
<div className="documentExplanation">
{noviceExplainer}
</div>
diff --git a/src/client/views/nodes/button/FontIconBox.tsx b/src/client/views/nodes/button/FontIconBox.tsx
index 1b27d562a..b72f31ef8 100644
--- a/src/client/views/nodes/button/FontIconBox.tsx
+++ b/src/client/views/nodes/button/FontIconBox.tsx
@@ -400,7 +400,7 @@ export class FontIconBox extends DocComponent<ButtonProps, FontIconDocument>(Fon
@computed get toggleButton() {
// Determine the type of toggle button
const switchToggle: boolean = BoolCast(this.rootDoc.switchToggle);
-
+ const buttonText: string = StrCast(this.rootDoc.buttonText);
// Colors
const color = this.props.styleProvider?.(this.rootDoc, this.props, StyleProp.Color);
const backgroundColor = this.props.styleProvider?.(this.rootDoc, this.props, StyleProp.BackgroundColor);
@@ -414,6 +414,7 @@ export class FontIconBox extends DocComponent<ButtonProps, FontIconDocument>(Fon
if (switchToggle) {
return (
<div className={`menuButton ${this.type} ${'switch'}`}>
+ {buttonText ? buttonText : null}
<label className="switch">
<input type="checkbox"
checked={backgroundColor === Colors.MEDIUM_BLUE}
@@ -880,6 +881,7 @@ Scripting.addGlobal(function webSetURL(url: string, checkResult?: boolean) {
**/
Scripting.addGlobal(function toggleSchemaPreview(checkResult?: boolean) {
const selected = SelectionManager.Views().length ? SelectionManager.Views()[0].rootDoc : undefined;
+ console.log(selected && selected.title);
if (checkResult && selected) {
const result: boolean = NumCast(selected.schemaPreviewWidth) > 0;
if (result) return Colors.MEDIUM_BLUE;
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index b805aa6ae..1abe26c20 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -167,7 +167,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
this.layoutDoc._yMargin = 0;
this.turnOffEdit(true);
DocListCastAsync((Doc.UserDoc().myTrails as Doc).data).then(pres =>
- !pres?.includes(this.rootDoc) && Doc.AddDocToList(Doc.UserDoc().myPresentations as Doc, "data", this.rootDoc));
+ !pres?.includes(this.rootDoc) && Doc.AddDocToList(Doc.UserDoc().myTrails as Doc, "data", this.rootDoc));
this._disposers.selection = reaction(() => SelectionManager.Views(),
views => views.some(view => view.props.Document === this.rootDoc) && this.updateCurrentPresentation());
}
@@ -2229,7 +2229,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
const isMini: boolean = this.toolbarWidth <= 100;
return (
<div className="presBox-buttons" style={{ display: !this.rootDoc._chromeHidden ? "none" : undefined }}>
- {isMini ? (null) : <select className="presBox-viewPicker"
+ {isMini || Doc.UserDoc().noviceMode ? (null) : <select className="presBox-viewPicker"
style={{ display: this.layoutDoc.presStatus === "edit" ? "block" : "none" }}
onPointerDown={e => e.stopPropagation()}
onChange={this.viewChanged}