1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package report
16
17 import (
18 "html/template"
19 )
20
21
22 func AddSourceTemplates(t *template.Template) {
23 template.Must(t.Parse(`{{define "weblistcss"}}` + weblistPageCSS + `{{end}}`))
24 template.Must(t.Parse(`{{define "weblistjs"}}` + weblistPageScript + `{{end}}`))
25 }
26
27 const weblistPageCSS = `<style type="text/css">
28 body #content{
29 font-family: sans-serif;
30 }
31 h1 {
32 font-size: 1.5em;
33 }
34 .legend {
35 font-size: 1.25em;
36 }
37 .line, .nop, .unimportant {
38 color: #aaaaaa;
39 }
40 .inlinesrc {
41 color: #000066;
42 }
43 .livesrc {
44 cursor: pointer;
45 }
46 .livesrc:hover {
47 background-color: #eeeeee;
48 }
49 .asm {
50 color: #008800;
51 display: none;
52 }
53 </style>`
54
55 const weblistPageScript = `<script type="text/javascript">
56 function pprof_toggle_asm(e) {
57 var target;
58 if (!e) e = window.event;
59 if (e.target) target = e.target;
60 else if (e.srcElement) target = e.srcElement;
61
62 if (target) {
63 var asm = target.nextSibling;
64 if (asm && asm.className == "asm") {
65 asm.style.display = (asm.style.display == "block" ? "" : "block");
66 e.preventDefault();
67 return false;
68 }
69 }
70 }
71 </script>`
72
73 const weblistPageClosing = `
74 </body>
75 </html>`
76
View as plain text