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