diff --git a/res/include/script/file_viewer/Viewer.js b/res/include/script/file_viewer/Viewer.js index 070e5f0..e69eb6e 100644 --- a/res/include/script/file_viewer/Viewer.js +++ b/res/include/script/file_viewer/Viewer.js @@ -133,21 +133,21 @@ Viewer.prototype.setFile = function(file) { } Viewer.prototype.renderSponsorsSimple = function() { - let scale = 1 - let scaleWidth = 1 - let scaleHeight = 1 - let minWidth = 768 - let minHeight = 1000 + let scaleWidth = 1 + let scaleHeight = 1 + let minWindowHeight = 1000 + let bannerWidth = 720 + let bannerHeight = 120 - if (window.innerWidth < minWidth) { - scaleWidth = window.innerWidth/minWidth + if (window.innerWidth < bannerWidth) { + scaleWidth = window.innerWidth/bannerWidth } - if (window.innerHeight < minHeight) { - scaleHeight = window.innerHeight/minHeight + if (window.innerHeight < minWindowHeight) { + scaleHeight = window.innerHeight/minWindowHeight } - scale = scaleWidth < scaleHeight ? scaleWidth : scaleHeight - - document.querySelector(".sponsors").style.height = (scale*128)+"px" + + let scale = scaleWidth < scaleHeight ? scaleWidth : scaleHeight + document.querySelector(".sponsors").style.height = (scale*bannerHeight)+"px" } // Viewer.prototype.renderSponsors = function() { diff --git a/res/static/img/misc/banner_as.png b/res/static/img/misc/banner_as.png index 1c77516..53ca182 100644 Binary files a/res/static/img/misc/banner_as.png and b/res/static/img/misc/banner_as.png differ diff --git a/res/template/file_viewer.html b/res/template/file_viewer.html index 9b14e4a..303329f 100644 --- a/res/template/file_viewer.html +++ b/res/template/file_viewer.html @@ -100,7 +100,7 @@
- +
diff --git a/res/template/hide_refer.html b/res/template/hide_refer.html new file mode 100644 index 0000000..078eb36 --- /dev/null +++ b/res/template/hide_refer.html @@ -0,0 +1,22 @@ +{{define "hide_refer"}} + + + You are being redirected + + + + + You are being redirected.
+
+ If it doesn't work. Click here. + + + + +{{end}} diff --git a/webcontroller/ad_click.go b/webcontroller/ad_click.go index 705a539..65038bb 100644 --- a/webcontroller/ad_click.go +++ b/webcontroller/ad_click.go @@ -14,8 +14,11 @@ import ( func (wc *WebController) serveAdClick(w http.ResponseWriter, r *http.Request, p httprouter.Params) { // Redirect the user to the target page + w.Header().Set("Referrer-Policy", "origin") http.Redirect(w, r, r.URL.Query().Get("target"), http.StatusTemporaryRedirect) + // wc.templates.Get().ExecuteTemplate(w, "hide_refer", r.URL.Query().Get("target")) + api := pixelapi.New(wc.apiURLInternal) // The Real IP is used in the API server to determine that the view is not