Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Unified Diff: doc/templates/index.html

Issue 1926683002: docserver: Load JS async defer since it really isn't required and it was blocking the loading of th… (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: consolidate js Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« doc/res/js/docs.js ('K') | « doc/res/js/docs.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: doc/templates/index.html
diff --git a/doc/templates/index.html b/doc/templates/index.html
index 98ff385a52a927ed7740639bda327a8172ed87ac..451bc5645b37f0b19c4f90e50a74f831696b7012 100644
--- a/doc/templates/index.html
+++ b/doc/templates/index.html
@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="google-site-verification" content="pwqU0tZr1xJubovbW73M6WGA2IIygCYPBkB6O4kzbYI" />
<meta name="google-site-verification" content="pIHubYTE28EzwOWGWmHyNmxRNA6yclJyxSymw6uX8b8" />
- <script src="/res/js/core.js"></script>
+ <script async src="/res/js/core.js"></script>
<link href="/res/css/docs.css" rel="stylesheet" />
</head>
<body>
@@ -16,18 +16,6 @@
<div id=drawer drawer vertical layout>
<img src="/res/img/logo.png" width=204 height=91>
- <script>
- (function() {
- var cx = '009791159600898516779:8-nlv0iznho';
- var gcse = document.createElement('script');
- gcse.type = 'text/javascript';
- gcse.async = true;
- gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
- '//cse.google.com/cse.js?cx=' + cx;
- var s = document.getElementsByTagName('script')[0];
- s.parentNode.insertBefore(gcse, s);
- })();
- </script>
<gcse:searchbox-only></gcse:searchbox-only>
{{.Nav}}
@@ -46,57 +34,5 @@
</div>
</div>
</div>
-
- <script>
- sk.DomReady.then(function() {
- prettyPrint();
-
- // Open the side drawer with the navigation menu.
- $$$('button').addEventListener('click', function(e) {
- $$$('#drawer').classList.add('opened');
- e.stopPropagation();
- });
-
- // Close the side drawer.
- $$$('body').addEventListener('click', function() {
- $$$('#drawer').classList.remove('opened');
- });
-
- // highlightNav highlights where we are in the navigation.
- var highlightNav = function() {
- $$('#drawer li a').forEach(function(e) {
- if (e.dataset.path == window.location.pathname) {
- e.classList.add('selected');
- $$$('title').innerText = e.innerText;
- } else {
- e.classList.remove('selected');
- }
- });
- }
-
- // Shortcut the links and handle them via XHR, that way we only
- // pay the loading time once, yet still retain full URLs.
- $$('#drawer li a').forEach(function(e) {
- e.addEventListener('click', function(e) {
- // Preserve query parameters as we navigate.
- var q = window.location.search;
- var url = e.target.dataset.path;
- if (q != "") {
- url += q;
- }
- sk.get('/_'+url).then(function(content) {
- window.history.pushState(null, null, url);
- highlightNav();
- $$$('html #content').innerHTML = content;
- $$$('html #page').scrollIntoView();
- prettyPrint();
- });
- e.preventDefault();
- });
- });
-
- highlightNav();
- });
- </script>
</body>
</html>
« doc/res/js/docs.js ('K') | « doc/res/js/docs.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698