diff options
Diffstat (limited to 'scraper/client')
| -rw-r--r-- | scraper/client/paper/citationList.component.js | 6 | ||||
| -rw-r--r-- | scraper/client/paper/paper.css | 2 | ||||
| -rw-r--r-- | scraper/client/paper/paper.verify.js | 33 | ||||
| -rw-r--r-- | scraper/client/store.js | 2 |
4 files changed, 39 insertions, 4 deletions
diff --git a/scraper/client/paper/citationList.component.js b/scraper/client/paper/citationList.component.js index 10e3ba9a..be8528bf 100644 --- a/scraper/client/paper/citationList.component.js +++ b/scraper/client/paper/citationList.component.js @@ -52,6 +52,12 @@ class CitationList extends Component { ? cite.pdf.map((pdf, i) => <a key={'pdf_' + i} href={pdf} rel='noopener noreferrer' target="_blank">[pdf]</a>) : "no pdf" } + cite.doi = { + _raw: true, + value: (cite.doi && cite.doi.length) + ? (cite.doi || []).map((doi, i) => <a key={'doi_' + i} href={doi} rel='noopener noreferrer' target="_blank">[doi]</a>) + : "" + } cite.s2 = { _raw: true, value: <a diff --git a/scraper/client/paper/paper.css b/scraper/client/paper/paper.css index 9bb684ff..21df2df1 100644 --- a/scraper/client/paper/paper.css +++ b/scraper/client/paper/paper.css @@ -44,6 +44,8 @@ .gray .pdfLink { cursor: pointer; color: #11f; + margin-left: 3px; + margin-right: 3px; } .verified { font-weight: bold; diff --git a/scraper/client/paper/paper.verify.js b/scraper/client/paper/paper.verify.js index f5dbc13c..1301239b 100644 --- a/scraper/client/paper/paper.verify.js +++ b/scraper/client/paper/paper.verify.js @@ -195,13 +195,14 @@ class PaperVerify extends Component { <h3>{citation.title}</h3> <div className='gray'> {citation.id} - {' | PDFs: '} - {citation.pdf.map((pdf,i) => { + {citation.pdf.length ? ' | PDF: ' : ''} + {citation.pdf.map((pdf, i) => { const domain = pdf.replace('www.','').split('/').slice(2,3)[0] || 'unknown' return ( <a key={i} href={pdf} + rel={"noopener noreferrer"} onClick={() => this.setState({ pdf_index: i })} className={i === this.state.pdf_index ? 'selected pdfLink' : 'pdfLink'} > @@ -209,13 +210,39 @@ class PaperVerify extends Component { </a> ) })} + {(citation.doi && citation.doi.length) ? ' | DOI: ' : ''} + {(citation.doi || []).map((doi, i) => { + if (!doi) return null + const domain = doi.replace('www.','').split('/').slice(2,3)[0] || 'unknown' + return ( + <a + key={i} + href={doi} + target={"_blank"} + rel={"noopener noreferrer"} + className={'pdfLink'} + > + {'[' + domain + ']'} + </a> + ) + })} {' | '} <a href={'https://www.semanticscholar.org/paper/' + citation.id} target="_blank" + rel={"noopener noreferrer"} + className={'pdfLink'} + > + {'Semantic Scholar'} + </a> + {' | '} + <a + href={'https://duckduckgo.com/?q=' + encodeURIComponent(citation.title)} + target="_blank" + rel={"noopener noreferrer"} className={'pdfLink'} > - {'[semantic scholar]'} + {'Search DuckDuckGo'} </a> </div> diff --git a/scraper/client/store.js b/scraper/client/store.js index 6da60cbe..acd22b82 100644 --- a/scraper/client/store.js +++ b/scraper/client/store.js @@ -47,7 +47,7 @@ export default function apiReducer(state = initialState(), action) { } case types.system.set_sorted_citations: - console.log(action.sortedCitations || []) + // console.log(action.sortedCitations || []) return { ...state, sortedCitations: action.sortedCitations || [], |
