Merge lp:~raoul-snyman/ubuntu-packaging-guide/new-colours into lp:ubuntu-packaging-guide
- new-colours
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 47 |
Proposed branch: | lp:~raoul-snyman/ubuntu-packaging-guide/new-colours |
Merge into: | lp:ubuntu-packaging-guide |
Diff against target: |
523 lines (+477/-2) 5 files modified
conf.py (+2/-2) themes/ubuntu/layout.html (+14/-0) themes/ubuntu/static/default.css_t (+304/-0) themes/ubuntu/static/sidebar.js (+148/-0) themes/ubuntu/theme.conf (+9/-0) |
To merge this branch: | bzr merge lp:~raoul-snyman/ubuntu-packaging-guide/new-colours |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ronnie (community) | Needs Fixing | ||
Daniel Holbach (community) | Needs Fixing | ||
Review via email: mp+56010@code.launchpad.net |
Commit message
Description of the change
Hi,
tumbleweed poked me the other day and asked me if I didn't want to have a go at making an Ubuntu theme for the Ubuntu Packaging Guide.
So this is a rough go at said Ubuntu theme, and it's probably not quite ideal, but have a play with it anyway.
Daniel Holbach (dholbach) wrote : | # |
Can somebody web-technology savvy can comment on this as well?
Stefano Rivera (stefanor) wrote : | # |
sidebar.js looks like it came from Sphinx's "default" theme, and is therefore under the same licencing as any sauce Sphinx adds to ones documentation.
I don't see any copyright / licencing declarations in ubuntu-
Maybe add "collapsiblesidebar = true" (or false) to ubuntu/theme.conf, as this adds support for it.
ubuntu/layout.html and ubuntu/
Ronnie (ronnie.vd.c) wrote : | # |
I created a mockup of how sphinx clould look like, using the web guidelines:
http://
GIMP xcf file:
http://
I dont know whats possible within sphinx theming, but it would be really cool if it looks like all the other ubuntu websites
Raoul Snyman (raoul-snyman) wrote : | # |
@Daniel, @Stefano, yes, this is a modified copy of Sphinx's default theme, as I just threw it together one evening - I'm just using it as a starting point. I'm quite aware that we'd need to make sure licensing details are correct, so I'll have a look at that when I get a chance to work on this again. As for sidebar.js in particular, I removed the setting for a collapsible sidebar (I didn't think it necessary), so I can most likely remove the JS as well.
@Ronnie, thanks for that mockup, it looks great! I'll see if I can make the Sphinx theme look like that. It should mostly be possible - I've done something similar before.
Daniel Holbach (dholbach) wrote : | # |
Raoul, Ronnie: thanks so much for your work on this. Is there anything we can reuse from https:/
Ronnie (ronnie.vd.c) wrote : | # |
I think the whole CSS, and a part of the html can be reused. Raoul do you want to try that?
Ronnie (ronnie.vd.c) : | # |
Raoul Snyman (raoul-snyman) wrote : | # |
Ronnie, I'll try to have a look in the next few weeks. Unfortunately my free time is rather scarce at the moment.
Jurmir Canal Neto (jcneto) wrote : | # |
Hi everybody, I think I might be useful here.
Someone can tell me how this is going and how I can help?
Thanks!!
Daniel Holbach (dholbach) wrote : | # |
Basically:
- sudo apt-get install python-sphinx
- bzr branch lp:ubuntu-packaging-guide
- cd ubuntu-
- <maybe "bzr merge lp:~raoul-snyman/ubuntu-packaging-guide/new-colours" to make use of Raoul's changes>
- <make changes, figure out how to make use of https:/
- bzr commit
- bzr push lp:~<username>
- bzr lp-open
- <click on "Propose for merging">
Preview Diff
1 | === modified file 'conf.py' | |||
2 | --- conf.py 2010-11-19 12:07:36 +0000 | |||
3 | +++ conf.py 2011-04-01 21:44:05 +0000 | |||
4 | @@ -101,7 +101,7 @@ | |||
5 | 101 | 101 | ||
6 | 102 | # The theme to use for HTML and HTML Help pages. See the documentation for | 102 | # The theme to use for HTML and HTML Help pages. See the documentation for |
7 | 103 | # a list of builtin themes. | 103 | # a list of builtin themes. |
9 | 104 | html_theme = 'default' | 104 | html_theme = 'ubuntu' |
10 | 105 | 105 | ||
11 | 106 | # Theme options are theme-specific and customize the look and feel of a theme | 106 | # Theme options are theme-specific and customize the look and feel of a theme |
12 | 107 | # further. For a list of options available for each theme, see the | 107 | # further. For a list of options available for each theme, see the |
13 | @@ -109,7 +109,7 @@ | |||
14 | 109 | #html_theme_options = {} | 109 | #html_theme_options = {} |
15 | 110 | 110 | ||
16 | 111 | # Add any paths that contain custom themes here, relative to this directory. | 111 | # Add any paths that contain custom themes here, relative to this directory. |
18 | 112 | #html_theme_path = [] | 112 | html_theme_path = ['themes'] |
19 | 113 | 113 | ||
20 | 114 | # The name for this set of Sphinx documents. If None, it defaults to | 114 | # The name for this set of Sphinx documents. If None, it defaults to |
21 | 115 | # "<project> v<release> documentation". | 115 | # "<project> v<release> documentation". |
22 | 116 | 116 | ||
23 | === added directory 'themes' | |||
24 | === added directory 'themes/ubuntu' | |||
25 | === added file 'themes/ubuntu/layout.html' | |||
26 | --- themes/ubuntu/layout.html 1970-01-01 00:00:00 +0000 | |||
27 | +++ themes/ubuntu/layout.html 2011-04-01 21:44:05 +0000 | |||
28 | @@ -0,0 +1,14 @@ | |||
29 | 1 | {# | ||
30 | 2 | ubuntu/layout.html | ||
31 | 3 | ~~~~~~~~~~~~~~~~~~ | ||
32 | 4 | |||
33 | 5 | Sphinx layout template for the Ubuntu theme. | ||
34 | 6 | |||
35 | 7 | :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. | ||
36 | 8 | :license: BSD, see LICENSE for details. | ||
37 | 9 | #} | ||
38 | 10 | {% extends "basic/layout.html" %} | ||
39 | 11 | |||
40 | 12 | {% if theme_collapsiblesidebar|tobool %} | ||
41 | 13 | {% set script_files = script_files + ['_static/sidebar.js'] %} | ||
42 | 14 | {% endif %} | ||
43 | 0 | 15 | ||
44 | === added directory 'themes/ubuntu/static' | |||
45 | === added file 'themes/ubuntu/static/default.css_t' | |||
46 | --- themes/ubuntu/static/default.css_t 1970-01-01 00:00:00 +0000 | |||
47 | +++ themes/ubuntu/static/default.css_t 2011-04-01 21:44:05 +0000 | |||
48 | @@ -0,0 +1,304 @@ | |||
49 | 1 | /* | ||
50 | 2 | * default.css_t | ||
51 | 3 | * ~~~~~~~~~~~~~ | ||
52 | 4 | * | ||
53 | 5 | * Sphinx stylesheet -- Ubuntu theme, adapted from the default Sphinx theme. | ||
54 | 6 | * | ||
55 | 7 | * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. | ||
56 | 8 | * :license: BSD, see LICENSE for details. | ||
57 | 9 | * | ||
58 | 10 | */ | ||
59 | 11 | |||
60 | 12 | @import url("basic.css"); | ||
61 | 13 | |||
62 | 14 | /* -- page layout ----------------------------------------------------------- */ | ||
63 | 15 | |||
64 | 16 | body { | ||
65 | 17 | font-family: 'Ubuntu', sans-serif; | ||
66 | 18 | font-size: 100%; | ||
67 | 19 | background-color: #ee5925; | ||
68 | 20 | color: #000; | ||
69 | 21 | margin: 0; | ||
70 | 22 | padding: 0; | ||
71 | 23 | } | ||
72 | 24 | |||
73 | 25 | div.document { | ||
74 | 26 | background-color: #f7f6f5; | ||
75 | 27 | } | ||
76 | 28 | |||
77 | 29 | div.documentwrapper { | ||
78 | 30 | float: left; | ||
79 | 31 | width: 100%; | ||
80 | 32 | } | ||
81 | 33 | |||
82 | 34 | div.bodywrapper { | ||
83 | 35 | margin: 0 0 0 230px; | ||
84 | 36 | } | ||
85 | 37 | |||
86 | 38 | div.body { | ||
87 | 39 | background: #fff; | ||
88 | 40 | color: #000; | ||
89 | 41 | padding: 0 20px 30px 20px; | ||
90 | 42 | } | ||
91 | 43 | |||
92 | 44 | {%- if theme_rightsidebar|tobool %} | ||
93 | 45 | div.bodywrapper { | ||
94 | 46 | margin: 0 230px 0 0; | ||
95 | 47 | } | ||
96 | 48 | {%- endif %} | ||
97 | 49 | |||
98 | 50 | div.footer { | ||
99 | 51 | color: #fff; | ||
100 | 52 | width: 100%; | ||
101 | 53 | padding: 9px 0 9px 0; | ||
102 | 54 | text-align: center; | ||
103 | 55 | font-size: 75%; | ||
104 | 56 | } | ||
105 | 57 | |||
106 | 58 | div.footer a { | ||
107 | 59 | color: #fff; | ||
108 | 60 | text-decoration: underline; | ||
109 | 61 | } | ||
110 | 62 | |||
111 | 63 | div.related { | ||
112 | 64 | background: #dd4814 url(header.png) bottom left repeat-x; | ||
113 | 65 | line-height: 45px; | ||
114 | 66 | color: #fff; | ||
115 | 67 | } | ||
116 | 68 | |||
117 | 69 | div.related a { | ||
118 | 70 | color: #fff; | ||
119 | 71 | text-shadow: 0 1px #000; | ||
120 | 72 | } | ||
121 | 73 | |||
122 | 74 | div.sphinxsidebar { | ||
123 | 75 | {%- if theme_stickysidebar|tobool %} | ||
124 | 76 | top: 30px; | ||
125 | 77 | bottom: 0; | ||
126 | 78 | margin: 0; | ||
127 | 79 | position: fixed; | ||
128 | 80 | overflow: auto; | ||
129 | 81 | height: auto; | ||
130 | 82 | {%- endif %} | ||
131 | 83 | {%- if theme_rightsidebar|tobool %} | ||
132 | 84 | float: right; | ||
133 | 85 | {%- if theme_stickysidebar|tobool %} | ||
134 | 86 | right: 0; | ||
135 | 87 | {%- endif %} | ||
136 | 88 | {%- endif %} | ||
137 | 89 | } | ||
138 | 90 | |||
139 | 91 | {%- if theme_stickysidebar|tobool %} | ||
140 | 92 | /* this is nice, but it it leads to hidden headings when jumping | ||
141 | 93 | to an anchor */ | ||
142 | 94 | /* | ||
143 | 95 | div.related { | ||
144 | 96 | position: fixed; | ||
145 | 97 | } | ||
146 | 98 | |||
147 | 99 | div.documentwrapper { | ||
148 | 100 | margin-top: 30px; | ||
149 | 101 | } | ||
150 | 102 | */ | ||
151 | 103 | {%- endif %} | ||
152 | 104 | |||
153 | 105 | div.sphinxsidebar h3 { | ||
154 | 106 | font-family: 'Ubuntu', sans-serif; | ||
155 | 107 | color: #000; | ||
156 | 108 | font-size: 1.4em; | ||
157 | 109 | font-weight: normal; | ||
158 | 110 | margin: 0; | ||
159 | 111 | padding: 0; | ||
160 | 112 | } | ||
161 | 113 | |||
162 | 114 | div.sphinxsidebar h3 a { | ||
163 | 115 | color: #000; | ||
164 | 116 | } | ||
165 | 117 | |||
166 | 118 | div.sphinxsidebar h4 { | ||
167 | 119 | font-family: 'Ubuntu', sans-serif; | ||
168 | 120 | color: #000; | ||
169 | 121 | font-size: 1.3em; | ||
170 | 122 | font-weight: normal; | ||
171 | 123 | margin: 5px 0 0 0; | ||
172 | 124 | padding: 0; | ||
173 | 125 | } | ||
174 | 126 | |||
175 | 127 | div.sphinxsidebar p { | ||
176 | 128 | color: #000; | ||
177 | 129 | } | ||
178 | 130 | |||
179 | 131 | div.sphinxsidebar p.topless { | ||
180 | 132 | margin: 5px 10px 10px 10px; | ||
181 | 133 | } | ||
182 | 134 | |||
183 | 135 | div.sphinxsidebar ul { | ||
184 | 136 | margin: 10px; | ||
185 | 137 | padding: 0; | ||
186 | 138 | color: #000; | ||
187 | 139 | } | ||
188 | 140 | |||
189 | 141 | div.sphinxsidebar a { | ||
190 | 142 | color: #ee5925; | ||
191 | 143 | } | ||
192 | 144 | |||
193 | 145 | div.sphinxsidebar input { | ||
194 | 146 | background-color: #fff; | ||
195 | 147 | border: 1px solid #ee5925; | ||
196 | 148 | color: #000; | ||
197 | 149 | font-family: sans-serif; | ||
198 | 150 | font-size: 1em; | ||
199 | 151 | } | ||
200 | 152 | |||
201 | 153 | /* -- hyperlink styles ------------------------------------------------------ */ | ||
202 | 154 | |||
203 | 155 | a { | ||
204 | 156 | color: #dd4814; | ||
205 | 157 | text-decoration: none; | ||
206 | 158 | } | ||
207 | 159 | |||
208 | 160 | a:visited { | ||
209 | 161 | color: #ee5925; | ||
210 | 162 | text-decoration: none; | ||
211 | 163 | } | ||
212 | 164 | |||
213 | 165 | a:hover { | ||
214 | 166 | text-decoration: underline; | ||
215 | 167 | } | ||
216 | 168 | |||
217 | 169 | {% if theme_externalrefs|tobool %} | ||
218 | 170 | a.external { | ||
219 | 171 | text-decoration: none; | ||
220 | 172 | border-bottom: 1px dashed #dd4814; | ||
221 | 173 | } | ||
222 | 174 | |||
223 | 175 | a.external:hover { | ||
224 | 176 | text-decoration: none; | ||
225 | 177 | border-bottom: none; | ||
226 | 178 | } | ||
227 | 179 | |||
228 | 180 | a.external:visited { | ||
229 | 181 | text-decoration: none; | ||
230 | 182 | border-bottom: 1px dashed #ee5925; | ||
231 | 183 | } | ||
232 | 184 | {% endif %} | ||
233 | 185 | |||
234 | 186 | /* -- body styles ----------------------------------------------------------- */ | ||
235 | 187 | |||
236 | 188 | div.body h1, | ||
237 | 189 | div.body h2, | ||
238 | 190 | div.body h3, | ||
239 | 191 | div.body h4, | ||
240 | 192 | div.body h5, | ||
241 | 193 | div.body h6 { | ||
242 | 194 | font-family: 'Ubuntu', sans-serif; | ||
243 | 195 | background-color: #dd4814; | ||
244 | 196 | font-weight: normal; | ||
245 | 197 | color: #fff; | ||
246 | 198 | border-top: 1px solid #fff; | ||
247 | 199 | margin: 20px -20px 10px -20px; | ||
248 | 200 | padding: 3px 0 3px 10px; | ||
249 | 201 | } | ||
250 | 202 | |||
251 | 203 | div.body h1 { margin-top: 0; font-size: 200%; } | ||
252 | 204 | div.body h2 { font-size: 160%; } | ||
253 | 205 | div.body h3 { font-size: 140%; } | ||
254 | 206 | div.body h4 { font-size: 120%; } | ||
255 | 207 | div.body h5 { font-size: 110%; } | ||
256 | 208 | div.body h6 { font-size: 100%; } | ||
257 | 209 | |||
258 | 210 | a.headerlink { | ||
259 | 211 | color: #f7f6f5; | ||
260 | 212 | font-size: 0.8em; | ||
261 | 213 | padding: 0 4px 0 4px; | ||
262 | 214 | text-decoration: none; | ||
263 | 215 | } | ||
264 | 216 | |||
265 | 217 | a.headerlink:hover { | ||
266 | 218 | background-color: #f7f6f5; | ||
267 | 219 | color: #dd4814; | ||
268 | 220 | } | ||
269 | 221 | |||
270 | 222 | div.body p, div.body dd, div.body li { | ||
271 | 223 | text-align: justify; | ||
272 | 224 | line-height: 130%; | ||
273 | 225 | } | ||
274 | 226 | |||
275 | 227 | div.admonition p.admonition-title + p { | ||
276 | 228 | display: inline; | ||
277 | 229 | } | ||
278 | 230 | |||
279 | 231 | div.admonition p { | ||
280 | 232 | margin-bottom: 5px; | ||
281 | 233 | } | ||
282 | 234 | |||
283 | 235 | div.admonition pre { | ||
284 | 236 | margin-bottom: 5px; | ||
285 | 237 | } | ||
286 | 238 | |||
287 | 239 | div.admonition ul, div.admonition ol { | ||
288 | 240 | margin-bottom: 5px; | ||
289 | 241 | } | ||
290 | 242 | |||
291 | 243 | div.note { | ||
292 | 244 | background-color: #eee; | ||
293 | 245 | border: 1px solid #ccc; | ||
294 | 246 | } | ||
295 | 247 | |||
296 | 248 | div.seealso { | ||
297 | 249 | background-color: #ffc; | ||
298 | 250 | border: 1px solid #ff6; | ||
299 | 251 | } | ||
300 | 252 | |||
301 | 253 | div.topic { | ||
302 | 254 | background-color: #eee; | ||
303 | 255 | } | ||
304 | 256 | |||
305 | 257 | div.warning { | ||
306 | 258 | background-color: #ffe4e4; | ||
307 | 259 | border: 1px solid #f66; | ||
308 | 260 | } | ||
309 | 261 | |||
310 | 262 | p.admonition-title { | ||
311 | 263 | display: inline; | ||
312 | 264 | } | ||
313 | 265 | |||
314 | 266 | p.admonition-title:after { | ||
315 | 267 | content: ":"; | ||
316 | 268 | } | ||
317 | 269 | |||
318 | 270 | pre { | ||
319 | 271 | padding: 5px; | ||
320 | 272 | background-color: #f0f0f0; | ||
321 | 273 | color: #333333; | ||
322 | 274 | line-height: 120%; | ||
323 | 275 | border: 1px solid #ccc; | ||
324 | 276 | } | ||
325 | 277 | |||
326 | 278 | tt { | ||
327 | 279 | background-color: #ecf0f3; | ||
328 | 280 | padding: 0 1px 0 1px; | ||
329 | 281 | font-size: 0.95em; | ||
330 | 282 | } | ||
331 | 283 | |||
332 | 284 | th { | ||
333 | 285 | background-color: #ede; | ||
334 | 286 | } | ||
335 | 287 | |||
336 | 288 | .warning tt { | ||
337 | 289 | background: #efc2c2; | ||
338 | 290 | } | ||
339 | 291 | |||
340 | 292 | .note tt { | ||
341 | 293 | background: #d6d6d6; | ||
342 | 294 | } | ||
343 | 295 | |||
344 | 296 | .viewcode-back { | ||
345 | 297 | font-family: 'Ubuntu', sans-serif; | ||
346 | 298 | } | ||
347 | 299 | |||
348 | 300 | div.viewcode-block:target { | ||
349 | 301 | background-color: #f4debf; | ||
350 | 302 | border-top: 1px solid #ac9; | ||
351 | 303 | border-bottom: 1px solid #ac9; | ||
352 | 304 | } | ||
353 | 0 | 305 | ||
354 | === added file 'themes/ubuntu/static/favicon.ico' | |||
355 | 1 | Binary files themes/ubuntu/static/favicon.ico 1970-01-01 00:00:00 +0000 and themes/ubuntu/static/favicon.ico 2011-04-01 21:44:05 +0000 differ | 306 | Binary files themes/ubuntu/static/favicon.ico 1970-01-01 00:00:00 +0000 and themes/ubuntu/static/favicon.ico 2011-04-01 21:44:05 +0000 differ |
356 | === added file 'themes/ubuntu/static/header.png' | |||
357 | 2 | Binary files themes/ubuntu/static/header.png 1970-01-01 00:00:00 +0000 and themes/ubuntu/static/header.png 2011-04-01 21:44:05 +0000 differ | 307 | Binary files themes/ubuntu/static/header.png 1970-01-01 00:00:00 +0000 and themes/ubuntu/static/header.png 2011-04-01 21:44:05 +0000 differ |
358 | === added file 'themes/ubuntu/static/sidebar.js' | |||
359 | --- themes/ubuntu/static/sidebar.js 1970-01-01 00:00:00 +0000 | |||
360 | +++ themes/ubuntu/static/sidebar.js 2011-04-01 21:44:05 +0000 | |||
361 | @@ -0,0 +1,148 @@ | |||
362 | 1 | /* | ||
363 | 2 | * sidebar.js | ||
364 | 3 | * ~~~~~~~~~~ | ||
365 | 4 | * | ||
366 | 5 | * This script makes the Sphinx sidebar collapsible. | ||
367 | 6 | * | ||
368 | 7 | * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds | ||
369 | 8 | * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton | ||
370 | 9 | * used to collapse and expand the sidebar. | ||
371 | 10 | * | ||
372 | 11 | * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden | ||
373 | 12 | * and the width of the sidebar and the margin-left of the document | ||
374 | 13 | * are decreased. When the sidebar is expanded the opposite happens. | ||
375 | 14 | * This script saves a per-browser/per-session cookie used to | ||
376 | 15 | * remember the position of the sidebar among the pages. | ||
377 | 16 | * Once the browser is closed the cookie is deleted and the position | ||
378 | 17 | * reset to the default (expanded). | ||
379 | 18 | * | ||
380 | 19 | * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. | ||
381 | 20 | * :license: BSD, see LICENSE for details. | ||
382 | 21 | * | ||
383 | 22 | */ | ||
384 | 23 | |||
385 | 24 | $(function() { | ||
386 | 25 | // global elements used by the functions. | ||
387 | 26 | // the 'sidebarbutton' element is defined as global after its | ||
388 | 27 | // creation, in the add_sidebar_button function | ||
389 | 28 | var bodywrapper = $('.bodywrapper'); | ||
390 | 29 | var sidebar = $('.sphinxsidebar'); | ||
391 | 30 | var sidebarwrapper = $('.sphinxsidebarwrapper'); | ||
392 | 31 | |||
393 | 32 | // original margin-left of the bodywrapper and width of the sidebar | ||
394 | 33 | // with the sidebar expanded | ||
395 | 34 | var bw_margin_expanded = bodywrapper.css('margin-left'); | ||
396 | 35 | var ssb_width_expanded = sidebar.width(); | ||
397 | 36 | |||
398 | 37 | // margin-left of the bodywrapper and width of the sidebar | ||
399 | 38 | // with the sidebar collapsed | ||
400 | 39 | var bw_margin_collapsed = '.8em'; | ||
401 | 40 | var ssb_width_collapsed = '.8em'; | ||
402 | 41 | |||
403 | 42 | // colors used by the current theme | ||
404 | 43 | var dark_color = $('.related').css('background-color'); | ||
405 | 44 | var light_color = $('.document').css('background-color'); | ||
406 | 45 | |||
407 | 46 | function sidebar_is_collapsed() { | ||
408 | 47 | return sidebarwrapper.is(':not(:visible)'); | ||
409 | 48 | } | ||
410 | 49 | |||
411 | 50 | function toggle_sidebar() { | ||
412 | 51 | if (sidebar_is_collapsed()) | ||
413 | 52 | expand_sidebar(); | ||
414 | 53 | else | ||
415 | 54 | collapse_sidebar(); | ||
416 | 55 | } | ||
417 | 56 | |||
418 | 57 | function collapse_sidebar() { | ||
419 | 58 | sidebarwrapper.hide(); | ||
420 | 59 | sidebar.css('width', ssb_width_collapsed); | ||
421 | 60 | bodywrapper.css('margin-left', bw_margin_collapsed); | ||
422 | 61 | sidebarbutton.css({ | ||
423 | 62 | 'margin-left': '0', | ||
424 | 63 | 'height': bodywrapper.height() | ||
425 | 64 | }); | ||
426 | 65 | sidebarbutton.find('span').text('»'); | ||
427 | 66 | sidebarbutton.attr('title', _('Expand sidebar')); | ||
428 | 67 | document.cookie = 'sidebar=collapsed'; | ||
429 | 68 | } | ||
430 | 69 | |||
431 | 70 | function expand_sidebar() { | ||
432 | 71 | bodywrapper.css('margin-left', bw_margin_expanded); | ||
433 | 72 | sidebar.css('width', ssb_width_expanded); | ||
434 | 73 | sidebarwrapper.show(); | ||
435 | 74 | sidebarbutton.css({ | ||
436 | 75 | 'margin-left': ssb_width_expanded-12, | ||
437 | 76 | 'height': bodywrapper.height() | ||
438 | 77 | }); | ||
439 | 78 | sidebarbutton.find('span').text('«'); | ||
440 | 79 | sidebarbutton.attr('title', _('Collapse sidebar')); | ||
441 | 80 | document.cookie = 'sidebar=expanded'; | ||
442 | 81 | } | ||
443 | 82 | |||
444 | 83 | function add_sidebar_button() { | ||
445 | 84 | sidebarwrapper.css({ | ||
446 | 85 | 'float': 'left', | ||
447 | 86 | 'margin-right': '0', | ||
448 | 87 | 'width': ssb_width_expanded - 28 | ||
449 | 88 | }); | ||
450 | 89 | // create the button | ||
451 | 90 | sidebar.append( | ||
452 | 91 | '<div id="sidebarbutton"><span>«</span></div>' | ||
453 | 92 | ); | ||
454 | 93 | var sidebarbutton = $('#sidebarbutton'); | ||
455 | 94 | light_color = sidebarbutton.css('background-color'); | ||
456 | 95 | // find the height of the viewport to center the '<<' in the page | ||
457 | 96 | var viewport_height; | ||
458 | 97 | if (window.innerHeight) | ||
459 | 98 | viewport_height = window.innerHeight; | ||
460 | 99 | else | ||
461 | 100 | viewport_height = $(window).height(); | ||
462 | 101 | sidebarbutton.find('span').css({ | ||
463 | 102 | 'display': 'block', | ||
464 | 103 | 'margin-top': (viewport_height - sidebar.position().top - 20) / 2 | ||
465 | 104 | }); | ||
466 | 105 | |||
467 | 106 | sidebarbutton.click(toggle_sidebar); | ||
468 | 107 | sidebarbutton.attr('title', _('Collapse sidebar')); | ||
469 | 108 | sidebarbutton.css({ | ||
470 | 109 | 'color': '#FFFFFF', | ||
471 | 110 | 'border-left': '1px solid ' + dark_color, | ||
472 | 111 | 'font-size': '1.2em', | ||
473 | 112 | 'cursor': 'pointer', | ||
474 | 113 | 'height': bodywrapper.height(), | ||
475 | 114 | 'padding-top': '1px', | ||
476 | 115 | 'margin-left': ssb_width_expanded - 12 | ||
477 | 116 | }); | ||
478 | 117 | |||
479 | 118 | sidebarbutton.hover( | ||
480 | 119 | function () { | ||
481 | 120 | $(this).css('background-color', dark_color); | ||
482 | 121 | }, | ||
483 | 122 | function () { | ||
484 | 123 | $(this).css('background-color', light_color); | ||
485 | 124 | } | ||
486 | 125 | ); | ||
487 | 126 | } | ||
488 | 127 | |||
489 | 128 | function set_position_from_cookie() { | ||
490 | 129 | if (!document.cookie) | ||
491 | 130 | return; | ||
492 | 131 | var items = document.cookie.split(';'); | ||
493 | 132 | for(var k=0; k<items.length; k++) { | ||
494 | 133 | var key_val = items[k].split('='); | ||
495 | 134 | var key = key_val[0]; | ||
496 | 135 | if (key == 'sidebar') { | ||
497 | 136 | var value = key_val[1]; | ||
498 | 137 | if ((value == 'collapsed') && (!sidebar_is_collapsed())) | ||
499 | 138 | collapse_sidebar(); | ||
500 | 139 | else if ((value == 'expanded') && (sidebar_is_collapsed())) | ||
501 | 140 | expand_sidebar(); | ||
502 | 141 | } | ||
503 | 142 | } | ||
504 | 143 | } | ||
505 | 144 | |||
506 | 145 | add_sidebar_button(); | ||
507 | 146 | var sidebarbutton = $('#sidebarbutton'); | ||
508 | 147 | set_position_from_cookie(); | ||
509 | 148 | }); | ||
510 | 0 | 149 | ||
511 | === added file 'themes/ubuntu/theme.conf' | |||
512 | --- themes/ubuntu/theme.conf 1970-01-01 00:00:00 +0000 | |||
513 | +++ themes/ubuntu/theme.conf 2011-04-01 21:44:05 +0000 | |||
514 | @@ -0,0 +1,9 @@ | |||
515 | 1 | [theme] | ||
516 | 2 | inherit = basic | ||
517 | 3 | stylesheet = default.css | ||
518 | 4 | pygments_style = sphinx | ||
519 | 5 | |||
520 | 6 | [options] | ||
521 | 7 | rightsidebar = false | ||
522 | 8 | stickysidebar = false | ||
523 | 9 | externalrefs = false |
Wow, thanks for your work on this!
Can you please add some information to your branch including whose javascript code this is and where you got it from? We need to properly identify this if we want to distribute the guide in any form.