@@ -80,20 +80,6 @@ def head(self):
8080 )
8181 for css in ('extlib/reset-20110126.min' , 'pygments_c' , 'style' )
8282 )
83- head .append (E .SCRIPT (
84- src = 'http://cdnjs.cloudflare.com/ajax/libs/zepto/1.1.3/zepto.js' ,
85- type = 'text/javascript' ,
86- ))
87- head .extend (
88- E .SCRIPT (
89- file_contents (js + '.js' ),
90- type = 'text/javascript' ,
91- )
92- for js in (
93- 'extlib/prefixfree-1.0.4.min' ,
94- 'script'
95- )
96- )
9783 return head
9884
9985 def raw_code (self ):
@@ -135,40 +121,35 @@ def header(self):
135121 E .DIV (
136122 E .ATTR (id = 'title' ),
137123 E .H1 (
138- 'GCC Python Plugin' ,
124+ E .A (
125+ 'GCC Python Plugin' ,
126+ href = 'http://gcc-python-plugin.readthedocs.org/' ,
127+ ),
139128 ),
140129 E .DIV (
141- E .ATTR (id = 'filename ' ),
130+ E .ATTR (id = 'info ' ),
142131 E .SPAN (
143132 E .CLASS ('label' ),
144133 'Filename: ' ,
145134 ),
146135 self .data ['filename' ],
147- ),
148- ),
149- E .E .nav (
150- E .ATTR (id = 'nav' ),
151- E .DIV (
152- E .ATTR (id = 'function' ),
153- E .H3 ('Function' ),
136+ E .SPAN (
137+ E .CLASS ('label' ),
138+ 'Function: ' ,
139+ ),
154140 self .data ['function' ]['name' ],
155141 ),
156142 E .DIV (
157143 E .ATTR (id = 'report-pagination' ),
158- E .H3 ('Report' ),
144+ E .SPAN (
145+ E .CLASS ('label' ),
146+ 'Report: ' ,
147+ ),
159148 * (
160149 E .A (str (i + 1 ), href = "#state{0}" .format (i + 1 ))
161150 for i in range (len (self .data ['reports' ]))
162151 )
163152 ),
164- E .DIV (
165- E .ATTR (id = 'bug-toggle' ),
166- E .IMG (
167- src = data_uri ('image/png' , 'images/bug.png' ),
168- ),
169- E .H3 ('Bug' ),
170- ' [count]' ,
171- ),
172153 E .DIV (
173154 E .ATTR (id = 'prev' ),
174155 E .IMG (
@@ -184,6 +165,25 @@ def header(self):
184165 ),
185166 )
186167
168+ @staticmethod
169+ def footer ():
170+ """put non-essential javascript in the footer"""
171+ return E .E .footer (
172+ # zepto is the one resource we don't embed.
173+ # It's (relatively) big, and non-essential.
174+ E .SCRIPT (
175+ src = (
176+ 'http://cdnjs.cloudflare.com'
177+ '/ajax/libs/zepto/1.1.3/zepto.js'
178+ ),
179+ type = 'text/javascript' ,
180+ ),
181+ E .SCRIPT (
182+ file_contents ('script.js' ),
183+ type = 'text/javascript' ,
184+ ),
185+ )
186+
187187 def states (self ):
188188 """Return an ordered-list of states, for each report."""
189189 for report in self .data ['reports' ]:
@@ -239,28 +239,32 @@ def body(self):
239239 reports .append (
240240 E .LI (
241241 E .ATTR (id = "state{0}" .format (i )),
242+ E .E .header (
243+ E .DIV (
244+ E .CLASS ('error' ),
245+ state_problem ,
246+ ),
247+ E .DIV (
248+ E .CLASS ('report-count' ),
249+ E .H3 ('Report' ),
250+ str (i ),
251+ ),
252+ ),
242253 E .DIV (
243- E .CLASS ('source' ),
244- E .E .header (
245- E .DIV (
246- E .CLASS ('error' ),
247- state_problem ,
248- ),
249- E .DIV (
250- E .CLASS ('report-count' ),
251- E .H3 ('Report' ),
252- str (i ),
253- ),
254+ E .CLASS ('body' ),
255+ E .DIV (
256+ E .CLASS ('source' ),
257+ deepcopy (code ),
254258 ),
255- deepcopy ( code ) ,
259+ state_html ,
256260 ),
257- state_html ,
258261 ),
259262 )
260263
261264 return E .BODY (
262265 self .header (),
263266 reports ,
267+ self .footer (),
264268 )
265269
266270
0 commit comments