docs-v2/assets/js/content-interactions.js

155 lines
4.2 KiB
JavaScript
Raw Normal View History

///////////////////////////// Make headers linkable /////////////////////////////
var headingWhiteList = $("\
.article--content h2, \
.article--content h3, \
.article--content h4, \
.article--content h5, \
.article--content h6 \
");
var headingBlackList = ("\
.influxdbu-banner h4 \
");
headingElements = headingWhiteList.not(headingBlackList);
headingElements.each(function() {
function getLink(element) {
return ((element.attr('href') === undefined ) ? $(element).attr("id") : element.attr('href'))
}
var link = "<a href=\"#" + getLink($(this)) + "\"></a>"
$(this).wrapInner( link );
2018-12-21 23:59:12 +00:00
})
///////////////////////////////// Smooth Scroll /////////////////////////////////
var elementWhiteList = [
".tabs p a",
".code-tabs p a",
2019-02-05 18:39:00 +00:00
".children-links a",
2020-04-17 06:57:07 +00:00
".list-links a",
"a.url-trigger",
"a.fullscreen-close"
]
function scrollToAnchor(target) {
var $target = $(target);
if($target && $target.length > 0) {
$('html, body').stop().animate({
'scrollTop': ($target.offset().top)
}, 400, 'swing', function () {
window.location.hash = target;
});
// Unique accordion functionality
// If the target is an accordion element, open the accordion after scrolling
if ($target.hasClass('expand')) {
if ($(target + ' .expand-label .expand-toggle').hasClass('open')) {}
else {
$(target + '> .expand-label').trigger('click');
};
};
}
}
$('.article a[href^="#"]:not(' + elementWhiteList + ')').click(function (e) {
e.preventDefault();
scrollToAnchor(this.hash);
});
2019-01-03 00:18:01 +00:00
///////////////////////////// Left Nav Interactions /////////////////////////////
$(".children-toggle").click(function(e) {
2019-10-08 21:38:49 +00:00
e.preventDefault()
$(this).toggleClass('open');
$(this).siblings('.children').toggleClass('open');
2019-01-03 00:18:01 +00:00
})
//////////////////////////// Mobile Contents Toggle ////////////////////////////
$('#contents-toggle-btn').click(function(e) {
e.preventDefault();
$(this).toggleClass('open');
$('#nav-tree').toggleClass('open');
})
/////////////////////////////// Truncate Content ///////////////////////////////
$(".truncate-toggle").click(function(e) {
2019-10-08 21:38:49 +00:00
e.preventDefault()
var truncateParent = $(this).closest('.truncate')
var truncateParentID = $(this).closest('.truncate')[0].id
if (truncateParent.hasClass('closed')) {
$(this)[0].href = `#${truncateParentID}`
} else {
$(this)[0].href = "#"
}
truncateParent.toggleClass('closed')
truncateParent.find('.truncate-content').toggleClass('closed')
})
////////////////////////////// Expand Accordions ///////////////////////////////
$('.expand-label').click(function() {
$(this).children('.expand-toggle').toggleClass('open')
$(this).next('.expand-content').slideToggle(200)
})
// Expand accordions on load based on URL anchor
function openAccordionByHash() {
var anchor = window.location.hash;
function expandElement() {
if ($(anchor).parents('.expand').length > 0) {
return $(anchor).closest('.expand').children('.expand-label');
} else if ($(anchor).hasClass('expand')){
return $(anchor).children('.expand-label');
}
};
if (expandElement() != null) {
if (expandElement().children('.expand-toggle').hasClass('open')) {}
else {
expandElement().children('.expand-toggle').trigger('click');
};
};
};
// Open accordions by hash on page load.
openAccordionByHash()
////////////////////////// Inject tooltips on load //////////////////////////////
2019-10-03 19:07:25 +00:00
2019-10-08 21:36:30 +00:00
$('.tooltip').each( function(){
2019-10-08 21:38:49 +00:00
$toolTipText = $('<div/>').addClass('tooltip-text').text($(this).attr('data-tooltip-text'));
$toolTipElement = $('<div/>').addClass('tooltip-container').append($toolTipText);
$(this).prepend($toolTipElement);
});
//////////////////// Style time cells in tables to not wrap ////////////////////
$('.article--content table').each(function() {
var table = $(this);
table.find('td').each(function() {
let cellContent = $(this)[0].innerText
IOx documentation (#4730) * fix iox ui details (#4660) * fixed left nav for iox * updated nav order * one more nav fix * added sql data types doc to iox * removed, need to create separate branch * IOx get started (#4676) * WIP iox get started * WIP iox get started * WIP iox get started * WIP iox get-started * WIP get-started docs * iox get started setup * added custom times and datepicker to iox getting started * finished sample data date picker * WIP get started querying * wrapped up new getting started content * fixed unclosed shortcode * fixed js bug, updated get started to address PR feedback * removed influxdbu banner from iox-get-started * fixed typos * Migrate data to IOx (#4704) * WIP iox get started * WIP iox get started * WIP iox get started * WIP iox get-started * WIP get-started docs * iox get started setup * added custom times and datepicker to iox getting started * finished sample data date picker * WIP get started querying * wrapped up new getting started content * fixed unclosed shortcode * fixed js bug, updated get started to address PR feedback * removed influxdbu banner from iox-get-started * add tsm to iox migration guide * WIP 1.x iox migration * WIP iox migration guides * iox migration landing page content * updated migration docs to address PR feedback * one last PR feedback update * added sql reference for review * moved reference to sql folder * removed file * Schema recommendations for IOx (#4701) * WIP iox get started * WIP iox get started * WIP iox get started * WIP iox get-started * WIP get-started docs * iox get started setup * added custom times and datepicker to iox getting started * finished sample data date picker * WIP get started querying * wrapped up new getting started content * fixed unclosed shortcode * fixed js bug, updated get started to address PR feedback * removed influxdbu banner from iox-get-started * schema design recommendations * add heading color styles * fixed typos and formatting * fixed typos * fixed line protocol descrepencies * fixed typo * IOx landing page and notification (#4717) * updated cloud iox landing page * added state of the docs notification, removed addition resources from nav * updated iox page titles * updated duplicate oss and product data * add order by doc (#4710) * add order by doc * Update content/influxdb/cloud-iox/order-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/order-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/order-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/order-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/order-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/order-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/order-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/order-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/order-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/order-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/order-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/order-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/order-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/order-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * added select doc (#4708) * added select doc * Update content/influxdb/cloud-iox/select.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/select.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/select.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/select.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/select.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/select.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/select.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/select.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/select.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/select.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/select.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/select.md Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org> Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org> * having clause (#4713) * added having clause * Update content/influxdb/cloud-iox/having.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/having.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/having.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/having.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/having.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/having.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/having.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * added sql-data-types branch and corresponding doc (#4700) * added sql-data-types branch and corresponding doc * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org> * Update content/influxdb/cloud-iox/sql-data-types.md Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org> * added interval * fixed formatting * more format fixes Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org> * add limit doc (#4711) * add limit doc * Update content/influxdb/cloud-iox/limit.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/limit.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/limit.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/limit.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/limit.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/limit.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/limit.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/limit.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/limit.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/limit.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/limit.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * added group by (#4721) * added group by * Update content/influxdb/cloud-iox/group-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/group-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/group-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/group-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Update content/influxdb/cloud-iox/group-by.md Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> --------- Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * IOx SQL query guides (#4720) * WIP basic sql query guide * WIP query guides * WIP query docs, updated query format * fleshed out sql aggregate query doc * updated aggregate query guide, added explore schema guide * fixed getting started link * IOx Grafana and Superset documentation (#4723) * iox grafana and superset documentation * updates to the superset and grafana docs * chore(grafana): Rework the documentation for a release instead of from source. (#4724) * chore(grafana): Rework the documentation for a release instead of from source. * chore: Typo. * chore: v0.1.0 will be the first release. * updates to address PR feedback * a few minor updates to the grafana doc * another minor update to grafana * fixed grafana archive name --------- Co-authored-by: Brett Buddin <brett@buddin.org> * rearranged docs * fix order by description * updated more sql reference doc descriptions * Add SQL selector functions (#4725) * WIP selector functions * WIP selector fns * wrapped up sql selector functions * relocated function docs * add iox regions doc * add messaging to guide users to the correct docs (#4728) * minor changes * added Flux reference * updated algolia tagging * add delete information to iox docs (#4727) * fixed typos * Add write content to the IOx docs (#4729) * ported telegraf write docs to iox * write content and updated reference * updated node deps * added link to selectors reference --------- Co-authored-by: lwandzura <51929958+lwandzura@users.noreply.github.com> Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org> Co-authored-by: Brett Buddin <brett@buddin.org>
2023-01-31 18:07:26 +00:00
if (/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.*Z/.test(cellContent)) {
$(this).addClass('nowrap')
}
})
})
Clustered installation docs (#5327) * WIP clustered install guide * fix: Use AZURE_CLIENT_ID (#5179) * docs: add s3 policy * docs: use suggested style Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * fix: typo Co-authored-by: Jeffrey Smith II <jsmith@influxdata.com> * fix(clustered): remove link to inaccessible google doc (#5197) * added CRD abbreviation * Alternate Clustered deployment with kubit (#5199) * WIP kubit deployment * Update content/influxdb/clustered/install/deploy.md Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com> * Apply suggestions from code review Co-authored-by: Jack <56563911+jdockerty@users.noreply.github.com> * updated kubit apply instructions * Apply suggestions from code review Co-authored-by: Jack <56563911+jdockerty@users.noreply.github.com> * updated clustered install instructions to address PR feedback * Update content/influxdb/clustered/install/deploy.md Co-authored-by: Jack <56563911+jdockerty@users.noreply.github.com> --------- Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com> Co-authored-by: Jack <56563911+jdockerty@users.noreply.github.com> * docs: update `kubit` mentions (#5252) * fix: kubectl references * chore: bump version of kubit install in docs * docs: mention --docker flag from new release * fix: wording * docs(clustered): bump kubit to `0.0.13` (#5260) * docs(clustered): bump kubit to `0.0.14` (#5272) * removed certain prereqs in clustered install docs, related to influxdata/project-clustered#150 (#5290) * docs(clustered): add azure/gcp storage permission requirements (#5296) * docs(clustered): add gcp storage iam policy * fix: wording * docs: format and include azure * docs: clarify azure * address feedback Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * address feedback for azure Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * azure blob storage feedback wrapper Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * address gcp feedback * Update content/influxdb/clustered/install/prerequisites.md --------- Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * docs(clustered): fix incorrect padding and typos (#5312) * fix: host and client_id in config.toml * fix: padding causing html span to show * revert: host placeholder * Update _index.md * Update _index.md * Update auth.md * Update prerequisites.md * Update use-your-cluster.md * Apply suggestions from code review Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com> * commented out auth0 placeholder content * consolidate steps in entra id setup --------- Co-authored-by: Marko Mikulicic <mmikulicic@gmail.com> Co-authored-by: Jack Dockerty <jdockerty@influxdata.com> Co-authored-by: Jack <56563911+jdockerty@users.noreply.github.com> Co-authored-by: Jeffrey Smith II <jsmith@influxdata.com> Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>
2024-02-20 19:56:12 +00:00
/////////////////////// Open external links in a new tab ///////////////////////
$('.article--content a').each(function() {
var currentHost = location.host;
if (!($(this)[0].href).includes(currentHost)) {
$(this).attr('target', '_blank');
};
})