From febc7beb78eb5ff87859430decaae539a69ef3d8 Mon Sep 17 00:00:00 2001 From: Jean-Paul Ladage Date: Tue, 26 Mar 2024 11:41:28 +0000 Subject: [PATCH 1/7] Allow including js in head section --- src/plone/base/interfaces/controlpanel.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/plone/base/interfaces/controlpanel.py b/src/plone/base/interfaces/controlpanel.py index 6163126..91165c9 100644 --- a/src/plone/base/interfaces/controlpanel.py +++ b/src/plone/base/interfaces/controlpanel.py @@ -1195,10 +1195,23 @@ class ISiteSchema(Interface): required=False, ) + webstats_head_js = schema.SourceText( + title=_("JavaScript integrations included in head section"), + description=_( + "For enabling thrid party javascript integrations " + "from external providers (e.g. Google " + "Analytics). Paste the provided code snippet here. " + "It will be rendered as " + "entered at the end of the head section of the page." + ), + default="", + required=False, + ) + webstats_js = schema.SourceText( - title=_("JavaScript for web statistics support"), + title=_("JavaScript integrations included after the footer"), description=_( - "For enabling web statistics support " + "For enabling third-party javascript integrations " "from external providers (e.g. Google " "Analytics). Paste the provided code snippet here. " "It will be rendered as " From 317376ea0f7f3d604f6f657f2bb28e626bdd10f3 Mon Sep 17 00:00:00 2001 From: Jean-Paul Ladage Date: Thu, 28 Mar 2024 13:05:59 +0000 Subject: [PATCH 2/7] Update src/plone/base/interfaces/controlpanel.py spelling and grammar fixes Co-authored-by: Steve Piercy --- src/plone/base/interfaces/controlpanel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plone/base/interfaces/controlpanel.py b/src/plone/base/interfaces/controlpanel.py index 91165c9..4192949 100644 --- a/src/plone/base/interfaces/controlpanel.py +++ b/src/plone/base/interfaces/controlpanel.py @@ -1198,7 +1198,7 @@ class ISiteSchema(Interface): webstats_head_js = schema.SourceText( title=_("JavaScript integrations included in head section"), description=_( - "For enabling thrid party javascript integrations " + "For enabling third-party JavaScript integrations " "from external providers (e.g. Google " "Analytics). Paste the provided code snippet here. " "It will be rendered as " From 8ebeb3f7b7fa0a7f2b28b5f19ce5c8d00dc7bcf3 Mon Sep 17 00:00:00 2001 From: Jean-Paul Ladage Date: Thu, 28 Mar 2024 13:06:08 +0000 Subject: [PATCH 3/7] Update src/plone/base/interfaces/controlpanel.py spelling and grammar fixes Co-authored-by: Steve Piercy --- src/plone/base/interfaces/controlpanel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plone/base/interfaces/controlpanel.py b/src/plone/base/interfaces/controlpanel.py index 4192949..685ca63 100644 --- a/src/plone/base/interfaces/controlpanel.py +++ b/src/plone/base/interfaces/controlpanel.py @@ -1200,7 +1200,7 @@ class ISiteSchema(Interface): description=_( "For enabling third-party JavaScript integrations " "from external providers (e.g. Google " - "Analytics). Paste the provided code snippet here. " + "Analytics), paste the provided code snippet here. " "It will be rendered as " "entered at the end of the head section of the page." ), From 5f660ace77b1330fd242ad236eceddf7a6208337 Mon Sep 17 00:00:00 2001 From: Jean-Paul Ladage Date: Thu, 28 Mar 2024 13:06:15 +0000 Subject: [PATCH 4/7] Update src/plone/base/interfaces/controlpanel.py spelling and grammar fixes Co-authored-by: Steve Piercy --- src/plone/base/interfaces/controlpanel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plone/base/interfaces/controlpanel.py b/src/plone/base/interfaces/controlpanel.py index 685ca63..6b5b8aa 100644 --- a/src/plone/base/interfaces/controlpanel.py +++ b/src/plone/base/interfaces/controlpanel.py @@ -1211,7 +1211,7 @@ class ISiteSchema(Interface): webstats_js = schema.SourceText( title=_("JavaScript integrations included after the footer"), description=_( - "For enabling third-party javascript integrations " + "For enabling third-party JavaScript integrations " "from external providers (e.g. Google " "Analytics). Paste the provided code snippet here. " "It will be rendered as " From 340e4f62104306065360cc779deca44f76bbbb8a Mon Sep 17 00:00:00 2001 From: Jean-Paul Ladage Date: Thu, 28 Mar 2024 13:06:34 +0000 Subject: [PATCH 5/7] Update src/plone/base/interfaces/controlpanel.py spelling and grammar fixes Co-authored-by: Steve Piercy --- src/plone/base/interfaces/controlpanel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plone/base/interfaces/controlpanel.py b/src/plone/base/interfaces/controlpanel.py index 6b5b8aa..75fac7d 100644 --- a/src/plone/base/interfaces/controlpanel.py +++ b/src/plone/base/interfaces/controlpanel.py @@ -1199,7 +1199,7 @@ class ISiteSchema(Interface): title=_("JavaScript integrations included in head section"), description=_( "For enabling third-party JavaScript integrations " - "from external providers (e.g. Google " + "from external providers (e.g., Google " "Analytics), paste the provided code snippet here. " "It will be rendered as " "entered at the end of the head section of the page." From 6466ef655307b6709163398941055f198e960e29 Mon Sep 17 00:00:00 2001 From: Jean-Paul Ladage Date: Thu, 28 Mar 2024 13:09:20 +0000 Subject: [PATCH 6/7] Add changelog entry. --- news/3931.feature | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 news/3931.feature diff --git a/news/3931.feature b/news/3931.feature new file mode 100644 index 0000000..709da78 --- /dev/null +++ b/news/3931.feature @@ -0,0 +1,6 @@ +Add a field ``webstats_head_js`` to the Site controlpanel and render its +contents in the head section using ``IScripts`` viewlet manager. +See `issue 3931 `_: +some javascript needs to be loaded at the bottom of the page, and some in the head section. +[jladage] + From ad6e778051bf7275c4b13e613a0908974dca30a6 Mon Sep 17 00:00:00 2001 From: Jean-Paul Ladage Date: Thu, 28 Mar 2024 13:15:29 +0000 Subject: [PATCH 7/7] Update changelog entry to refer to correct viewlet manager. --- news/3931.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/3931.feature b/news/3931.feature index 709da78..d0d8beb 100644 --- a/news/3931.feature +++ b/news/3931.feature @@ -1,5 +1,5 @@ Add a field ``webstats_head_js`` to the Site controlpanel and render its -contents in the head section using ``IScripts`` viewlet manager. +contents in the head section using ``IHtmlHeadLinks`` viewlet manager. See `issue 3931 `_: some javascript needs to be loaded at the bottom of the page, and some in the head section. [jladage]