|
51 | 51 |
|
52 | 52 | {{#if mathjax_support}}
|
53 | 53 | <!-- MathJax -->
|
54 |
| - <script async type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> |
| 54 | + <script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> |
55 | 55 | {{/if}}
|
56 | 56 | </head>
|
57 | 57 | <body>
|
58 | 58 | <!-- Provide site root to javascript -->
|
59 |
| - <script type="text/javascript"> |
| 59 | + <script> |
60 | 60 | var path_to_root = "{{ path_to_root }}";
|
61 | 61 | var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "{{ preferred_dark_theme }}" : "{{ default_theme }}";
|
62 | 62 | </script>
|
63 | 63 |
|
64 | 64 | <!-- Work around some values being stored in localStorage wrapped in quotes -->
|
65 |
| - <script type="text/javascript"> |
| 65 | + <script> |
66 | 66 | try {
|
67 | 67 | var theme = localStorage.getItem('mdbook-theme');
|
68 | 68 | var sidebar = localStorage.getItem('mdbook-sidebar');
|
|
78 | 78 | </script>
|
79 | 79 |
|
80 | 80 | <!-- Set the theme before any content is loaded, prevents flash -->
|
81 |
| - <script type="text/javascript"> |
| 81 | + <script> |
82 | 82 | var theme;
|
83 | 83 | try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
|
84 | 84 | if (theme === null || theme === undefined) { theme = default_theme; }
|
|
90 | 90 | </script>
|
91 | 91 |
|
92 | 92 | <!-- Hide / unhide sidebar before it is displayed -->
|
93 |
| - <script type="text/javascript"> |
| 93 | + <script> |
94 | 94 | var html = document.querySelector('html');
|
95 | 95 | var sidebar = 'hidden';
|
96 | 96 | if (document.body.clientWidth >= 1080) {
|
|
171 | 171 | {{/if}}
|
172 | 172 |
|
173 | 173 | <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
|
174 |
| - <script type="text/javascript"> |
| 174 | + <script> |
175 | 175 | document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
176 | 176 | document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
177 | 177 | Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
|
|
221 | 221 |
|
222 | 222 | {{#if live_reload_endpoint}}
|
223 | 223 | <!-- Livereload script (if served using the cli tool) -->
|
224 |
| - <script type="text/javascript"> |
| 224 | + <script> |
225 | 225 | const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
|
226 | 226 | const wsAddress = wsProtocol + "//" + location.host + "/" + "{{{live_reload_endpoint}}}";
|
227 | 227 | const socket = new WebSocket(wsAddress);
|
|
240 | 240 |
|
241 | 241 | {{#if google_analytics}}
|
242 | 242 | <!-- Google Analytics Tag -->
|
243 |
| - <script type="text/javascript"> |
| 243 | + <script> |
244 | 244 | var localAddrs = ["localhost", "127.0.0.1", ""];
|
245 | 245 |
|
246 | 246 | // make sure we don't activate google analytics if the developer is
|
|
258 | 258 | {{/if}}
|
259 | 259 |
|
260 | 260 | {{#if playground_line_numbers}}
|
261 |
| - <script type="text/javascript"> |
| 261 | + <script> |
262 | 262 | window.playground_line_numbers = true;
|
263 | 263 | </script>
|
264 | 264 | {{/if}}
|
265 | 265 |
|
266 | 266 | {{#if playground_copyable}}
|
267 |
| - <script type="text/javascript"> |
| 267 | + <script> |
268 | 268 | window.playground_copyable = true;
|
269 | 269 | </script>
|
270 | 270 | {{/if}}
|
271 | 271 |
|
272 | 272 | {{#if playground_js}}
|
273 |
| - <script src="{{ path_to_root }}ace.js" type="text/javascript" charset="utf-8"></script> |
274 |
| - <script src="{{ path_to_root }}editor.js" type="text/javascript" charset="utf-8"></script> |
275 |
| - <script src="{{ path_to_root }}mode-rust.js" type="text/javascript" charset="utf-8"></script> |
276 |
| - <script src="{{ path_to_root }}theme-dawn.js" type="text/javascript" charset="utf-8"></script> |
277 |
| - <script src="{{ path_to_root }}theme-tomorrow_night.js" type="text/javascript" charset="utf-8"></script> |
| 273 | + <script src="{{ path_to_root }}ace.js" charset="utf-8"></script> |
| 274 | + <script src="{{ path_to_root }}editor.js" charset="utf-8"></script> |
| 275 | + <script src="{{ path_to_root }}mode-rust.js" charset="utf-8"></script> |
| 276 | + <script src="{{ path_to_root }}theme-dawn.js" charset="utf-8"></script> |
| 277 | + <script src="{{ path_to_root }}theme-tomorrow_night.js" charset="utf-8"></script> |
278 | 278 | {{/if}}
|
279 | 279 |
|
280 | 280 | {{#if search_js}}
|
281 |
| - <script src="{{ path_to_root }}elasticlunr.min.js" type="text/javascript" charset="utf-8"></script> |
282 |
| - <script src="{{ path_to_root }}mark.min.js" type="text/javascript" charset="utf-8"></script> |
283 |
| - <script src="{{ path_to_root }}searcher.js" type="text/javascript" charset="utf-8"></script> |
| 281 | + <script src="{{ path_to_root }}elasticlunr.min.js" charset="utf-8"></script> |
| 282 | + <script src="{{ path_to_root }}mark.min.js" charset="utf-8"></script> |
| 283 | + <script src="{{ path_to_root }}searcher.js" charset="utf-8"></script> |
284 | 284 | {{/if}}
|
285 | 285 |
|
286 |
| - <script src="{{ path_to_root }}clipboard.min.js" type="text/javascript" charset="utf-8"></script> |
287 |
| - <script src="{{ path_to_root }}highlight.js" type="text/javascript" charset="utf-8"></script> |
288 |
| - <script src="{{ path_to_root }}book.js" type="text/javascript" charset="utf-8"></script> |
| 286 | + <script src="{{ path_to_root }}clipboard.min.js" charset="utf-8"></script> |
| 287 | + <script src="{{ path_to_root }}highlight.js" charset="utf-8"></script> |
| 288 | + <script src="{{ path_to_root }}book.js" charset="utf-8"></script> |
289 | 289 |
|
290 | 290 | <!-- Custom JS scripts -->
|
291 | 291 | {{#each additional_js}}
|
292 |
| - <script type="text/javascript" src="{{ ../path_to_root }}{{this}}"></script> |
| 292 | + <script src="{{ ../path_to_root }}{{this}}"></script> |
293 | 293 | {{/each}}
|
294 | 294 |
|
295 | 295 | {{#if is_print}}
|
296 | 296 | {{#if mathjax_support}}
|
297 |
| - <script type="text/javascript"> |
| 297 | + <script> |
298 | 298 | window.addEventListener('load', function() {
|
299 | 299 | MathJax.Hub.Register.StartupHook('End', function() {
|
300 | 300 | window.setTimeout(window.print, 100);
|
301 | 301 | });
|
302 | 302 | });
|
303 | 303 | </script>
|
304 | 304 | {{else}}
|
305 |
| - <script type="text/javascript"> |
| 305 | + <script> |
306 | 306 | window.addEventListener('load', function() {
|
307 | 307 | window.setTimeout(window.print, 100);
|
308 | 308 | });
|
|
0 commit comments