diff options
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 47 |
1 files changed, 46 insertions, 1 deletions
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' }); } |