aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-11-15 14:24:11 -0500
committerbobzel <zzzman@gmail.com>2022-11-15 14:24:11 -0500
commit51a85bae74c3d8ccddb57f6063e93b237cdf1ebd (patch)
tree01f3af984eeef920284547e86583f60d76866375 /src/client
parent19f317bd43a7cc8df0daf1c0642011cc8754e14b (diff)
added playback of audio annotation on inPlace container. fixed image anchors to be marked un-rendered so link lines show up.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/util/DocumentManager.ts2
-rw-r--r--src/client/views/PropertiesButtons.tsx2
-rw-r--r--src/client/views/nodes/DocumentView.scss6
-rw-r--r--src/client/views/nodes/ImageBox.tsx11
4 files changed, 12 insertions, 9 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index ef0a339ce..519f75dbd 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -252,7 +252,7 @@ export class DocumentManager {
} else {
if (!targetDocContext) {
// we don't have a view and there's no context specified ... create a new view of the target using the dockFunc or default
- createViewFunc(Doc.BrushDoc(targetDoc), finished); // bcz: should we use this?: Doc.MakeAlias(targetDoc)));
+ createViewFunc(Doc.BrushDoc(targetDoc), () => focusAndFinish(true)); // bcz: should we use this?: Doc.MakeAlias(targetDoc)));
} else {
// otherwise try to get a view of the context of the target
if (targetDocContextView) {
diff --git a/src/client/views/PropertiesButtons.tsx b/src/client/views/PropertiesButtons.tsx
index d27848a90..656a56a15 100644
--- a/src/client/views/PropertiesButtons.tsx
+++ b/src/client/views/PropertiesButtons.tsx
@@ -138,7 +138,7 @@ export class PropertiesButtons extends React.Component<{}, {}> {
DocUtils.MakeLink({ doc: dv.rootDoc }, { doc: menuDoc }, 'back link to container');
}
DocListCast(menuDoc[Doc.LayoutFieldKey(menuDoc)]).forEach(menuItem => {
- menuItem.followAllLinks = menuItem._isLinkButton = true;
+ menuItem.followLinkAudio = menuItem.followAllLinks = menuItem._isLinkButton = true;
menuItem._followLinkLocation = 'inPlace';
});
}
diff --git a/src/client/views/nodes/DocumentView.scss b/src/client/views/nodes/DocumentView.scss
index e437d295e..01188d3fa 100644
--- a/src/client/views/nodes/DocumentView.scss
+++ b/src/client/views/nodes/DocumentView.scss
@@ -198,9 +198,9 @@
> .documentView-titleWrapper-hover {
display: inline-block;
}
- > .documentView-contentsView {
- opacity: 0.5;
- }
+ // > .documentView-contentsView {
+ // opacity: 0.5;
+ // }
> .documentView-captionWrapper {
opacity: 1;
}
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index d67481b22..8ecd8104a 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -84,6 +84,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp
this.layoutDoc._panX = NumCast(anchor._panX, NumCast(this.layoutDoc._panY));
this.layoutDoc._panY = NumCast(anchor._panY, NumCast(this.layoutDoc._panX));
this.layoutDoc._viewScale = NumCast(anchor._viewScale, NumCast(this.layoutDoc._viewScale));
+ this.layoutDoc[this.fieldKey + '-useAlt'] = Cast(anchor._useAlt, 'boolean', null);
if (anchor.type === DocumentType.MARKER) {
this.dataDoc[this.annotationKey] = new List<Doc>(DocListCast(anchor._annotations));
}
@@ -93,9 +94,11 @@ export class ImageBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp
}; // sets viewing information for a componentview, typically when following a link. 'preview' tells the view to use the values without writing to the document
getAnchor = () => {
- const zoomedAnchor = () => Docs.Create.ImageanchorDocument({ viewTransitionTime: 1000, _viewScale: NumCast(this.layoutDoc._viewScale), _panX: NumCast(this.layoutDoc._panX), _panY: NumCast(this.layoutDoc._panY) });
- const anchor = this._getAnchor?.(this._savedAnnotations) ?? (this.layoutDoc.viewScale ? zoomedAnchor() : undefined);
+ const anchor =
+ this._getAnchor?.(this._savedAnnotations) ?? // use marquee anchor, otherwise, save zoom/pan as anchor
+ Docs.Create.ImageanchorDocument({ viewTransitionTime: 1000, unrendered: true, annotationOn: this.rootDoc, _viewScale: NumCast(this.layoutDoc._viewScale, 1), _panX: NumCast(this.layoutDoc._panX), _panY: NumCast(this.layoutDoc._panY) });
if (anchor) {
+ anchor._useAlt = Cast(this.layoutDoc[this.fieldKey + '-useAlt'], 'boolean', null);
anchor._annotations = new List<Doc>(DocListCast(this.dataDoc[this.annotationKey]));
this.addDocument(anchor);
return anchor;
@@ -222,7 +225,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp
const funcs: ContextMenuProps[] = [];
funcs.push({ description: 'Rotate Clockwise 90', event: this.rotate, icon: 'expand-arrows-alt' });
funcs.push({ description: `Show ${this.layoutDoc._showFullRes ? 'Dynamic Res' : 'Full Res'}`, event: this.resolution, icon: 'expand-arrows-alt' });
- funcs.push({ description: `${this.layoutDoc[this.fieldKey + '-useAlt'] ? 'Show Primary' : 'Show Alternate'}`, event: this.setUseAlt, icon: 'expand-arrows-alt' });
+ funcs.push({ description: `${this.layoutDoc[this.fieldKey + '-useAlt'] ? 'Show Alternate' : 'Show Primary'}`, event: this.setUseAlt, icon: 'expand-arrows-alt' });
funcs.push({ description: 'Copy path', event: () => Utils.CopyText(this.choosePath(field.url)), icon: 'expand-arrows-alt' });
if (!Doc.noviceMode) {
funcs.push({ description: 'Export to Google Photos', event: () => GooglePhotos.Transactions.UploadImages([this.props.Document]), icon: 'caret-square-right' });
@@ -353,7 +356,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp
TraceMobx();
const srcpath = this.paths[0];
- const fadepath = this.paths[Math.min(1, this.paths.length - 1)];
+ const fadepath = this.paths.lastElement();
const { nativeWidth, nativeHeight, nativeOrientation } = this.nativeSize;
const rotation = NumCast(this.dataDoc[this.fieldKey + '-rotation']);
const aspect = rotation % 180 ? nativeHeight / nativeWidth : 1;