add abuse file viewer
This commit is contained in:
@@ -102,6 +102,10 @@ Viewer.prototype.setFile = function(file) {
|
||||
}
|
||||
|
||||
if (
|
||||
file.abuse_type !== ""
|
||||
) {
|
||||
new AbuseViewer(this,file).render(this.divFilepreview)
|
||||
}else if (
|
||||
file.mime_type.startsWith("image")
|
||||
) {
|
||||
new ImageViewer(this, file).render(this.divFilepreview)
|
||||
|
28
res/include/script/file_viewer/viewer_scripts/AbuseViewer.js
Normal file
28
res/include/script/file_viewer/viewer_scripts/AbuseViewer.js
Normal file
@@ -0,0 +1,28 @@
|
||||
function AbuseViewer(viewer, file, next) {
|
||||
this.viewer = viewer
|
||||
this.file = file
|
||||
this.next = next
|
||||
|
||||
this.container = document.createElement("div")
|
||||
this.container.classList = "image-container"
|
||||
this.container.appendChild(document.createElement("br"))
|
||||
|
||||
this.title = document.createElement("h1")
|
||||
this.title.innerText = "Unavailable For Legal Reasons"
|
||||
this.container.appendChild(this.title)
|
||||
|
||||
this.description = document.createElement("p")
|
||||
// this.description.style.maxWidth = "500px"
|
||||
this.description.innerText = "This file has received an abuse report and "+
|
||||
"was taken down."
|
||||
this.container.appendChild(this.description)
|
||||
|
||||
this.description2 = document.createElement("p")
|
||||
this.description2.innerText = "Type of abuse: '"+file.abuse_type+"'. "+
|
||||
"Reporter: '"+file.abuse_reporter_name+"'."
|
||||
this.container.appendChild(this.description2)
|
||||
}
|
||||
|
||||
AbuseViewer.prototype.render = function(parent) {
|
||||
parent.appendChild(this.container)
|
||||
}
|
Reference in New Issue
Block a user