aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/views/collections/CollectionSchemaView.tsx16
-rw-r--r--src/client/views/nodes/PDFBox.scss31
-rw-r--r--src/client/views/nodes/PDFBox.tsx5
-rw-r--r--src/client/views/pdf/PDFViewer.tsx2
4 files changed, 41 insertions, 13 deletions
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 59cce7386..853808335 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -303,21 +303,17 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
this.props.Document.textwrappedSchemaRows = new List<string>(textWrappedRows);
}
- @computed get resized(): { "id": string, "value": number }[] {
+ @computed get resized(): { id: string, value: number }[] {
return this.columns.reduce((resized, shf) => {
- if (shf.width > -1) {
- resized.push({ "id": shf.heading, "value": shf.width });
- }
+ (shf.width > -1) && resized.push({ id: shf.heading, value: shf.width });
return resized;
- }, [] as { "id": string, "value": number }[]);
+ }, [] as { id: string, value: number }[]);
}
- @computed get sorted(): { id: string, desc: boolean }[] {
+ @computed get sorted(): { id: string, desc?: true }[] {
return this.columns.reduce((sorted, shf) => {
- if (shf.desc) {
- sorted.push({ "id": shf.heading, "desc": shf.desc });
- }
+ shf.desc && sorted.push({ id: shf.heading, desc: shf.desc });
return sorted;
- }, [] as { id: string, desc: boolean }[]);
+ }, [] as { id: string, desc?: true }[]);
}
@computed get borderWidth() { return Number(COLLECTION_BORDER_WIDTH); }
diff --git a/src/client/views/nodes/PDFBox.scss b/src/client/views/nodes/PDFBox.scss
index 2917c81cb..3f5f47e05 100644
--- a/src/client/views/nodes/PDFBox.scss
+++ b/src/client/views/nodes/PDFBox.scss
@@ -9,6 +9,37 @@
z-index: -1;
}
+.pdfBox-title-outer {
+
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ background: lightslategray;
+ .pdfBox-title-cont {
+ width: 150%;
+ height: 100%;
+ position: relative;
+ display: grid;
+
+ .pdfBox-title {
+ color:lightgray;
+ margin-top: auto;
+ margin-bottom: auto;
+ transform-origin: 42% -18%;
+ width: 100%;
+ transform: rotate(55deg);
+ font-size: 144;
+ padding: 5%;
+ overflow: hidden;
+ display: inline-block;
+ white-space: pre;
+ text-overflow: ellipsis;
+ text-align: center;
+ }
+ }
+}
+
+
.pdfBox-cont {
pointer-events: none;
.collectionFreeFormView-none {
diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx
index fe71e76fd..3014af944 100644
--- a/src/client/views/nodes/PDFBox.tsx
+++ b/src/client/views/nodes/PDFBox.tsx
@@ -180,8 +180,9 @@ export class PDFBox extends DocComponent<FieldViewProps, PdfDocument>(PdfDocumen
render() {
const pdfUrl = Cast(this.dataDoc[this.props.fieldKey], PdfField);
let classname = "pdfBox-cont" + (InkingControl.Instance.selectedTool || !this.active ? "" : "-interactive");
- return (!(pdfUrl instanceof PdfField) || !this._pdf ?
- <div>{`pdf, ${this.dataDoc[this.props.fieldKey]}, not found`}</div> :
+ return (!(pdfUrl instanceof PdfField) || !this._pdf || this.props.ScreenToLocalTransform().Scale > 6 ?
+ <div className="pdfBox-title-outer"><div className="pdfBox-title-cont" >
+ <strong className="pdfBox-title" >{` ${this.props.Document.title}`}</strong> </div></div> :
<div className={classname} onContextMenu={this.specificContextMenu} onPointerDown={(e: React.PointerEvent) => {
let hit = document.elementFromPoint(e.clientX, e.clientY);
if (hit && hit.localName === "span" && this.props.isSelected()) { // drag selecting text stops propagation
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index 13fd8ea98..3bf53340b 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -628,7 +628,7 @@ export class PDFViewer extends React.Component<IViewerProps> {
}
let nativeWidth = NumCast(this.props.Document.nativeWidth);
let nativeHeight = NumCast(this.props.Document.nativeHeight);
- return <img key={this._coverPath.path} src={this._coverPath.path} onLoad={action(() => this._showWaiting = false)}
+ return <img key={this._coverPath.path} src={this._coverPath.path} onError={action(() => this._coverPath.path = "http://www.cs.brown.edu/~bcz/face.gif")} onLoad={action(() => this._showWaiting = false)}
style={{ position: "absolute", display: "inline-block", top: 0, left: 0, width: `${nativeWidth}px`, height: `${nativeHeight}px` }} />;
}