diff --git a/res/include/script/file_viewer/Viewer.js b/res/include/script/file_viewer/Viewer.js index 484a6f9..d0f0e24 100644 --- a/res/include/script/file_viewer/Viewer.js +++ b/res/include/script/file_viewer/Viewer.js @@ -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) diff --git a/res/include/script/file_viewer/viewer_scripts/AbuseViewer.js b/res/include/script/file_viewer/viewer_scripts/AbuseViewer.js new file mode 100644 index 0000000..4d371cb --- /dev/null +++ b/res/include/script/file_viewer/viewer_scripts/AbuseViewer.js @@ -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) +} diff --git a/res/template/451.html b/res/template/451.html new file mode 100644 index 0000000..761c00f --- /dev/null +++ b/res/template/451.html @@ -0,0 +1,21 @@ +{{define "451"}} + + + {{template "meta_tags" "451, Unavailable For Legal Reasons"}} + {{template "user_style" .}} + + + + {{template "page_top" .}} +

451, Unavailable For Legal Reasons

+
+

+ Hello. This file has received an abuse report and has been taken + down. It cannot be shared anymore. +

+
+ {{template "page_bottom" .}} + {{template "analytics"}} + + +{{end}} diff --git a/res/template/file_viewer.html b/res/template/file_viewer.html index c83b526..2dfe3fd 100644 --- a/res/template/file_viewer.html +++ b/res/template/file_viewer.html @@ -219,6 +219,7 @@ {{template `ListNavigator.js`}} {{template `Viewer.js`}} + {{template `AbuseViewer.js`}} {{template `ImageViewer.js`}} {{template `VideoViewer.js`}} {{template `AudioViewer.js`}} diff --git a/webcontroller/file_viewer.go b/webcontroller/file_viewer.go index f0b09be..8d7d821 100644 --- a/webcontroller/file_viewer.go +++ b/webcontroller/file_viewer.go @@ -35,7 +35,7 @@ func adType() (i int) { // splits like 1/3 1/4, etc i = rand.Intn(4) - // The return value correstonds to the type of ad shown: + // The return value corresponds to the type of ad shown: // 0: A-ads // 1: Amarulasolutions // 2: Patreon