From a452e1e8cd0c08d0f98e4607b22d7dfe486150d8 Mon Sep 17 00:00:00 2001 From: Tim Down <158919+timdown@users.noreply.github.com> Date: Thu, 2 May 2024 11:20:29 +0100 Subject: [PATCH] Merge pull request #18195 from overleaf/revert-18120-td-bs5-load-js Revert "Load correct JS for the active Bootstrap version" GitOrigin-RevId: 7f6e846b5461cfbacec874ed55bba577e414f3a6 --- services/web/app/views/_mixins/bootstrap_js.pug | 3 --- services/web/app/views/layout-base.pug | 4 ++-- services/web/app/views/layout-marketing.pug | 4 ---- services/web/app/views/layout-website-redesign.pug | 4 ---- .../web/app/views/subscriptions/interstitial-payment.pug | 4 ---- services/web/frontend/js/bootstrap-3.ts | 5 ----- services/web/frontend/js/bootstrap-5.ts | 1 - services/web/frontend/js/marketing.js | 5 +++++ services/web/frontend/js/pages/project-list.jsx | 2 ++ services/web/webpack.config.js | 2 -- 10 files changed, 9 insertions(+), 25 deletions(-) delete mode 100644 services/web/app/views/_mixins/bootstrap_js.pug delete mode 100644 services/web/frontend/js/bootstrap-3.ts delete mode 100644 services/web/frontend/js/bootstrap-5.ts diff --git a/services/web/app/views/_mixins/bootstrap_js.pug b/services/web/app/views/_mixins/bootstrap_js.pug deleted file mode 100644 index 866b0b4218..0000000000 --- a/services/web/app/views/_mixins/bootstrap_js.pug +++ /dev/null @@ -1,3 +0,0 @@ -mixin bootstrap-js(bootstrapVersion) - each file in (entrypointScripts(bootstrapVersion === 5 ? 'bootstrap-5' : 'bootstrap-3')) - script(type="text/javascript", nonce=scriptNonce, src=file) diff --git a/services/web/app/views/layout-base.pug b/services/web/app/views/layout-base.pug index d7b45230f3..2dde4d6eda 100644 --- a/services/web/app/views/layout-base.pug +++ b/services/web/app/views/layout-base.pug @@ -4,7 +4,7 @@ html( class=(fixedSizeDocument ? 'fixed-size-document' : undefined) ) - metadata = metadata || {} - - let bootstrap5EnabledPage = false + - bootstrap5EnabledPage = false block entrypointVar @@ -13,7 +13,7 @@ html( head include ./_metadata.pug - - const bootstrapVersion = bootstrap5EnabledPage && splitTestVariants['bootstrap-5'] === 'enabled' ? 5 : 3 + - var bootstrapVersion = bootstrap5EnabledPage && splitTestVariants['bootstrap-5'] === 'enabled' ? 5 : 3 //- Stylesheet link(rel='stylesheet', href=buildCssPath(getCssThemeModifier(userSettings, brandVariation), bootstrapVersion), id="main-stylesheet") diff --git a/services/web/app/views/layout-marketing.pug b/services/web/app/views/layout-marketing.pug index a5c7ae5b76..0ca338809e 100644 --- a/services/web/app/views/layout-marketing.pug +++ b/services/web/app/views/layout-marketing.pug @@ -1,7 +1,6 @@ extends ./layout-base include ./_mixins/formMessages -include ./_mixins/bootstrap_js block entrypointVar - entrypoint = 'marketing' @@ -22,6 +21,3 @@ block body include _cookie_banner != moduleIncludes("contactModal-marketing", locals) - -block prepend foot-scripts - +bootstrap-js(bootstrapVersion) diff --git a/services/web/app/views/layout-website-redesign.pug b/services/web/app/views/layout-website-redesign.pug index e848600e15..8f21e904cc 100644 --- a/services/web/app/views/layout-website-redesign.pug +++ b/services/web/app/views/layout-website-redesign.pug @@ -1,7 +1,6 @@ extends ./layout-base include ./_mixins/formMessages -include ./_mixins/bootstrap_js block entrypointVar - entrypoint = 'marketing' @@ -22,6 +21,3 @@ block body include _cookie_banner != moduleIncludes("contactModal-marketing", locals) - -block prepend foot-scripts - +bootstrap-js(bootstrapVersion) diff --git a/services/web/app/views/subscriptions/interstitial-payment.pug b/services/web/app/views/subscriptions/interstitial-payment.pug index 8cebac6831..5458654aec 100644 --- a/services/web/app/views/subscriptions/interstitial-payment.pug +++ b/services/web/app/views/subscriptions/interstitial-payment.pug @@ -1,7 +1,6 @@ extends ../layout include ./plans/_mixins -include ../_mixins/bootstrap_js block vars - entrypoint = 'pages/user/subscription/plans-v2/plans-v2-main' @@ -66,6 +65,3 @@ block content | #{translate("continue_with_free_plan")} != moduleIncludes("contactModalGeneral-marketing", locals) - -block prepend foot-scripts - +bootstrap-js(bootstrapVersion) diff --git a/services/web/frontend/js/bootstrap-3.ts b/services/web/frontend/js/bootstrap-3.ts deleted file mode 100644 index 9c2bc11ddf..0000000000 --- a/services/web/frontend/js/bootstrap-3.ts +++ /dev/null @@ -1,5 +0,0 @@ -import 'jquery' -import 'bootstrap' - -$('[data-ol-lang-selector-tooltip]').tooltip({ trigger: 'hover' }) -$('[data-toggle="tooltip"]').tooltip() diff --git a/services/web/frontend/js/bootstrap-5.ts b/services/web/frontend/js/bootstrap-5.ts deleted file mode 100644 index 3b4282f29f..0000000000 --- a/services/web/frontend/js/bootstrap-5.ts +++ /dev/null @@ -1 +0,0 @@ -import 'bootstrap-5' diff --git a/services/web/frontend/js/marketing.js b/services/web/frontend/js/marketing.js index 1f61c4b735..3cb12be43a 100644 --- a/services/web/frontend/js/marketing.js +++ b/services/web/frontend/js/marketing.js @@ -1,5 +1,7 @@ import './utils/webpack-public-path' import './infrastructure/error-reporter' +import 'jquery' +import 'bootstrap' import './features/form-helpers/hydrate-form' import './features/form-helpers/password-visibility' import './features/link-helpers/slow-link' @@ -11,3 +13,6 @@ import './features/multi-submit' import './features/cookie-banner' import './features/autoplay-video' import './features/mathjax' + +$('[data-ol-lang-selector-tooltip]').tooltip({ trigger: 'hover' }) +$('[data-toggle="tooltip"]').tooltip() diff --git a/services/web/frontend/js/pages/project-list.jsx b/services/web/frontend/js/pages/project-list.jsx index 744f5f1bf7..b69ca485f9 100644 --- a/services/web/frontend/js/pages/project-list.jsx +++ b/services/web/frontend/js/pages/project-list.jsx @@ -1,3 +1,5 @@ +import 'jquery' +import 'bootstrap' import './../utils/meta' import './../utils/webpack-public-path' import './../infrastructure/error-reporter' diff --git a/services/web/webpack.config.js b/services/web/webpack.config.js index 10c7920715..1d80e11edf 100644 --- a/services/web/webpack.config.js +++ b/services/web/webpack.config.js @@ -17,8 +17,6 @@ invalidateBabelCacheIfNeeded() // Generate a hash of entry points, including modules const entryPoints = { tracing: './frontend/js/tracing.js', - 'bootstrap-3': './frontend/js/bootstrap-3.ts', - 'bootstrap-5': './frontend/js/bootstrap-5.ts', devToolbar: './frontend/js/dev-toolbar.js', main: './frontend/js/main.js', ide: './frontend/js/ide.js',