-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78ece02
commit 5f52063
Showing
18 changed files
with
119,151 additions
and
0 deletions.
There are no files selected for viewing
113,523 changes: 113,523 additions & 0 deletions
113,523
static/docs/reference/generated/kubernetes-api/v1.11/index.html
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
static/docs/reference/generated/kubernetes-api/v1.11/navData.js
Large diffs are not rendered by default.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...eference/generated/kubernetes-api/v1.11/node_modules/bootstrap/dist/css/bootstrap.min.css
Large diffs are not rendered by default.
Oops, something went wrong.
2,337 changes: 2,337 additions & 0 deletions
2,337
...s/reference/generated/kubernetes-api/v1.11/node_modules/font-awesome/css/font-awesome.css
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
...ference/generated/kubernetes-api/v1.11/node_modules/font-awesome/css/font-awesome.css.map
Large diffs are not rendered by default.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
...ference/generated/kubernetes-api/v1.11/node_modules/font-awesome/css/font-awesome.min.css
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+132 KB
.../reference/generated/kubernetes-api/v1.11/node_modules/font-awesome/fonts/FontAwesome.otf
Binary file not shown.
Binary file added
BIN
+162 KB
...ce/generated/kubernetes-api/v1.11/node_modules/font-awesome/fonts/fontawesome-webfont.eot
Binary file not shown.
2,671 changes: 2,671 additions & 0 deletions
2,671
...ed/kubernetes-api/v1.11/node_modules/font-awesome/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+162 KB
...ce/generated/kubernetes-api/v1.11/node_modules/font-awesome/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file added
BIN
+95.7 KB
...e/generated/kubernetes-api/v1.11/node_modules/font-awesome/fonts/fontawesome-webfont.woff
Binary file not shown.
Binary file added
BIN
+75.4 KB
.../generated/kubernetes-api/v1.11/node_modules/font-awesome/fonts/fontawesome-webfont.woff2
Binary file not shown.
99 changes: 99 additions & 0 deletions
99
...ocs/reference/generated/kubernetes-api/v1.11/node_modules/highlight.js/styles/default.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
...erence/generated/kubernetes-api/v1.11/node_modules/jquery.scrollto/jquery.scrollTo.min.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
static/docs/reference/generated/kubernetes-api/v1.11/node_modules/jquery/dist/jquery.min.js
Large diffs are not rendered by default.
Oops, something went wrong.
196 changes: 196 additions & 0 deletions
196
static/docs/reference/generated/kubernetes-api/v1.11/scroll.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
$(document).ready(function() { | ||
|
||
/** | ||
* TODO: Refactor with intent toward pure functions. Mutation of state can lead to bugs and difficult debugging. | ||
*/ | ||
|
||
var toc = navData.toc; | ||
var flatToc = navData.flatToc.reverse(); | ||
|
||
function collectNodes(tocMap) { | ||
var tocNodes = {}; | ||
tocMap.map(function(node, index) { | ||
var sectionNode = $('#' + node.section); | ||
var tocSubsections = {}; | ||
tocItem = {section: sectionNode}; | ||
var subsectionNodes; | ||
if (node.subsections) { | ||
subsectionNodes = (collectNodes(node.subsections)); | ||
tocItem.subsections = subsectionNodes; | ||
} | ||
tocNodes[node.section] = tocItem; | ||
}); | ||
return tocNodes; | ||
} | ||
var tocItems = collectNodes(toc); | ||
|
||
function collectNodesFlat(tocMap, obj) { | ||
var collect = obj || {}; | ||
tocMap.map(function(node, index) { | ||
var sectionNode = $('#' + node.section); | ||
tocItem = {section: sectionNode}; | ||
if (node.subsections) { | ||
subsectionNodes = (collectNodesFlat(node.subsections, collect)); | ||
} | ||
collect[node.section] = sectionNode; | ||
}); | ||
return collect; | ||
} | ||
var tocFlat = collectNodesFlat(toc); | ||
|
||
var prevSectionToken; | ||
var prevSubsectionToken; | ||
var activeTokensObj = {}; | ||
|
||
function scrollActions(scrollPosition) { | ||
var activeSection = checkNodePositions(toc, tocFlat, scrollPosition); | ||
var activeSubSection, | ||
prevL1Nav, | ||
currL1Nav, | ||
prevL2Nav, | ||
currL2Nav; | ||
|
||
// No active section - return existing activeTokensObj (may be empty) | ||
if (!activeSection) { | ||
return activeTokensObj; | ||
} | ||
|
||
/** | ||
* This block deals with L1Nav sections | ||
*/ | ||
|
||
// If no previous token, set previous to current active and show L1Nav | ||
if (!prevSectionToken) { | ||
prevSectionToken = activeSection.token; | ||
currL1Nav = getNavNode(activeSection.token); | ||
currL1Nav.show('fast'); | ||
} | ||
// If active active is not the same as previous, hide previous L1Nav and show current L1Nav; set previous to current | ||
else if (activeSection.token !== prevSectionToken) { | ||
prevL1Nav = getNavNode(prevSectionToken); | ||
currL1Nav = getNavNode(activeSection.token); | ||
prevL1Nav.hide('fast'); | ||
currL1Nav.show('fast'); | ||
prevSectionToken = activeSection.token; | ||
} | ||
|
||
/** | ||
* This block deals with L2Nav subsections | ||
*/ | ||
|
||
// If there is a subsections array and it has a non-zero length, set active subsection | ||
if (activeSection.subsections && activeSection.subsections.length !== 0) { | ||
activeSubSection = checkNodePositions(activeSection.subsections, tocFlat, scrollPosition); | ||
if (activeSubSection) { | ||
if (!prevSubsectionToken) { | ||
prevSubsectionToken = activeSubSection.token; | ||
currL2Nav = getNavNode(activeSubSection.token); | ||
currL2Nav.show('fast'); | ||
} else if (activeSubSection.token !== prevSubsectionToken) { | ||
prevL2Nav = getNavNode(prevSubsectionToken); | ||
currL2Nav = getNavNode(activeSubSection.token); | ||
prevL2Nav.hide('fast'); | ||
currL2Nav.show('fast'); | ||
prevSubsectionToken = activeSubSection.token; | ||
} | ||
} else { | ||
prevL2Nav = getNavNode(prevSubsectionToken); | ||
prevL2Nav.hide('fast'); | ||
prevSubsectionToken = null; | ||
} | ||
} | ||
activeTokensObj.L1 = prevSectionToken; | ||
activeTokensObj.L2 = prevSubsectionToken; | ||
return activeTokensObj; | ||
} | ||
|
||
/** | ||
* Checks for active elements by scroll position | ||
*/ | ||
|
||
var prevElemToken; | ||
var activeElemToken; | ||
|
||
function checkActiveElement(items, scrollPosition) { | ||
var offset = 50; | ||
var offsetScroll = scrollPosition + offset; | ||
var visibleNode; | ||
for (var i = 0; i < items.length; i++) { | ||
var token = items[i]; | ||
var node = getHeadingNode(token); | ||
if (offsetScroll >= node.offset().top) { | ||
activeElemToken = token; | ||
} | ||
} | ||
if (!prevElemToken) { | ||
getNavElemNode(activeElemToken).addClass('selected'); | ||
prevElemToken = activeElemToken; | ||
return; | ||
} | ||
if (activeElemToken !== prevElemToken) { | ||
getNavElemNode(prevElemToken).removeClass('selected'); | ||
getNavElemNode(activeElemToken).addClass('selected'); | ||
prevElemToken = activeElemToken; | ||
} | ||
return activeElemToken; | ||
} | ||
|
||
function getHeadingNode(token) { | ||
return $('#' + token); | ||
} | ||
|
||
function getNavNode(token) { | ||
return $('#' + token + '-nav'); | ||
} | ||
|
||
function getNavElemNode(token) { | ||
return $('#sidebar-wrapper > ul a[href="#' + token + '"]'); | ||
} | ||
|
||
function checkNodePositions(nodes, flatNodeMap, scrollPosition) { | ||
var activeNode; | ||
for (var i = 0; i < nodes.length; i++) { | ||
var item = nodes[i]; | ||
var node = flatNodeMap[item.section]; | ||
var nodeTop = node.offset().top - 50; | ||
if (scrollPosition >= nodeTop) { | ||
activeNode = {token: item.section, node: node}; | ||
|
||
if (item.subsections) { | ||
activeNode.subsections = item.subsections; | ||
} | ||
break; | ||
} | ||
} | ||
return activeNode; | ||
} | ||
|
||
function scrollToNav(token) { | ||
setTimeout(function() { | ||
var scrollPosition = $(window).scrollTop(); | ||
var activeSectionTokens = scrollActions(scrollPosition); | ||
var activeElemToken = checkActiveElement(flatToc, scrollPosition); | ||
var navNode = $('#sidebar-wrapper > ul a[href="#' + token + '"]'); | ||
$('#sidebar-wrapper').scrollTo(navNode, {duration: 'fast', axis: 'y'}); | ||
}, 200); | ||
} | ||
|
||
$(window).on('hashchange', function(event) { | ||
var scrollPosition = $(window).scrollTop(); | ||
var activeSectionTokens = scrollActions(scrollPosition); | ||
var activeElemToken = checkActiveElement(flatToc, scrollPosition); | ||
var scrollToken = activeSectionTokens.L2 ? activeSectionTokens.L2 : activeSectionTokens.L1; | ||
scrollToNav(scrollToken); | ||
var token = location.hash.slice(1); | ||
}); | ||
|
||
var scrollPosition = $(window).scrollTop(); | ||
scrollActions(scrollPosition); | ||
checkActiveElement(flatToc, scrollPosition); | ||
// TODO: prevent scroll on sidebar from propogating to window | ||
$(window).on('scroll', function(event) { | ||
var scrollPosition = $(window).scrollTop(); | ||
var activeSectionTokens = scrollActions(scrollPosition); | ||
var activeElemToken = checkActiveElement(flatToc, scrollPosition); | ||
}); | ||
}); |
Oops, something went wrong.