diff --git a/Oqtane.Client/Installer/Installer.razor b/Oqtane.Client/Installer/Installer.razor index f339367c..b07be334 100644 --- a/Oqtane.Client/Installer/Installer.razor +++ b/Oqtane.Client/Installer/Installer.razor @@ -140,15 +140,8 @@ { // include CSS var content = ""; - if (string.IsNullOrEmpty(SiteState.Properties.HeadContent)) - { - SiteState.Properties.HeadContent = content; - } - else if (!SiteState.Properties.HeadContent.Contains(content)) - { - SiteState.Properties.HeadContent += content; - } - + SiteState.AppendHeadContent(content); + _togglePassword = SharedLocalizer["ShowPassword"]; _toggleConfirmPassword = SharedLocalizer["ShowPassword"]; diff --git a/Oqtane.Client/Modules/ModuleBase.cs b/Oqtane.Client/Modules/ModuleBase.cs index 381d4747..fadfaf1a 100644 --- a/Oqtane.Client/Modules/ModuleBase.cs +++ b/Oqtane.Client/Modules/ModuleBase.cs @@ -281,14 +281,7 @@ namespace Oqtane.Modules // note - only supports links and meta tags - not scripts public void AddHeadContent(string content) { - if (string.IsNullOrEmpty(SiteState.Properties.HeadContent)) - { - SiteState.Properties.HeadContent = content; - } - else if (!SiteState.Properties.HeadContent.Contains(content)) - { - SiteState.Properties.HeadContent += content; - } + SiteState.AppendHeadContent(content); } public void AddScript(Resource resource) diff --git a/Oqtane.Client/Themes/ThemeBase.cs b/Oqtane.Client/Themes/ThemeBase.cs index 68519430..dc52aa75 100644 --- a/Oqtane.Client/Themes/ThemeBase.cs +++ b/Oqtane.Client/Themes/ThemeBase.cs @@ -150,14 +150,7 @@ namespace Oqtane.Themes // note - only supports links and meta tags - not scripts public void AddHeadContent(string content) { - if (string.IsNullOrEmpty(SiteState.Properties.HeadContent)) - { - SiteState.Properties.HeadContent = content; - } - else if (!SiteState.Properties.HeadContent.Contains(content)) - { - SiteState.Properties.HeadContent += content; - } + SiteState.AppendHeadContent(content); } public void AddScript(Resource resource) diff --git a/Oqtane.Shared/Shared/SiteState.cs b/Oqtane.Shared/Shared/SiteState.cs index f3727567..50481f65 100644 --- a/Oqtane.Shared/Shared/SiteState.cs +++ b/Oqtane.Shared/Shared/SiteState.cs @@ -14,5 +14,17 @@ namespace Oqtane.Shared private dynamic _properties; public dynamic Properties => _properties ?? (_properties = new PropertyDictionary()); + + public void AppendHeadContent(string content) + { + if (string.IsNullOrEmpty(Properties.HeadContent)) + { + Properties.HeadContent = content; + } + else if (!Properties.HeadContent.Contains(content)) + { + Properties.HeadContent += content; + } + } } }