diff --git a/res/template/file_viewer.html b/res/template/file_viewer.html index 25a963a..059dfe4 100644 --- a/res/template/file_viewer.html +++ b/res/template/file_viewer.html @@ -279,11 +279,14 @@ {{template `TextViewer.js`}} {{template `FileViewer.js`}} - // This info gets filled in on the server side to prevent having to make an API call right after the page loads. - // Just to slice another few milliseconds from the load time :) - window.addEventListener("load", function(){ - new Viewer('{{.Other.Type}}', '{{.Other.ViewToken}}', {{.Other.APIResponse}}); - }); + // DOMContentLoaded fires when the DOM tree has been parsed, but + // before the assets have loaded + window.addEventListener("DOMContentLoaded", () => { + // This info gets filled in on the server side to prevent having to + // make an API call right after the page loads. Just to slice + // another few milliseconds from the load time :) + new Viewer('{{.Other.Type}}', '{{.Other.ViewToken}}', {{.Other.APIResponse}}) + }) {{template "analytics"}} @@ -292,13 +295,17 @@ {{ if eq .Other.AdType 5 }} - {{ else if eq .Other.AdType 7}} + {{ else if eq .Other.AdType 7 }} {{ end }} {{ end }} diff --git a/res/template/home.html b/res/template/home.html index 2736c6f..19bdce7 100644 --- a/res/template/home.html +++ b/res/template/home.html @@ -125,6 +125,37 @@ Header image
+
+
+

+ Hello! Due to + an ice storm in Oregon + the datacenter where pixeldrain is hosted in North America + was cut off from the internet and has lost power. This + caused an outage of a few hours yesterday (it happened when + I was out ice skating). +

+

+ I am now redirecting all American (north and south) traffic + to the UK, the server there has more than enough capacity to + handle it all. Due to the long distance the website might + feel a bit slower. +

+

+ Files which were uploaded to the server in Oregon shortly + before the outage will not be available until the server is + back up. Normally all files are backed up in Finland, but + this process takes a while. Due to the abruptness of the + outage a lot of files could not make it over. When the + server comes back online your files will be downloadable + again. +

+

+ I will post updates on Twitter when the situation changes. +

+
+
1 diff --git a/webcontroller/file_viewer.go b/webcontroller/file_viewer.go index 7e6d7ff..2ba7e56 100644 --- a/webcontroller/file_viewer.go +++ b/webcontroller/file_viewer.go @@ -48,22 +48,20 @@ func adType() int { // or 1 we need to give it n=2. We can use this function to make other // splits like 1/3 1/4, etc switch i := rand.Intn(20); i { - case 0, 1, 2: + case 0, 1: // 10% return amarulaSolutions - case 3: + case 2: // 5% return pdpro1 - case 4: + case 3: // 5% return pdpro2 - case 5: + case 4: // 5% return pdpro3 - case 6: + case 5: // 5% return pdpro4 - case 7, 8, 9: - return adMaven - case 10, 11, 12, 13, 14, 15, 16, 17, 18, 19: + default: // 70% return propellerAds - default: - panic(fmt.Errorf("random number generator returned unrecognised number: %d", i)) + // default: + // panic(fmt.Errorf("random number generator returned unrecognised number: %d", i)) } }