remove A/B testing logic for stylesheets - discard root component approach in favor of legacy JS Interop approach to eliminate FOUC issues
This commit is contained in:
parent
1e18d913e0
commit
ce6647a84a
|
@ -19,12 +19,7 @@ namespace Oqtane.Themes.Controls
|
|||
{
|
||||
if (page.IsClickable)
|
||||
{
|
||||
var url = string.IsNullOrEmpty(page.Url) ? NavigateUrl(page.Path) : page.Url;
|
||||
if (PageState.QueryString.ContainsKey("method"))
|
||||
{
|
||||
url += ((url.Contains("?")) ? "&" : "?") + "method=" + PageState.QueryString["method"];
|
||||
}
|
||||
return url;
|
||||
return string.IsNullOrEmpty(page.Url) ? NavigateUrl(page.Path) : page.Url;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -42,16 +42,6 @@
|
|||
}
|
||||
headcontent += $"<link id=\"app-favicon\" rel=\"shortcut icon\" type=\"image/{favicontype}\" href=\"{favicon}\" />\n";
|
||||
|
||||
if (PageState.QueryString.ContainsKey("method") && PageState.QueryString["method"] == "new")
|
||||
{
|
||||
// stylesheets
|
||||
foreach (Resource resource in PageState.Page.Resources.Where(item => item.ResourceType == ResourceType.Stylesheet))
|
||||
{
|
||||
var url = (resource.Url.Contains("://")) ? resource.Url : PageState.Alias.BaseUrl + resource.Url;
|
||||
headcontent += "<link rel=\"stylesheet\" href=\"" + url + "\"" + (!string.IsNullOrEmpty(resource.Integrity) ? " integrity=\"" + resource.Integrity + "\"" : "") + (!string.IsNullOrEmpty(resource.CrossOrigin) ? " crossorigin=\"" + resource.CrossOrigin + "\"" : "") + " type=\"text/css\"/>" + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
// head content
|
||||
AddHeadContent(headcontent, PageState.Site.HeadContent);
|
||||
if (!string.IsNullOrEmpty(PageState.Site.HeadContent))
|
||||
|
@ -106,8 +96,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (!PageState.QueryString.ContainsKey("method") || (PageState.QueryString.ContainsKey("method") && PageState.QueryString["method"] == "old"))
|
||||
{
|
||||
// style sheets
|
||||
if (PageState.Page.Resources != null && PageState.Page.Resources.Exists(item => item.ResourceType == ResourceType.Stylesheet))
|
||||
{
|
||||
|
@ -128,7 +116,6 @@
|
|||
await interop.RemoveElementsById("app-stylesheet-module-", "", "app-stylesheet-module-" + batch + "-00");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task InjectScripts(string content, ResourceLocation location)
|
||||
{
|
||||
|
|
|
@ -167,8 +167,6 @@ namespace Oqtane.Pages
|
|||
}
|
||||
|
||||
// stylesheets
|
||||
if (!HttpContext.Request.Query.ContainsKey("method") || (HttpContext.Request.Query.ContainsKey("method") && HttpContext.Request.Query["method"] == "old"))
|
||||
{
|
||||
var resources = new List<Resource>();
|
||||
if (string.IsNullOrEmpty(page.ThemeType))
|
||||
{
|
||||
|
@ -189,7 +187,6 @@ namespace Oqtane.Pages
|
|||
}
|
||||
}
|
||||
ManageStyleSheets(resources, alias, theme.ThemeName);
|
||||
}
|
||||
|
||||
// scripts
|
||||
if (Runtime == "Server")
|
||||
|
|
Loading…
Reference in New Issue
Block a user