Mercurial > repos > yating-l > hubarchivecreatortest
annotate doc/_build/html/_static/sidebar.js @ 3:fa990284327b draft default tip
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit ac73da32d59853ca563e7939d05016a6f3a6899e-dirty
| author | yating-l | 
|---|---|
| date | Mon, 30 Oct 2017 11:58:31 -0400 | 
| parents | 85195e0d4b71 | 
| children | 
| rev | line source | 
|---|---|
| 
1
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
1 /* | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
2 * sidebar.js | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
3 * ~~~~~~~~~~ | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
4 * | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
5 * This script makes the Sphinx sidebar collapsible. | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
6 * | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
7 * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
8 * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
9 * used to collapse and expand the sidebar. | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
10 * | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
11 * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
12 * and the width of the sidebar and the margin-left of the document | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
13 * are decreased. When the sidebar is expanded the opposite happens. | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
14 * This script saves a per-browser/per-session cookie used to | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
15 * remember the position of the sidebar among the pages. | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
16 * Once the browser is closed the cookie is deleted and the position | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
17 * reset to the default (expanded). | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
18 * | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
19 * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
20 * :license: BSD, see LICENSE for details. | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
21 * | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
22 */ | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
23 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
24 $(function() { | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
25 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
26 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
27 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
28 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
29 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
30 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
31 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
32 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
33 // global elements used by the functions. | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
34 // the 'sidebarbutton' element is defined as global after its | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
35 // creation, in the add_sidebar_button function | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
36 var bodywrapper = $('.bodywrapper'); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
37 var sidebar = $('.sphinxsidebar'); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
38 var sidebarwrapper = $('.sphinxsidebarwrapper'); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
39 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
40 // for some reason, the document has no sidebar; do not run into errors | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
41 if (!sidebar.length) return; | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
42 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
43 // original margin-left of the bodywrapper and width of the sidebar | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
44 // with the sidebar expanded | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
45 var bw_margin_expanded = bodywrapper.css('margin-left'); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
46 var ssb_width_expanded = sidebar.width(); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
47 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
48 // margin-left of the bodywrapper and width of the sidebar | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
49 // with the sidebar collapsed | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
50 var bw_margin_collapsed = '.8em'; | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
51 var ssb_width_collapsed = '.8em'; | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
52 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
53 // colors used by the current theme | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
54 var dark_color = $('.related').css('background-color'); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
55 var light_color = $('.document').css('background-color'); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
56 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
57 function sidebar_is_collapsed() { | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
58 return sidebarwrapper.is(':not(:visible)'); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
59 } | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
60 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
61 function toggle_sidebar() { | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
62 if (sidebar_is_collapsed()) | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
63 expand_sidebar(); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
64 else | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
65 collapse_sidebar(); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
66 } | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
67 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
68 function collapse_sidebar() { | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
69 sidebarwrapper.hide(); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
70 sidebar.css('width', ssb_width_collapsed); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
71 bodywrapper.css('margin-left', bw_margin_collapsed); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
72 sidebarbutton.css({ | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
73 'margin-left': '0', | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
74 'height': bodywrapper.height() | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
75 }); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
76 sidebarbutton.find('span').text('»'); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
77 sidebarbutton.attr('title', _('Expand sidebar')); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
78 document.cookie = 'sidebar=collapsed'; | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
79 } | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
80 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
81 function expand_sidebar() { | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
82 bodywrapper.css('margin-left', bw_margin_expanded); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
83 sidebar.css('width', ssb_width_expanded); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
84 sidebarwrapper.show(); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
85 sidebarbutton.css({ | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
86 'margin-left': ssb_width_expanded-12, | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
87 'height': bodywrapper.height() | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
88 }); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
89 sidebarbutton.find('span').text('«'); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
90 sidebarbutton.attr('title', _('Collapse sidebar')); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
91 document.cookie = 'sidebar=expanded'; | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
92 } | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
93 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
94 function add_sidebar_button() { | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
95 sidebarwrapper.css({ | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
96 'float': 'left', | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
97 'margin-right': '0', | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
98 'width': ssb_width_expanded - 28 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
99 }); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
100 // create the button | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
101 sidebar.append( | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
102 '<div id="sidebarbutton"><span>«</span></div>' | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
103 ); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
104 var sidebarbutton = $('#sidebarbutton'); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
105 light_color = sidebarbutton.css('background-color'); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
106 // find the height of the viewport to center the '<<' in the page | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
107 var viewport_height; | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
108 if (window.innerHeight) | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
109 viewport_height = window.innerHeight; | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
110 else | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
111 viewport_height = $(window).height(); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
112 sidebarbutton.find('span').css({ | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
113 'display': 'block', | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
114 'margin-top': (viewport_height - sidebar.position().top - 20) / 2 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
115 }); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
116 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
117 sidebarbutton.click(toggle_sidebar); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
118 sidebarbutton.attr('title', _('Collapse sidebar')); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
119 sidebarbutton.css({ | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
120 'color': '#FFFFFF', | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
121 'border-left': '1px solid ' + dark_color, | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
122 'font-size': '1.2em', | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
123 'cursor': 'pointer', | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
124 'height': bodywrapper.height(), | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
125 'padding-top': '1px', | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
126 'margin-left': ssb_width_expanded - 12 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
127 }); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
128 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
129 sidebarbutton.hover( | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
130 function () { | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
131 $(this).css('background-color', dark_color); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
132 }, | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
133 function () { | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
134 $(this).css('background-color', light_color); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
135 } | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
136 ); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
137 } | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
138 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
139 function set_position_from_cookie() { | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
140 if (!document.cookie) | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
141 return; | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
142 var items = document.cookie.split(';'); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
143 for(var k=0; k<items.length; k++) { | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
144 var key_val = items[k].split('='); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
145 var key = key_val[0].replace(/ /, ""); // strip leading spaces | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
146 if (key == 'sidebar') { | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
147 var value = key_val[1]; | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
148 if ((value == 'collapsed') && (!sidebar_is_collapsed())) | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
149 collapse_sidebar(); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
150 else if ((value == 'expanded') && (sidebar_is_collapsed())) | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
151 expand_sidebar(); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
152 } | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
153 } | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
154 } | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
155 | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
156 add_sidebar_button(); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
157 var sidebarbutton = $('#sidebarbutton'); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
158 set_position_from_cookie(); | 
| 
 
85195e0d4b71
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit b1ae7349f118a0fe7923d765020dfc684cf84116-dirty
 
yating-l 
parents:  
diff
changeset
 | 
159 }); | 
