aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-04 17:58:50 +0800
committerGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-04 17:58:50 +0800
commitf848ef4d6f43f281618b511f8bf1815ef1c63ecc (patch)
tree74060a4ddd0bfdcdd43074aa521be4ffa77d6dce /src
parentf4c14a48f91ec95b900bb1e25452d18971ff21a8 (diff)
properties view for presentation
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/collectionFreeForm/PropertiesView.scss4
-rw-r--r--src/client/views/nodes/PresBox.scss14
-rw-r--r--src/client/views/nodes/PresBox.tsx59
-rw-r--r--src/client/views/presentationview/PresElementBox.tsx8
4 files changed, 44 insertions, 41 deletions
diff --git a/src/client/views/collections/collectionFreeForm/PropertiesView.scss b/src/client/views/collections/collectionFreeForm/PropertiesView.scss
index 2cdaa25ee..f559b940c 100644
--- a/src/client/views/collections/collectionFreeForm/PropertiesView.scss
+++ b/src/client/views/collections/collectionFreeForm/PropertiesView.scss
@@ -5,8 +5,8 @@
font-family: "Noto Sans";
cursor: auto;
- overflow-x: visible;
- overflow-y: visible;
+ overflow-x: hidden;
+ overflow-y: scroll;
.propertiesView-title {
background-color: rgb(159, 159, 159);
diff --git a/src/client/views/nodes/PresBox.scss b/src/client/views/nodes/PresBox.scss
index 83e7152a8..45c6d33b8 100644
--- a/src/client/views/nodes/PresBox.scss
+++ b/src/client/views/nodes/PresBox.scss
@@ -291,7 +291,7 @@
.ribbon-textInput {
border-radius: 2px;
- height: 30px;
+ height: 20px;
font-size: 11.5;
font-weight: 100;
align-self: center;
@@ -363,14 +363,14 @@
.ribbon-final-button {
position: relative;
- font-size: 11.5;
+ font-size: 11;
font-weight: normal;
letter-spacing: normal;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 5px;
- height: 30px;
+ height: 25px;
color: white;
width: 100%;
max-width: 120;
@@ -382,14 +382,14 @@
.ribbon-final-button-hidden {
position: relative;
- font-size: 11.5;
+ font-size: 11;
font-weight: normal;
letter-spacing: normal;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 5px;
- height: 30px;
+ height: 25px;
color: lightgrey;
width: 100%;
max-width: 120;
@@ -414,9 +414,9 @@
}
.ribbon-button {
- font-size: 11;
+ font-size: 10.5;
font-weight: 200;
- height: 30;
+ height: 20;
background-color: #dedede;
border: solid 1px black;
display: flex;
diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx
index 496d4666e..0a73106a3 100644
--- a/src/client/views/nodes/PresBox.tsx
+++ b/src/client/views/nodes/PresBox.tsx
@@ -900,22 +900,16 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
<div className={'presBox-ribbon'} onClick={e => e.stopPropagation()} onPointerUp={e => e.stopPropagation()} onPointerDown={e => e.stopPropagation()}>
<div className="ribbon-box">
{this.stringType} options
- <div className="ribbon-doubleButton" style={{ display: targetDoc.type === DocumentType.VID ? "inline-flex" : "none" }}>
- <div className="ribbon-button" style={{ backgroundColor: activeItem.presProgressivize ? "#aedef8" : "" }} onClick={this.progressivizeChild}>Child documents</div>
- <div className="ribbon-button" style={{ display: activeItem.presProgressivize ? "flex" : "none", backgroundColor: targetDoc.editProgressivize ? "#aedef8" : "" }} onClick={this.editProgressivize}>Edit</div>
+ <div className="ribbon-doubleButton" style={{ display: targetDoc.type === DocumentType.VID || targetDoc.type === DocumentType.AUDIO ? "inline-flex" : "none" }}>
+ <div className="ribbon-button" style={{ backgroundColor: activeItem.presProgressivize ? "#aedef8" : "" }} onClick={this.progressivizeChild}>Start automatically</div>
+ <div className="ribbon-button" style={{ display: "flex", backgroundColor: targetDoc.editProgressivize ? "#aedef8" : "" }} onClick={this.editProgressivize}>Start manually</div>
</div>
- <div className="ribbon-doubleButton" style={{ display: targetDoc.type === DocumentType.COL || targetDoc.type === DocumentType.IMG ? "inline-flex" : "none" }}>
- <div className="ribbon-button" style={{ backgroundColor: activeItem.zoomProgressivize ? "#aedef8" : "" }} onClick={this.progressivizeZoom}>Internal zoom</div>
- <div className="ribbon-button" style={{ display: activeItem.zoomProgressivize ? "flex" : "none", backgroundColor: targetDoc.editZoomProgressivize ? "#aedef8" : "" }} onClick={this.editZoomProgressivize}>Viewfinder</div>
- <div className="ribbon-button" style={{ display: activeItem.zoomProgressivize ? "flex" : "none", backgroundColor: targetDoc.editSnapZoomProgressivize ? "#aedef8" : "" }} onClick={this.editSnapZoomProgressivize}>Snapshot</div>
- </div>
- <div className="ribbon-doubleButton" style={{ display: targetDoc.type === DocumentType.RTF ? "inline-flex" : "none" }}>
- <div className="ribbon-button" onClick={this.progressivizeText}>Text progressivize</div>
- <div className="ribbon-button" style={{ display: activeItem.textProgressivize ? "flex" : "none", backgroundColor: targetDoc.editTextProgressivize ? "#aedef8" : "" }} onClick={this.editTextProgressivize}>Edit</div>
+ <div className="ribbon-doubleButton" style={{ display: "flex" }}>
+ <div className="ribbon-button" style={{ backgroundColor: activeItem.zoomProgressivize ? "#aedef8" : "" }} onClick={this.progressivizeZoom}>Open document</div>
+ <div className="ribbon-button" style={{ display: "flex", backgroundColor: targetDoc.editZoomProgressivize ? "#aedef8" : "" }} onClick={this.editZoomProgressivize}>Open parent collection</div>
</div>
- <div className="ribbon-doubleButton" style={{ display: targetDoc.type === DocumentType.PDF ? "inline-flex" : "none" }}>
- <div className="ribbon-button" style={{ backgroundColor: activeItem.scrollProgressivize ? "#aedef8" : "" }} onClick={this.progressivizeScroll}>Scroll progressivize</div>
- <div className="ribbon-button" style={{ display: activeItem.scrollProgressivize ? "flex" : "none", backgroundColor: targetDoc.editScrollProgressivize ? "#aedef8" : "" }} onClick={this.editScrollProgressivize}>Edit</div>
+ <div className="ribbon-doubleButton" style={{ display: targetDoc.type === DocumentType.WEB ? "inline-flex" : "none" }}>
+ <div className="ribbon-button" onClick={this.progressivizeText}>Store original website</div>
</div>
</div>
</div>
@@ -928,28 +922,25 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
return (
<div>
<div className={'presBox-toolbar-dropdown'} style={{ display: this.newDocumentTools && this.layoutDoc.presStatus === "edit" ? "inline-flex" : "none" }} onClick={e => e.stopPropagation()} onPointerUp={e => e.stopPropagation()} onPointerDown={e => e.stopPropagation()}>
- <div className="layout-container" style={{ height: this.openLayouts ? 'max-content' : '75px' }}>
- <div className="layout" style={{ border: this.layout === 'blank' ? 'solid 2px #5b9ddd' : '' }} onClick={() => runInAction(() => { this.layout = 'blank' })} />
- <div className="layout" style={{ border: this.layout === 'title' ? 'solid 2px #5b9ddd' : '' }} onClick={() => runInAction(() => { this.layout = 'title' })}>
+ <div className="layout-container" style={{ height: 'max-content' }}>
+ <div className="layout" style={{ border: this.layout === 'blank' ? 'solid 2px #5b9ddd' : '' }} onClick={() => runInAction(() => { this.layout = 'blank'; this.createNewSlide(this.layout); })} />
+ <div className="layout" style={{ border: this.layout === 'title' ? 'solid 2px #5b9ddd' : '' }} onClick={() => runInAction(() => { this.layout = 'title'; this.createNewSlide(this.layout); })}>
<div className="title">Title</div>
<div className="subtitle">Subtitle</div>
</div>
- <div className="layout" style={{ border: this.layout === 'header' ? 'solid 2px #5b9ddd' : '' }} onClick={() => runInAction(() => { this.layout = 'header' })}>
+ <div className="layout" style={{ border: this.layout === 'header' ? 'solid 2px #5b9ddd' : '' }} onClick={() => runInAction(() => { this.layout = 'header'; this.createNewSlide(this.layout); })}>
<div className="title" style={{ alignSelf: 'center', fontSize: 10 }}>Section header</div>
</div>
- <div className="layout" style={{ border: this.layout === 'content' ? 'solid 2px #5b9ddd' : '' }} onClick={() => runInAction(() => { this.layout = 'content' })}>
+ <div className="layout" style={{ border: this.layout === 'content' ? 'solid 2px #5b9ddd' : '' }} onClick={() => runInAction(() => { this.layout = 'content'; this.createNewSlide(this.layout); })}>
<div className="title" style={{ alignSelf: 'center' }}>Title</div>
<div className="content">Text goes here</div>
</div>
- <div className="layout" style={{ border: this.layout === 'twoColumns' ? 'solid 2px #5b9ddd' : '' }} onClick={() => runInAction(() => { this.layout = 'twoColumns' })}>
+ <div className="layout" style={{ border: this.layout === 'twoColumns' ? 'solid 2px #5b9ddd' : '' }} onClick={() => runInAction(() => { this.layout = 'twoColumns'; this.createNewSlide(this.layout); })}>
<div className="title" style={{ alignSelf: 'center', gridColumn: '1/3' }}>Title</div>
<div className="content" style={{ gridColumn: 1, gridRow: 2 }}>Column one text</div>
<div className="content" style={{ gridColumn: 2, gridRow: 2 }}>Column two text</div>
</div>
</div>
- <div className="open-layout" onClick={() => runInAction(() => { this.openLayouts = !this.openLayouts })}>
- <FontAwesomeIcon style={{ transition: 'all 0.3s', transform: this.openLayouts ? 'rotate(180deg)' : 'rotate(0deg)' }} icon={"caret-down"} size={"lg"} />
- </div>
</div>
</div >
);
@@ -1033,9 +1024,17 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
}
createTemplate = (layout: string, input?: string) => {
+ const activeItem = Cast(this.childDocs[this.itemIndex], Doc, null);
+ const targetDoc = Cast(activeItem?.presentationTargetDoc, Doc, null);
+ let x = 0;
+ let y = 0;
+ if (activeItem && targetDoc) {
+ x = NumCast(targetDoc._x);
+ y = NumCast(targetDoc._y) + NumCast(targetDoc._height) + 20;
+ }
let doc = undefined;
const title = Docs.Create.TextDocument("Click to change title", {
- title: "Slide title", _width: 380, _height: 60, x: 10, y: 58, _fontSize: "24pt"
+ title: "Slide title", _width: 380, _height: 60, x: 10, y: 58, _fontSize: "24pt",
});
const subtitle = Docs.Create.TextDocument("Click to change subtitle", {
title: "Slide subtitle", _width: 380, _height: 50, x: 10, y: 118, _fontSize: "16pt"
@@ -1058,27 +1057,27 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
switch (layout) {
case 'blank':
doc = Docs.Create.FreeformDocument([], {
- title: input ? input : "Blank slide", _width: 400, _height: 225, _fitToBox: true
+ title: input ? input : "Blank slide", _width: 400, _height: 225, _fitToBox: true, x: x, y: y
});
break;
case 'title':
doc = Docs.Create.FreeformDocument([title, subtitle], {
- title: input ? input : "Title slide", _width: 400, _height: 225, _fitToBox: true
+ title: input ? input : "Title slide", _width: 400, _height: 225, _fitToBox: true, x: x, y: y
});
break;
case 'header':
doc = Docs.Create.FreeformDocument([header], {
- title: input ? input : "Section header", _width: 400, _height: 225, _fitToBox: true
+ title: input ? input : "Section header", _width: 400, _height: 225, _fitToBox: true, x: x, y: y
});
break;
case 'content':
doc = Docs.Create.FreeformDocument([contentTitle, content], {
- title: input ? input : "Title and content", _width: 400, _height: 225, _fitToBox: true
+ title: input ? input : "Title and content", _width: 400, _height: 225, _fitToBox: true, x: x, y: y
});
break;
case 'twoColumns':
doc = Docs.Create.FreeformDocument([contentTitle, content1, content2], {
- title: input ? input : "Title and two columns", _width: 400, _height: 225, _fitToBox: true
+ title: input ? input : "Title and two columns", _width: 400, _height: 225, _fitToBox: true, x: x, y: y
});
break;
default:
@@ -1218,7 +1217,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
<div className="ribbon-button" style={{ display: activeItem.scrollProgressivize ? "flex" : "none", backgroundColor: targetDoc.editScrollProgressivize ? "#aedef8" : "" }} onClick={this.editScrollProgressivize}>Edit</div>
</div>
</div>
- <div className="ribbon-final-box" style={{ display: activeItem.zoomProgressivize || activeItem.scrollProgressivize || activeItem.presProgressivize || activeItem.textProgressivize ? "inline-flex" : "none" }}>
+ <div className="ribbon-final-box" style={{ display: activeItem.zoomProgressivize || activeItem.scrollProgressivize || activeItem.presProgressivize || activeItem.textProgressivize ? "grid" : "none" }}>
Frames
<div className="ribbon-doubleButton">
<div className="ribbon-frameSelector">
diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx
index ce7a43315..90eb8580e 100644
--- a/src/client/views/presentationview/PresElementBox.tsx
+++ b/src/client/views/presentationview/PresElementBox.tsx
@@ -251,6 +251,10 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps, PresDoc
const dragData = new DragManager.DocumentDragData(PresBox.Instance.sortArray().map(doc => doc));
// let value = this.getValue(this._heading);
// value = typeof value === "string" ? `"${value}"` : value;
+ PresBox.Instance._dragArray.map(ele => {
+ ele.style.backgroundColor = "#d5dce2";
+ ele.style.borderRadius = '5px';
+ });
if (activeItem) {
DragManager.StartDocumentDrag(PresBox.Instance._dragArray.map(ele => ele), dragData, e.clientX, e.clientY);
activeItem.dragging = true;
@@ -295,10 +299,10 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps, PresDoc
onPointerDown={this.headerDown}
>
<>
- <div ref={this._dragRef} className="presElementBox-number">
+ <div className="presElementBox-number">
{`${this.indexInPres + 1}.`}
</div>
- <div className="presElementBox-name">
+ <div ref={this._dragRef} className="presElementBox-name">
{`${this.targetDoc?.title}`}
</div>
<Tooltip title={<><div className="dash-tooltip">{"Movement speed"}</div></>}><div className="presElementBox-time" style={{ display: PresBox.Instance.toolbarWidth > 300 ? "block" : "none" }}>{this.transition}</div></Tooltip>