update pdf viewer and remove CORS check
This commit is contained in:
@@ -51,10 +51,7 @@ function Viewer(type, viewToken, data) {
|
||||
document.getElementById("stat_views").remove()
|
||||
document.getElementById("stat_downloads_label").remove()
|
||||
document.getElementById("stat_downloads").remove()
|
||||
|
||||
let file = fileFromSkyNet(data)
|
||||
console.log(file)
|
||||
this.setFile(file)
|
||||
this.setFile(fileFromSkyNet(data))
|
||||
}
|
||||
|
||||
this.renderSponsors()
|
||||
@@ -247,7 +244,7 @@ function fileFromSkyNet(resp) {
|
||||
let file = fileFromAPIResp(resp)
|
||||
file.icon_href = "/res/img/mime/empty.png"
|
||||
file.get_href = "https://siasky.net/"+resp.id
|
||||
file.download_href = "https://siasky.net/"+resp.id
|
||||
file.download_href = "https://siasky.net/"+resp.id+"?attachment=1"
|
||||
file.availability_href = ""
|
||||
file.view_href = ""
|
||||
file.timeseries_href = ""
|
||||
|
@@ -5,7 +5,7 @@ function PDFViewer(viewer, file) {
|
||||
this.container = document.createElement("iframe")
|
||||
this.container.classList = "image-container"
|
||||
this.container.style.border = "none"
|
||||
this.container.src = "/res/misc/pdf-viewer/web/viewer.html?file="+this.file.get_href
|
||||
this.container.src = "/res/misc/pdf-viewer/web/viewer.html?file="+encodeURIComponent(this.file.get_href)
|
||||
}
|
||||
PDFViewer.prototype.render = function(parent) {
|
||||
parent.appendChild(this.container)
|
||||
|
Reference in New Issue
Block a user