From 48bbb9a7e665201ef2bff32f9bd345355fedb87b Mon Sep 17 00:00:00 2001 From: Tim Down <158919+timdown@users.noreply.github.com> Date: Thu, 16 May 2024 08:38:27 +0100 Subject: [PATCH] Merge pull request #18377 from overleaf/td-metrics-page-fix Move Bootstrap and jQuery imports into metricsApp GitOrigin-RevId: 3ec1690ca60928e983211792f6c6b63548dfe62c --- services/web/app/views/_mixins/foot_scripts.pug | 6 ++++++ services/web/app/views/layout-base.pug | 10 ++++------ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 services/web/app/views/_mixins/foot_scripts.pug diff --git a/services/web/app/views/_mixins/foot_scripts.pug b/services/web/app/views/_mixins/foot_scripts.pug new file mode 100644 index 0000000000..57ff265322 --- /dev/null +++ b/services/web/app/views/_mixins/foot_scripts.pug @@ -0,0 +1,6 @@ +mixin foot-scripts() + each file in entrypointScripts(entrypoint) + script(type="text/javascript", nonce=scriptNonce, src=file, defer=deferScripts) + if (settings.splitTest.devToolbar.enabled) + each file in entrypointScripts("devToolbar") + script(type="text/javascript", nonce=scriptNonce, src=file, defer=deferScripts) diff --git a/services/web/app/views/layout-base.pug b/services/web/app/views/layout-base.pug index d7b45230f3..dbba2aa313 100644 --- a/services/web/app/views/layout-base.pug +++ b/services/web/app/views/layout-base.pug @@ -1,3 +1,5 @@ +include ./_mixins/foot_scripts + doctype html html( lang=(currentLngCode || 'en') @@ -82,12 +84,8 @@ html( div#dev-toolbar block foot-scripts - each file in entrypointScripts(entrypoint) - script(type="text/javascript", nonce=scriptNonce, src=file, defer=deferScripts) - if (settings.splitTest.devToolbar.enabled) - each file in entrypointScripts("devToolbar") - script(type="text/javascript", nonce=scriptNonce, src=file, defer=deferScripts) - + +foot-scripts + script(type="text/javascript", nonce=scriptNonce). window.addEventListener('DOMContentLoaded', function() { //- Look for bundle