fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Fabian Boehmdocs: Remove some jquery leftoversb3ff982ad

master
4.6 KiB121 linesraw
1{% extends "basic/layout.html" %}
2{# Remove broken "genindex" link - unfortunately this takes with it the acceptable "next" and "previous" links, but they're not super necessary. #}
3{% set rellinks = [] %}
4
5{% block rootrellink %}
6    <li><img src="{{ pathto('_static/' + theme_root_icon, 1) }}" alt=""
7             style="width: 80px; height: 80px; vertical-align: middle; margin-top: -1px"/></li>
8    <li><a href="{{theme_root_url}}">{{theme_root_name}}</a>{{ reldelim1 }}</li>
9    {% if theme_root_include_title %}
10    <a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}
11    {% endif %}
12{% endblock %}
13
14{%- macro searchbox() %}
15{# modified from sphinx/themes/basic/searchbox.html #}
16    {%- if builder != "htmlhelp" %}
17    <div class="inline-search" role="search">
18        <form class="inline-search" action="{{ pathto('search') }}" method="get">
19          <input placeholder="{{ _('Quick search') }}" type="text" name="q" />
20          <input type="submit" value="{{ _('Go') }}" />
21          <input type="hidden" name="check_keywords" value="yes" />
22          <input type="hidden" name="area" value="default" />
23        </form>
24    </div>
25    {%- endif %}
26{%- endmacro %}
27
28{% block header %}<div id="fmain">{% endblock %}
29{% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
30{% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
31{% block relbaritems %}
32    {%- if pagename != "search" and builder != "singlehtml" and builder != "htmlhelp" %}
33    <li class="right">
34        {{ searchbox() }}
35    </li>
36    {%- endif %}
37    {# This is hidden by default, unhidden by our global shared script. #}
38    <div id="old-docs-notice" style="display: none">
39        This documents an old version of fish.
40        <a href="{{ pathto('../current/', 1) }}">See the latest release.</a>
41    </div>
42{% endblock %}
43
44{# The sidebar goes into the *document* block, so it ends up in the document *div* so it doesn't go over the footer #}
45{% block document %}{{ sidebar() }}{{ super() }}{% endblock %}
46{% block sidebar2 %} {% endblock %}
47{% block extrahead %}
48    <link rel="shortcut icon" type="image/png" href="{{ pathto('_static/' + theme_root_icon, 1) }}" />
49    {{ super() }}
50{% endblock %}
51
52{% block footer %}
53    <div class="footer">
54    &copy; {% trans %}Copyright{% endtrans %} {{ copyright|e }}.
55    <br />
56    {%- if last_updated %}
57      {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
58    {%- endif %}
59    {% if theme_issues_url %}{% trans pathto_bugs=theme_issues_url %}<a href="{{ theme_issues_url }}">Found a bug</a>?{% endtrans %}{% endif %}
60    <br />
61
62    {% trans sphinx_version=sphinx_version|e %}Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
63    </div>
64</div>
65
66<script type="text/javascript">
67 FISH_DOCS_VERSION = "{{ version }}";
68
69 function copy_to_clipboard(it) {
70     // Find the pre tag we're interested in.
71     var pre = it.target;
72     while (pre.tagName != "PRE") pre = pre.parentNode;
73     var txt = "";
74     // Cheesy: If we have a prompt,
75     // we only copy prompted lines,
76     // by splitting and matching and stuff
77     if (pre.querySelector('span.gp')) {
78         var texts= [];
79         for (var line of pre.innerText.split('\n')) {
80             if (line.match(/^>_?.*/)) {
81                 texts.push(line.replace(/^>_?/, ""));
82             }
83         }
84         txt = texts.join("\n");
85     } else {
86         // Even cheesier: If we don't have a prompt, we remove the button text from the end.
87         var txt = pre.innerText.substring(0, pre.innerText.length - it.target.innerText.length).trim();
88     }
89
90     navigator.clipboard.writeText(txt).then(function() {
91         // Success - set the text to indicate it,
92         // then set it back after 2 seconds.
93         var span = pre.querySelector("button span");
94         if (span) {
95             var oldText = span.innerText;
96             span.innerText = "COPIED!";
97             setTimeout(function() {
98                 span.innerText = oldText;
99             }, 2000);
100         }
101     }, function() {
102     });
103 }
104
105  (function () {
106      // Add copy buttons to all the codeblocks.
107      var codeblocks = document.querySelectorAll('div > pre');
108
109      var button = document.createElement('button');
110      var span = document.createElement('span');
111      span.innerText = "COPY";
112      button.appendChild(span);
113
114      for (var i of codeblocks) {
115          var newButton = button.cloneNode(true);
116          newButton.addEventListener('click', copy_to_clipboard);
117          i.appendChild(newButton);
118      }
119  })();
120</script>
121{% endblock %}