diff options
author | VirtualTam <virtualtam+github@flibidi.net> | 2017-08-05 10:40:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-05 10:40:35 +0200 |
commit | b4ff0afb24db6e4cb3543bbd71f01bbb0716b144 (patch) | |
tree | f86caabf507fcd44db38353092f7b4476516bcd5 /doc/html/js/theme.js | |
parent | 1fdb40fc169b42af7622610c4f088688de231118 (diff) | |
parent | 29712e905b8a9bdf1eaa21cbda3ca7c9eb215937 (diff) | |
download | Shaarli-b4ff0afb24db6e4cb3543bbd71f01bbb0716b144.tar.gz Shaarli-b4ff0afb24db6e4cb3543bbd71f01bbb0716b144.tar.zst Shaarli-b4ff0afb24db6e4cb3543bbd71f01bbb0716b144.zip |
Merge pull request #910 from virtualtam/documentation/improvements
Include generated doc in release archives, remove HTML from SCM
Diffstat (limited to 'doc/html/js/theme.js')
-rw-r--r-- | doc/html/js/theme.js | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/doc/html/js/theme.js b/doc/html/js/theme.js deleted file mode 100644 index 99b146ec..00000000 --- a/doc/html/js/theme.js +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | $( document ).ready(function() { | ||
2 | // Shift nav in mobile when clicking the menu. | ||
3 | $(document).on('click', "[data-toggle='wy-nav-top']", function() { | ||
4 | $("[data-toggle='wy-nav-shift']").toggleClass("shift"); | ||
5 | $("[data-toggle='rst-versions']").toggleClass("shift"); | ||
6 | }); | ||
7 | |||
8 | // Close menu when you click a link. | ||
9 | $(document).on('click', ".wy-menu-vertical .current ul li a", function() { | ||
10 | $("[data-toggle='wy-nav-shift']").removeClass("shift"); | ||
11 | $("[data-toggle='rst-versions']").toggleClass("shift"); | ||
12 | }); | ||
13 | |||
14 | $(document).on('click', "[data-toggle='rst-current-version']", function() { | ||
15 | $("[data-toggle='rst-versions']").toggleClass("shift-up"); | ||
16 | }); | ||
17 | |||
18 | // Make tables responsive | ||
19 | $("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>"); | ||
20 | |||
21 | hljs.initHighlightingOnLoad(); | ||
22 | |||
23 | $('table').addClass('docutils'); | ||
24 | }); | ||
25 | |||
26 | window.SphinxRtdTheme = (function (jquery) { | ||
27 | var stickyNav = (function () { | ||
28 | var navBar, | ||
29 | win, | ||
30 | stickyNavCssClass = 'stickynav', | ||
31 | applyStickNav = function () { | ||
32 | if (navBar.height() <= win.height()) { | ||
33 | navBar.addClass(stickyNavCssClass); | ||
34 | } else { | ||
35 | navBar.removeClass(stickyNavCssClass); | ||
36 | } | ||
37 | }, | ||
38 | enable = function () { | ||
39 | applyStickNav(); | ||
40 | win.on('resize', applyStickNav); | ||
41 | }, | ||
42 | init = function () { | ||
43 | navBar = jquery('nav.wy-nav-side:first'); | ||
44 | win = jquery(window); | ||
45 | }; | ||
46 | jquery(init); | ||
47 | return { | ||
48 | enable : enable | ||
49 | }; | ||
50 | }()); | ||
51 | return { | ||
52 | StickyNav : stickyNav | ||
53 | }; | ||
54 | }($)); | ||
55 | |||
56 | // The code below is a copy of @seanmadsen code posted Jan 10, 2017 on issue 803. | ||
57 | // https://github.com/mkdocs/mkdocs/issues/803 | ||
58 | // This just incorporates the auto scroll into the theme itself without | ||
59 | // the need for additional custom.js file. | ||
60 | // | ||
61 | $(function() { | ||
62 | $.fn.isFullyWithinViewport = function(){ | ||
63 | var viewport = {}; | ||
64 | viewport.top = $(window).scrollTop(); | ||
65 | viewport.bottom = viewport.top + $(window).height(); | ||
66 | var bounds = {}; | ||
67 | bounds.top = this.offset().top; | ||
68 | bounds.bottom = bounds.top + this.outerHeight(); | ||
69 | return ( ! ( | ||
70 | (bounds.top <= viewport.top) || | ||
71 | (bounds.bottom >= viewport.bottom) | ||
72 | ) ); | ||
73 | }; | ||
74 | if( $('li.toctree-l1.current').length && !$('li.toctree-l1.current').isFullyWithinViewport() ) { | ||
75 | $('.wy-nav-side') | ||
76 | .scrollTop( | ||
77 | $('li.toctree-l1.current').offset().top - | ||
78 | $('.wy-nav-side').offset().top - | ||
79 | 60 | ||
80 | ); | ||
81 | } | ||
82 | }); | ||