dff2f7b960
* feat: graduate TaintNodesByCondition to GA (#17073) * Promote StartupProbe to beta (enabled by default). (#17164) * Watch bookmarks to GA (#17026) * feat: graduate ScheduleDaemonSetPods to GA (#17350) * Update Docker installation instructions (#17405) * Use exact version numbers for installing Docker in Ubuntu (#17428) * Move CSIMigration and CSIMigrationGCE to Beta in Kubernetes v1.17 (#17478) * Promote NodeLease feature to GA (#17189) * Update docs for csi topology ga (#17408) * Update RunAsUsername to beta (#17460) * doc:Update RunAsUsername to beta * doc: update samples - kubernetes.io/os is no longer beta * Updating based on review feedback * Promote Node-specific volume limits to GA (#17432) * Promote PodShareProcessNamespace to stable (#17192) * Promote PodShareProcessNamespace to stable * Add for_k8s_version to feature-state label Co-Authored-By: Tim Bannister <tim@scalefactory.com> * Readd version-check to shareProcessNamespace task * Update service load balancer finalizer doc for GA (#17438) * Update Topology Manager docs (#17451) * Added information on how device plugins can take advantage of Topology Manager * Updated the Topology Manager documentation to include additionalinformation and update some out of date sections * Fix broken Topology Manager link (#17746) Part of What's Next Device Plugin section * Update CRD defaulting docs for GA (#17450) * Add documentation for VolumeSnapshot Beta (#17233) * Updating EndpointSlice documentation for beta release in 1.17 (#17411) * (docs/dualstack): v1.17 updates (#17457) * Add placehold doc updates for dualstack in 1.17 Signed-off-by: Lachlan Evenson <lachlan.evenson@microsoft.com> * Add Downward API and /etc/hosts Pod IP validation Signed-off-by: Lachlan Evenson <lachlan.evenson@microsoft.com> * remove addressed known issue via k/k pr 85246 Signed-off-by: Lachlan Evenson <lachlan.evenson@microsoft.com> * Remove known issue and add flag as part of k/k 79993 Signed-off-by: Lachlan Evenson <lachlan.evenson@microsoft.com> * remove follow up placeholders Signed-off-by: Lachlan Evenson <lachlan.evenson@microsoft.com> * Update verbiage Signed-off-by: Lachlan Evenson <lachlan.evenson@microsoft.com> * Make IP addressing consistent throughout the task Signed-off-by: Lachlan Evenson <lachlan.evenson@microsoft.com> * Update to status.podIPs Signed-off-by: Lachlan Evenson <lachlan.evenson@microsoft.com> * Update content/en/docs/tasks/network/validate-dual-stack.md Use set instead of env Co-Authored-By: Khaled Henidak (Kal) <khnidk@outlook.com> * add topology.kubernetes.io/zone, topology.kubernetes.io/region and node.kubernetes.io/instance-type labels to docs (#17498) Signed-off-by: Andrew Sy Kim <kiman@vmware.com> * Service topology alpha documentation (#17459) * Update list of feature flags for in-tree plugins migrated to CSI (#17533) Signed-off-by: Deep Debroy <ddebroy@docker.com> * Update Node concept for TaintNodesByCondition going GA (#17577) * feat: graduate ResourceQuotaScopeSelectors to GA in 1.17 (#17554) * kubeadm: update the upgrade documentation for 1.17 (#17587) * doc: Simplify Windows deployments with RuntimeClass (#16697) * doc: Simplify Windows deployments with RuntimeClass * Updating on review feedback * doc: Adding windows-build label from enhancement 1301 * update doc for kubelet option --reserved-cpus (#17648) * feat: update TaintNodesByCondition in feature gates table (#17377) * Update docs for v1 resource quota configuration (#17547) * AdmissionConfiguration v1 (#17548) * Update WebhookAdmissionConfiguration examples (#17549) * Update AWS EBS Migration Feature state (#16126) * Add resource version section to api-concepts documentation (#16910) * Add Resource Version semantics section to api concepts * Clarify risks of going back in time, add details about compaction and watch cache sizes * Apply suggestions from liggitt Co-Authored-By: Jordan Liggitt <jordan@liggitt.net> * remove pesudocode, apply feedback * Fix typo * Clarify equality rules * Cleanup kubectl generators docs (#17609) * Write ReplicationController without a space * Drop mentioning unsupported cluster versions * Fix capitalization for “API group” * Tweak wording * Avoid using deprecated generator in example * add Antrea description in dev-1.17 (#17919) * Promote VolumeSubpathEnvExpansion to GA * Reference Documentation for the Kubernetes API for 1.17 (#18019) * Update feature-gates.md (#18033) * Reference Documentation for kubectl Commands for 1.17 (#18017) * Update for v1.17 (#18034) * Update config.toml(release-1.17) for 1.17 (#18031)
196 lines
6.9 KiB
JavaScript
196 lines
6.9 KiB
JavaScript
$(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 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 propagating to window
|
|
$(window).on('scroll', function(event) {
|
|
var scrollPosition = $(window).scrollTop();
|
|
var activeSectionTokens = scrollActions(scrollPosition);
|
|
var activeElemToken = checkActiveElement(flatToc, scrollPosition);
|
|
});
|
|
}); |