Bugfix newsletter and footer scripts (#18855)

This commit is contained in:
bstankix 2023-07-28 16:12:51 +02:00 committed by GitHub
parent 3b3676191b
commit f74f4cea10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -331,7 +331,7 @@ function initBenchmarkPickers() {
function addFooter() {
const footerAnchor = $('.footer');
fetch('../footer.html').then((response) => response.text()).then((text) => {
fetch('/footer.html').then((response) => response.text()).then((text) => {
const footerContent = $(text);
footerAnchor.append(footerContent);
});

View File

@ -4,7 +4,11 @@ newsletterFieldPrefix = 'newsletter-'
// debug url
// const eloquaUrl = 'https://httpbingo.org/post'
const currentPath = window.location.pathname.slice(1).split('/');
const newsletterModalPathVersion = (['cn', 'jp'].includes(currentPath[0])) ?
`/${currentPath[0]}/${currentPath[1]}` :
`/${currentPath[0]}`;
const newsletterModalPath = newsletterModalPathVersion + '/_static/html/newsletter.html';
$(document).ready(function () {
const waitForElement = async selector => {
@ -24,7 +28,7 @@ $(document).ready(function () {
// });
function showForm() {
fetch('_static/html/newsletter.html').then((response) => response.text()).then((text) => {
fetch(newsletterModalPath).then((response) => response.text()).then((text) => {
const newsletter = $('<div>');
newsletter.attr('id', 'newsletterModal');
newsletter.addClass('newsletterContainer');