Merge branch 'master' of fornaxian.com:Pixeldrain/pixeldrain-web

This commit is contained in:
2020-03-10 17:07:30 +01:00
5 changed files with 38 additions and 13 deletions

View File

@@ -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() {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 KiB

After

Width:  |  Height:  |  Size: 79 KiB

View File

@@ -100,7 +100,7 @@
</div>
<div id="sponsors" class="sponsors">
<a href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.amarulasolutions.com%2Fnews%2Fembedded-world-2020%2F">
<a href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.amarulasolutions.com">
<img src="/res/img/misc/banner_as.png" style="display: block; margin: auto; height: 100%;" />
</a>
</div>

View File

@@ -0,0 +1,22 @@
{{define "hide_refer"}}<!DOCTYPE html>
<html>
<head>
<title>You are being redirected</title>
<!-- <meta http-equiv="refresh" content="0; {{.}}" /> -->
<style>html, body {background-color: #000000;}</style>
</head>
<body>
You are being redirected.<br/>
<br/>
If it doesn't work. <a id="link" href="{{.}}">Click here</a>.
<script>
var a = document.getElementById("link");
if(!a.click) {
window.location = "{{.}}";
}
a.click();
</script>
</body>
</html>
{{end}}

View File

@@ -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