Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7e31e1c

Browse files
author
Misty Stanley-Jones
authored
V 1.13 js archives (docker#2314)
* Add an admonition to the top of the archive Only works if you are online and the JSON file is available at https://docs.docker.com/js/archives.json * Remove tour CTA and JS * Remove old archive links
1 parent b31e0e9 commit 7e31e1c

File tree

4 files changed

+29
-214
lines changed

4 files changed

+29
-214
lines changed

_data/toc.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -446,28 +446,6 @@ guides:
446446
title: Where to chat or get help
447447
- path: /opensource/doc-style/
448448
title: Style guide for Docker documentation
449-
- sectiontitle: Docs archive
450-
section:
451-
- path: /docsarchive/
452-
title: View the docs archives
453-
- path: /v1.4
454-
title: v1.4
455-
- path: /v1.5
456-
title: v1.5
457-
- path: /v1.6
458-
title: v1.6
459-
- path: /v1.7
460-
title: v1.7
461-
- path: /v1.8
462-
title: v1.8
463-
- path: /v1.9
464-
title: v1.9
465-
- path: /v1.10
466-
title: v1.10
467-
- path: /v1.11
468-
title: v1.11
469-
- path: /v1.12
470-
title: v1.12
471449

472450
reference:
473451
- title: Dockerfile reference

_layouts/docs.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@
199199
<ul id="top-nav" class="tabs col-xs-12 col-sm-10 col-md-10">
200200
{% include treebuilder.html %}
201201
</ul>
202-
<div id="start-tour-container" class="hidden-xs col-sm-2 col-md-2"><div id="start-tour">Tour our new<br />navigation!</div></div>
203202
</div>
204203
<div class="" ng-non-bindable>
205204
<div class="container-fluid">
@@ -412,11 +411,11 @@ <h6>Related Links</h6>
412411
<script src="/js/highlight.pack.js"></script>
413412
<script>hljs.initHighlightingOnLoad();</script>
414413
<script src="/js/alljs.js"></script>
414+
<script src="/js/bootstrap.min.js"></script>
415+
<script src="/js/archive.js"></script>
415416
<script async="" src="/js/menu.js"></script>
416417
<script async="" src="/js/app.js"></script>
417418
<script async="" src="/js/anchorlinks.js"></script>
418-
<script src="/js/hopscotch.js"></script>
419-
<script src="/js/my_first_tour.js"></script>
420419
</div>
421420
<div id="mktoStyleLoaded" style="display: none; border-top-color: rgb(18, 52, 86);"></div>
422421
<form class="ng-pristine ng-valid mktoForm mktoHasWidth mktoLayoutLeft" novalidate style="font-family: Helvetica, Arial, sans-serif; font-size: 13px; color: rgb(51, 51, 51); visibility: hidden; position: absolute; top: -500px; left: -1000px; width: 1602px;">

js/archive.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* Obly run this if we are online*/
2+
if (window.navigator.onLine) {
3+
var dockerVersion = '1.13';
4+
/* This JSON file contains a current list of all docs versions of Docker */
5+
$.getJSON("https://docs.docker.com/js/archives.json", function(result){
6+
var outerDivStart = '<div style="padding-top: 10px; padding-bottom: 10px; min-height: 34px; border: 1px solid #254356; background-color: #FFE1C0; color: #254356"><div class="container"><div style="text-align: center"><span id="archive-list">This is <b><a href="https://docs.docker.com/docsarchive/" style="color: #254356; text-decoration: underline !important">archived documentation</a></b> for Docker&nbsp;' + dockerVersion + '. Go to the <a style="color: #254356; text-decoration: underline !important" href="https://docs.docker.com/">latest docs</a> or a different version:&nbsp;&nbsp;</span>' +
7+
'<span style="z-index: 1001" class="dropdown">';
8+
var listStart = '<ul class="dropdown-menu" role="menu" aria-labelledby="archive-menu">';
9+
var listEnd = '</ul>';
10+
var outerDivEnd = '</span></div></div></div>';
11+
var buttonCode = null;
12+
var listItems = new Array();
13+
$.each(result, function(i, field){
14+
var prettyName = 'Docker ' + field.name.replace("v", "");
15+
// If this archive has current = true, and we don't already have a button
16+
if ( field.current && buttonCode == null ) {
17+
// Get the button code
18+
buttonCode = '<button id="archive-menu" data-toggle="dropdown" class="btn dropdown-toggle" style="border: 1px solid #254356; background-color: #fff; color: #254356;">' + prettyName + '&nbsp;(current) &nbsp;<span class="caret"></span></button>';
19+
// The link is different for the current release
20+
listItems.push('<li role="presentation"><a role="menuitem" tabindex="-1" href="https://docs.docker.com/">' + prettyName + '</a></li>');
21+
} else {
22+
listItems.push('<li role="presentation"><a role="menuitem" tabindex="-1" href="https://docs.docker.com/' + field.name + '/">' + prettyName + '</a></li>');
23+
}
24+
});
25+
$( 'body' ).prepend(outerDivStart + buttonCode + listStart + listItems.join("") + listEnd + outerDivEnd);
26+
});
27+
}

js/my_first_tour.js

Lines changed: 0 additions & 189 deletions
This file was deleted.

0 commit comments

Comments
 (0)