preview: add page title, viewport, add 'again...' button

This commit is contained in:
mappu 2017-11-18 13:53:46 +13:00
parent 6ab2b08099
commit f27d14aac4

View File

@ -25,6 +25,8 @@ func (this *Server) handlePreview(w http.ResponseWriter, fileID string) {
tmpl := `<!DOCTYPE html>
<html>
<head>
<title>` + html.EscapeString(this.opts.ServerPublicProperties.AppTitle) + `</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
html, body {
background: #333;
@ -46,6 +48,15 @@ html, body {
<div class="thumbnail">
<a href="` + html.EscapeString(`/get/`+fileID) + `"><img src="` + html.EscapeString(`/thumb/m/`+fileID) + `"></a>
</div>
`
if this.opts.EnableHomepage {
tmpl += `
<div class="return">
<button onclick="window.location.href='/'">Again...</button>
</div>
`
}
tmpl += `
</div>
</body>
</html>`