diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/MainView.tsx | 1 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 47 | ||||
-rw-r--r-- | src/client/views/nodes/formattedText/FormattedTextBox.tsx | 1 |
3 files changed, 48 insertions, 1 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index 350883f70..03c0642ed 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -464,6 +464,7 @@ export class MainView extends React.Component { fa.faPhoneSlash, fa.faGripLines, fa.faSave, + fa.faBook, fa.faBookmark, fa.faList, fa.faListOl, diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 16b5809fa..d3858c25e 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -959,10 +959,55 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps const help = cm.findByDescription('Help...'); const helpItems: ContextMenuProps[] = help && 'subitems' in help ? help.subitems : []; - helpItems.push({ description: 'Show Fields ', event: () => this.props.addDocTab(Docs.Create.KVPDocument(this.props.Document, { _width: 300, _height: 300 }), 'add:right'), icon: 'layer-group' }); + helpItems.push({ description: 'Show Metadata', event: () => this.props.addDocTab(Docs.Create.KVPDocument(this.props.Document, { _width: 300, _height: 300 }), 'add:right'), icon: 'layer-group' }); !Doc.noviceMode && helpItems.push({ description: 'Text Shortcuts Ctrl+/', event: () => this.props.addDocTab(Docs.Create.PdfDocument('/assets/cheat-sheet.pdf', { _width: 300, _height: 300 }), 'add:right'), icon: 'keyboard' }); !Doc.noviceMode && helpItems.push({ description: 'Print Document in Console', event: () => console.log(this.props.Document), icon: 'hand-point-right' }); !Doc.noviceMode && helpItems.push({ description: 'Print DataDoc in Console', event: () => console.log(this.props.Document[DataSym]), icon: 'hand-point-right' }); + + let documentationDescription: string | undefined = undefined; + let documentationLink: string | undefined = undefined; + console.log("type: ", this.props.Document.type); + switch(this.props.Document.type) { + case DocumentType.COL: + documentationDescription = "See collection documentation"; + documentationLink = "https://brown-dash.github.io/Dash-Documentation/views/"; + break; + case DocumentType.PDF: + documentationDescription = "See PDF node documentation"; + documentationLink = "https://brown-dash.github.io/Dash-Documentation/documents/pdf/"; + break; + case DocumentType.VID: + documentationDescription = "See video node documentation"; + documentationLink = "https://brown-dash.github.io/Dash-Documentation/documents/tempMedia/video"; + break; + case DocumentType.AUDIO: + documentationDescription = "See audio node documentation"; + documentationLink = "https://brown-dash.github.io/Dash-Documentation/documents/tempMedia/audio"; + break; + case DocumentType.WEB: + documentationDescription = "See webpage node documentation"; + documentationLink = "https://brown-dash.github.io/Dash-Documentation/documents/webpage/"; + break; + case DocumentType.IMG: + documentationDescription = "See image node documentation"; + documentationLink = "https://brown-dash.github.io/Dash-Documentation/documents/images/"; + break; + case DocumentType.RTF: + documentationDescription = "See text node documentation"; + documentationLink = "https://brown-dash.github.io/Dash-Documentation/documents/text/"; + break; + default: + break; + } + + // Add link to help documentation + if (documentationDescription && documentationLink) { + console.log("add documentation item"); + helpItems.push({ description: documentationDescription, event: () => { + window.open(documentationLink, '_blank'); + }, icon: 'book' }) + }; + cm.addItem({ description: 'Help...', noexpand: true, subitems: helpItems, icon: 'question' }); } diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index 6db199149..a94e2c96d 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -787,6 +787,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FieldViewProps const appearanceItems = appearance && 'subitems' in appearance ? appearance.subitems : []; appearanceItems.push({ description: 'Change Perspective...', noexpand: true, subitems: changeItems, icon: 'external-link-alt' }); // this.rootDoc.isTemplateDoc && appearanceItems.push({ description: "Make Default Layout", event: async () => Doc.UserDoc().defaultTextLayout = new PrefetchProxy(this.rootDoc), icon: "eye" }); + !Doc.noviceMode && appearanceItems.push({ description: 'Make Default Layout', |