Skip to content
Snippets Groups Projects
Commit 59922bfd authored by ahamelers's avatar ahamelers
Browse files

Web preview once again available

parent f186965a
No related branches found
No related tags found
1 merge request!21Replace master with dev
......@@ -194,6 +194,7 @@ class EPMCTagged extends React.Component {
this.updateManuscriptFiles = updateManuscriptFiles.bind(this)
this.setNewManuscript = setNewManuscript.bind(this)
this.processXML = this.processXML.bind(this)
this.webPreview = this.webPreview.bind(this)
this.setError = this.setError.bind(this)
this.setAnnotate = this.setAnnotate.bind(this)
}
......@@ -228,7 +229,6 @@ class EPMCTagged extends React.Component {
this.setError(await err)
this.setState({
status: 'Something went wrong.',
html: 'Error. No Web Preview generated.',
})
})
}
......@@ -248,22 +248,19 @@ class EPMCTagged extends React.Component {
startAnnotator(document.getElementById('xml-preview-body'), options)
}
}
/*
async webPreview() {
console.log("FILESssssssssssssssssssssssssssss=======")
const { currentVersion } = this.props
const { files } = currentVersion
console.log("FILESssssssssssssssssssssssssssss=======")
console.log(files)
const html = files.find(file => file.type === 'tempHTML')
if (html) {
this.setState({ html: html.getElementById('xml-preview-body').outerHTML })
this.setAnnotate()
const response = await fetch(html.url)
this.setState({ html: await response.text() }, () => {
this.setAnnotate()
})
} else {
this.setState({ html: 'Error. No Web Preview generated.' })
}
}
*/
render() {
const { currentVersion, currentUser, uploadFile } = this.props
const { files: allfiles, metadata, source } = currentVersion
......@@ -296,8 +293,7 @@ class EPMCTagged extends React.Component {
)}
<Button
onClick={() => {
// this.webPreview()
this.setAnnotate()
this.webPreview()
this.setState({ pane: 'web' })
}}
primary={pane !== 'web'}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment