2020-07-15 01:29:15 +02:00
|
|
|
import * as google_analytics from "./google-analytics.js";
|
|
|
|
import blueslip from "./../blueslip";
|
2017-08-01 07:21:44 +02:00
|
|
|
|
2020-07-16 22:40:18 +02:00
|
|
|
import {path_parts} from "./landing-page";
|
2017-08-01 07:21:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
// these constants are populated immediately with data from the DOM on page load
|
|
|
|
// name -> display name
|
2020-02-12 06:45:30 +01:00
|
|
|
const INTEGRATIONS = new Map();
|
2020-02-12 06:49:41 +01:00
|
|
|
const CATEGORIES = new Map();
|
2017-08-01 07:21:44 +02:00
|
|
|
|
|
|
|
function load_data() {
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integration-lozenge").toArray().forEach((integration) => {
|
|
|
|
const name = $(integration).data("name");
|
|
|
|
const display_name = $(integration).find(".integration-name").text().trim();
|
2017-08-01 07:21:44 +02:00
|
|
|
|
|
|
|
if (display_name && name) {
|
2020-02-12 06:45:30 +01:00
|
|
|
INTEGRATIONS.set(name, display_name);
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integration-category").toArray().forEach((category) => {
|
|
|
|
const name = $(category).data("category");
|
2019-11-02 00:06:25 +01:00
|
|
|
const display_name = $(category).text().trim();
|
2017-08-01 07:21:44 +02:00
|
|
|
|
|
|
|
if (display_name && name) {
|
2020-02-12 06:49:41 +01:00
|
|
|
CATEGORIES.set(name, display_name);
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-11-02 00:06:25 +01:00
|
|
|
const INITIAL_STATE = {
|
2020-07-15 01:29:15 +02:00
|
|
|
category: "all",
|
2017-08-01 07:21:44 +02:00
|
|
|
integration: null,
|
2020-07-15 01:29:15 +02:00
|
|
|
query: "",
|
2017-08-01 07:21:44 +02:00
|
|
|
};
|
|
|
|
|
2019-11-02 00:06:25 +01:00
|
|
|
let state = Object.assign({}, INITIAL_STATE);
|
2017-08-01 07:21:44 +02:00
|
|
|
|
|
|
|
|
2017-08-09 02:33:53 +02:00
|
|
|
function adjust_font_sizing() {
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integration-lozenge").toArray().forEach((integration) => {
|
|
|
|
const $integration_name = $(integration).find(".integration-name");
|
|
|
|
const $integration_category = $(integration).find(".integration-category");
|
2017-08-09 02:33:53 +02:00
|
|
|
|
|
|
|
// if the text has wrapped to two lines, decrease font-size
|
|
|
|
if ($integration_name.height() > 30) {
|
2020-07-15 01:29:15 +02:00
|
|
|
$integration_name.css("font-size", "1em");
|
2017-08-09 02:33:53 +02:00
|
|
|
if ($integration_name.height() > 30) {
|
2020-07-15 01:29:15 +02:00
|
|
|
$integration_name.css("font-size", ".95em");
|
2017-08-09 02:33:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($integration_category.height() > 30) {
|
2020-07-15 01:29:15 +02:00
|
|
|
$integration_category.css("font-size", ".8em");
|
2017-08-09 02:33:53 +02:00
|
|
|
if ($integration_category.height() > 30) {
|
2020-07-15 01:29:15 +02:00
|
|
|
$integration_category.css("font-size", ".75em");
|
2017-08-09 02:33:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-08-01 07:21:44 +02:00
|
|
|
function update_path() {
|
2019-11-02 00:06:25 +01:00
|
|
|
let next_path;
|
2017-08-01 07:21:44 +02:00
|
|
|
if (state.integration) {
|
|
|
|
next_path = $('.integration-lozenge[data-name="' + state.integration + '"]')
|
2020-07-15 01:29:15 +02:00
|
|
|
.closest("a").attr("href");
|
2017-08-01 07:21:44 +02:00
|
|
|
} else if (state.category) {
|
|
|
|
next_path = $('.integration-category[data-category="' + state.category + '"]')
|
2020-07-15 01:29:15 +02:00
|
|
|
.closest("a").attr("href");
|
2017-08-01 07:21:44 +02:00
|
|
|
} else {
|
2020-07-15 01:29:15 +02:00
|
|
|
next_path = "/";
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
window.history.pushState(state, "", next_path);
|
2020-05-08 06:37:58 +02:00
|
|
|
google_analytics.config({page_path: next_path});
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function update_categories() {
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integration-lozenges").css("opacity", 0);
|
2017-08-01 07:21:44 +02:00
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integration-category").removeClass("selected");
|
|
|
|
$('[data-category="' + state.category + '"]').addClass("selected");
|
2017-08-01 07:21:44 +02:00
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
const $dropdown_label = $(".integration-categories-dropdown .dropdown-category-label");
|
2017-08-01 07:21:44 +02:00
|
|
|
if (state.category === INITIAL_STATE.category) {
|
2020-07-15 01:29:15 +02:00
|
|
|
$dropdown_label.text(i18n.t("Filter by category"));
|
2017-08-01 07:21:44 +02:00
|
|
|
} else {
|
2020-02-12 06:49:41 +01:00
|
|
|
$dropdown_label.text(CATEGORIES.get(state.category));
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integration-lozenges").animate(
|
2020-07-16 22:40:18 +02:00
|
|
|
{opacity: 1},
|
|
|
|
{duration: 400},
|
2017-08-01 07:21:44 +02:00
|
|
|
);
|
2017-08-09 02:36:29 +02:00
|
|
|
|
|
|
|
adjust_font_sizing();
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
|
|
|
|
2020-07-02 01:45:54 +02:00
|
|
|
const update_integrations = _.debounce(() => {
|
2019-11-02 00:06:25 +01:00
|
|
|
const max_scrollY = window.scrollY;
|
2017-08-01 07:21:44 +02:00
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
const integrations = $(".integration-lozenges").children().toArray();
|
2020-07-02 01:45:54 +02:00
|
|
|
integrations.forEach((integration) => {
|
2020-07-15 01:29:15 +02:00
|
|
|
const $integration = $(integration).find(".integration-lozenge");
|
|
|
|
const $integration_category = $integration.find(".integration-category");
|
2017-08-01 07:21:44 +02:00
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
if (state.category !== "all") {
|
|
|
|
$integration_category.css("display", "none");
|
|
|
|
$integration.addClass("without-category");
|
2017-08-01 07:21:44 +02:00
|
|
|
} else {
|
2020-07-15 01:29:15 +02:00
|
|
|
$integration_category.css("display", "");
|
|
|
|
$integration.removeClass("without-category");
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
if (!$integration.hasClass("integration-create-your-own")) {
|
|
|
|
const display_name = INTEGRATIONS.get($integration.data("name"));
|
2019-11-02 00:06:25 +01:00
|
|
|
const display =
|
2018-06-25 17:34:11 +02:00
|
|
|
common.phrase_match(state.query, display_name) &&
|
2020-07-15 01:29:15 +02:00
|
|
|
($integration.data("categories").includes(CATEGORIES.get(state.category)) ||
|
|
|
|
state.category === "all");
|
2017-08-01 07:21:44 +02:00
|
|
|
|
|
|
|
if (display) {
|
2020-07-15 01:29:15 +02:00
|
|
|
$integration.css("display", "inline-block");
|
2017-08-01 07:21:44 +02:00
|
|
|
} else {
|
2020-07-15 01:29:15 +02:00
|
|
|
$integration.css("display", "none");
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
document.body.scrollTop = Math.min(window.scrollY, max_scrollY);
|
|
|
|
});
|
2017-08-09 02:36:29 +02:00
|
|
|
|
|
|
|
adjust_font_sizing();
|
2017-08-01 07:21:44 +02:00
|
|
|
}, 50);
|
|
|
|
|
|
|
|
function hide_catalog_show_integration() {
|
2019-11-02 00:06:25 +01:00
|
|
|
const $lozenge_icon = $(".integration-lozenge.integration-" + state.integration).clone(false);
|
2020-07-15 01:29:15 +02:00
|
|
|
$lozenge_icon.removeClass("legacy");
|
2017-08-01 07:21:44 +02:00
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
const categories = $(".integration-" + state.integration).data("categories")
|
2017-08-01 07:21:44 +02:00
|
|
|
.slice(1, -1)
|
2020-07-15 01:29:15 +02:00
|
|
|
.split(",")
|
2020-07-02 01:45:54 +02:00
|
|
|
.map((category) => category.trim().slice(1, -1));
|
2017-08-01 07:21:44 +02:00
|
|
|
|
|
|
|
function show_integration(doc) {
|
2020-07-15 01:29:15 +02:00
|
|
|
$("#integration-instructions-group .name").text(INTEGRATIONS.get(state.integration));
|
|
|
|
$("#integration-instructions-group .categories .integration-category").remove();
|
2020-07-02 01:45:54 +02:00
|
|
|
categories.forEach((category) => {
|
2019-11-02 00:06:25 +01:00
|
|
|
let link;
|
2020-02-12 06:49:41 +01:00
|
|
|
for (const [name, display_name] of CATEGORIES) {
|
|
|
|
if (display_name === category) {
|
2017-08-01 07:21:44 +02:00
|
|
|
link = name;
|
|
|
|
}
|
2020-02-12 06:49:41 +01:00
|
|
|
}
|
2020-07-15 01:29:15 +02:00
|
|
|
const category_el = $("<a></a>")
|
|
|
|
.attr("href", "/integrations/" + link)
|
2017-08-01 07:21:44 +02:00
|
|
|
.append('<h3 class="integration-category"></h3>');
|
2020-07-15 01:29:15 +02:00
|
|
|
category_el.find(".integration-category")
|
|
|
|
.attr("data-category", link)
|
2017-08-01 07:21:44 +02:00
|
|
|
.text(category);
|
2020-07-15 01:29:15 +02:00
|
|
|
$("#integration-instructions-group .categories").append(category_el);
|
2017-08-01 07:21:44 +02:00
|
|
|
});
|
2020-07-15 01:29:15 +02:00
|
|
|
$("#integration-instructions-group").css({
|
2017-08-01 07:21:44 +02:00
|
|
|
opacity: 0,
|
2020-07-15 01:29:15 +02:00
|
|
|
display: "flex",
|
2017-08-01 07:21:44 +02:00
|
|
|
});
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integration-instructions").css("display", "none");
|
|
|
|
$("#" + state.integration + ".integration-instructions .help-content").html(doc);
|
|
|
|
$("#integration-instruction-block .integration-lozenge").remove();
|
2017-08-01 07:21:44 +02:00
|
|
|
$("#integration-instruction-block")
|
|
|
|
.append($lozenge_icon)
|
2020-07-15 01:29:15 +02:00
|
|
|
.css("display", "flex");
|
|
|
|
$(".integration-instructions#" + state.integration).css("display", "block");
|
2017-08-01 07:21:44 +02:00
|
|
|
|
|
|
|
$("html, body").animate(
|
2020-07-16 22:40:18 +02:00
|
|
|
{scrollTop: 0},
|
|
|
|
{duration: 200},
|
2017-08-01 07:21:44 +02:00
|
|
|
);
|
2020-07-15 01:29:15 +02:00
|
|
|
$("#integration-instructions-group").animate(
|
2020-07-16 22:40:18 +02:00
|
|
|
{opacity: 1},
|
|
|
|
{duration: 300},
|
2017-08-01 07:21:44 +02:00
|
|
|
);
|
2017-08-09 02:36:29 +02:00
|
|
|
|
|
|
|
adjust_font_sizing();
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function hide_catalog(doc) {
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integration-categories-dropdown").css("display", "none");
|
|
|
|
$(".integrations .catalog").addClass("hide");
|
2017-08-01 07:21:44 +02:00
|
|
|
$(".extra, #integration-main-text, #integration-search").css("display", "none");
|
|
|
|
|
|
|
|
show_integration(doc);
|
2018-06-13 00:55:44 +02:00
|
|
|
$(".main").css("visibility", "visible");
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$.get({
|
2020-07-15 01:29:15 +02:00
|
|
|
url: "/integrations/doc-html/" + state.integration,
|
|
|
|
dataType: "html",
|
2017-08-01 07:21:44 +02:00
|
|
|
success: hide_catalog,
|
|
|
|
error: function (err) {
|
|
|
|
blueslip.error("Integration documentation for '" + state.integration + "' not found.", err);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function hide_integration_show_catalog() {
|
|
|
|
function show_catalog() {
|
|
|
|
$("html, body").animate(
|
2020-07-16 22:40:18 +02:00
|
|
|
{scrollTop: 0},
|
|
|
|
{duration: 200},
|
2017-08-01 07:21:44 +02:00
|
|
|
);
|
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integration-categories-dropdown").css("display", "");
|
|
|
|
$(".integrations .catalog").removeClass("hide");
|
2017-08-01 07:21:44 +02:00
|
|
|
$(".extra, #integration-main-text, #integration-search").css("display", "block");
|
2017-08-09 02:36:29 +02:00
|
|
|
adjust_font_sizing();
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function hide_integration() {
|
2020-07-15 01:29:15 +02:00
|
|
|
$("#integration-instruction-block").css("display", "none");
|
|
|
|
$("#integration-instructions-group").css("display", "none");
|
2020-07-16 22:40:18 +02:00
|
|
|
$(".inner-content").css({padding: ""});
|
2017-08-01 07:21:44 +02:00
|
|
|
$("#integration-instruction-block .integration-lozenge").remove();
|
|
|
|
show_catalog();
|
|
|
|
}
|
|
|
|
|
|
|
|
hide_integration();
|
|
|
|
}
|
|
|
|
|
|
|
|
function get_state_from_path() {
|
2019-11-02 00:06:25 +01:00
|
|
|
const result = Object.assign({}, INITIAL_STATE);
|
2017-08-01 07:21:44 +02:00
|
|
|
result.query = state.query;
|
|
|
|
|
2019-11-02 00:06:25 +01:00
|
|
|
const parts = path_parts();
|
2020-07-15 01:29:15 +02:00
|
|
|
if (parts[1] === "doc" && INTEGRATIONS.get(parts[2])) {
|
2017-08-01 07:21:44 +02:00
|
|
|
result.integration = parts[2];
|
2020-02-12 06:49:41 +01:00
|
|
|
} else if (CATEGORIES.has(parts[1])) {
|
2017-08-01 07:21:44 +02:00
|
|
|
result.category = parts[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
function render(next_state) {
|
2019-11-02 00:06:25 +01:00
|
|
|
const previous_state = Object.assign({}, state);
|
2017-08-01 07:21:44 +02:00
|
|
|
state = next_state;
|
|
|
|
|
2018-06-13 00:55:44 +02:00
|
|
|
if (previous_state.integration !== next_state.integration &&
|
|
|
|
next_state.integration !== null) {
|
|
|
|
hide_catalog_show_integration();
|
|
|
|
} else {
|
|
|
|
if (previous_state.integration !== next_state.integration) {
|
2017-08-01 07:21:44 +02:00
|
|
|
hide_integration_show_catalog();
|
|
|
|
}
|
|
|
|
|
2018-06-13 00:55:44 +02:00
|
|
|
if (previous_state.category !== next_state.category) {
|
|
|
|
update_categories();
|
|
|
|
update_integrations();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (previous_state.query !== next_state.query) {
|
|
|
|
update_integrations();
|
|
|
|
}
|
2017-08-01 07:21:44 +02:00
|
|
|
|
2018-06-13 00:55:44 +02:00
|
|
|
$(".main").css("visibility", "visible");
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
2018-06-13 00:55:44 +02:00
|
|
|
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function dispatch(action, payload) {
|
|
|
|
switch (action) {
|
2020-07-15 02:14:03 +02:00
|
|
|
case "CHANGE_CATEGORY":
|
|
|
|
render(Object.assign({}, state, {
|
|
|
|
category: payload.category,
|
|
|
|
}));
|
|
|
|
update_path();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "SHOW_INTEGRATION":
|
|
|
|
render(Object.assign({}, state, {
|
|
|
|
integration: payload.integration,
|
|
|
|
}));
|
|
|
|
update_path();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "HIDE_INTEGRATION":
|
|
|
|
render(Object.assign({}, state, {
|
|
|
|
integration: null,
|
|
|
|
}));
|
|
|
|
update_path();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "SHOW_CATEGORY":
|
|
|
|
render(Object.assign({}, state, {
|
|
|
|
integration: null,
|
|
|
|
category: payload.category,
|
|
|
|
}));
|
|
|
|
update_path();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "UPDATE_QUERY":
|
|
|
|
render(Object.assign({}, state, {
|
|
|
|
query: payload.query,
|
|
|
|
}));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "LOAD_PATH":
|
|
|
|
render(get_state_from_path());
|
|
|
|
google_analytics.config({page_path: window.location.pathname});
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
blueslip.error("Invalid action dispatched on /integrations.");
|
|
|
|
break;
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-05 19:51:52 +02:00
|
|
|
function toggle_categories_dropdown() {
|
2020-07-15 01:29:15 +02:00
|
|
|
const $dropdown_list = $(".integration-categories-dropdown .dropdown-list");
|
2018-07-05 20:13:36 +02:00
|
|
|
$dropdown_list.slideToggle(250);
|
2018-07-05 19:51:52 +02:00
|
|
|
}
|
|
|
|
|
2017-08-01 07:21:44 +02:00
|
|
|
function integration_events() {
|
2020-07-02 01:45:54 +02:00
|
|
|
$('#integration-search input[type="text"]').keypress((e) => {
|
2020-07-15 01:29:15 +02:00
|
|
|
const integrations = $(".integration-lozenges").children().toArray();
|
|
|
|
if (e.which === 13 && e.target.value !== "") {
|
2019-11-02 00:06:25 +01:00
|
|
|
for (let i = 0; i < integrations.length; i += 1) {
|
2020-07-15 01:29:15 +02:00
|
|
|
const integration = $(integrations[i]).find(".integration-lozenge");
|
2017-08-01 07:21:44 +02:00
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
if ($(integration).css("display") !== "none") {
|
|
|
|
$(integration).closest("a")[0].click();
|
2017-08-01 07:21:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integration-categories-dropdown .dropdown-toggle").click(() => {
|
2018-07-05 19:51:52 +02:00
|
|
|
toggle_categories_dropdown();
|
2017-08-01 07:21:44 +02:00
|
|
|
});
|
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integration-instruction-block").on("click", "a .integration-category", (e) => {
|
|
|
|
const category = $(e.target).data("category");
|
2020-07-16 22:40:18 +02:00
|
|
|
dispatch("SHOW_CATEGORY", {category: category});
|
2017-08-01 07:21:44 +02:00
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integrations a .integration-category").on("click", (e) => {
|
|
|
|
const category = $(e.target).data("category");
|
2020-07-16 22:40:18 +02:00
|
|
|
dispatch("CHANGE_CATEGORY", {category: category});
|
2018-07-05 19:51:52 +02:00
|
|
|
toggle_categories_dropdown();
|
2017-08-01 07:21:44 +02:00
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integrations a .integration-lozenge").on("click", (e) => {
|
|
|
|
if (!$(e.target).closest(".integration-lozenge").hasClass("integration-create-your-own")) {
|
|
|
|
const integration = $(e.target).closest(".integration-lozenge").data("name");
|
2020-07-16 22:40:18 +02:00
|
|
|
dispatch("SHOW_INTEGRATION", {integration: integration});
|
2017-08-01 07:21:44 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
$("a#integration-list-link span, a#integration-list-link i").on("click", () => {
|
|
|
|
dispatch("HIDE_INTEGRATION");
|
2017-08-01 07:21:44 +02:00
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2017-08-24 09:01:26 +02:00
|
|
|
// combine selector use for both focusing the integrations searchbar and adding
|
|
|
|
// the input event.
|
|
|
|
$(".integrations .searchbar input[type='text']")
|
|
|
|
.focus()
|
2020-07-15 01:29:15 +02:00
|
|
|
.on("input", (e) => {
|
2020-07-16 22:40:18 +02:00
|
|
|
dispatch("UPDATE_QUERY", {query: e.target.value.toLowerCase()});
|
2017-08-24 09:01:26 +02:00
|
|
|
});
|
2017-08-01 07:21:44 +02:00
|
|
|
|
2020-07-02 01:45:54 +02:00
|
|
|
$(window).scroll(() => {
|
2017-08-01 07:21:44 +02:00
|
|
|
if (document.body.scrollTop > 330) {
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integration-categories-sidebar").addClass("sticky");
|
2017-08-01 07:21:44 +02:00
|
|
|
} else {
|
2020-07-15 01:29:15 +02:00
|
|
|
$(".integration-categories-sidebar").removeClass("sticky");
|
2017-08-01 07:21:44 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
$(window).on("resize", () => {
|
2017-08-01 07:21:44 +02:00
|
|
|
adjust_font_sizing();
|
|
|
|
});
|
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
$(window).on("popstate", () => {
|
|
|
|
if (window.location.pathname.startsWith("/integrations")) {
|
|
|
|
dispatch("LOAD_PATH");
|
2017-08-01 07:21:44 +02:00
|
|
|
} else {
|
|
|
|
window.location = window.location.href;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// init
|
2020-07-02 01:45:54 +02:00
|
|
|
$(() => {
|
2017-08-01 07:21:44 +02:00
|
|
|
integration_events();
|
|
|
|
load_data();
|
2020-07-15 01:29:15 +02:00
|
|
|
dispatch("LOAD_PATH");
|
2017-08-01 07:21:44 +02:00
|
|
|
});
|