allow CSS testing using old and new method

This commit is contained in:
sbwalker
2023-06-22 14:05:08 -04:00
parent 2a5713ed67
commit 5660f40512
2 changed files with 35 additions and 17 deletions

View File

@ -21,6 +21,7 @@ using Oqtane.Security;
using Oqtane.Extensions;
using Oqtane.Themes;
using System.Collections.Generic;
using Oqtane.UI;
namespace Oqtane.Pages
{
@ -511,8 +512,12 @@ namespace Oqtane.Pages
if (!HeadResources.Contains(resource.Url, StringComparison.OrdinalIgnoreCase))
{
count++;
string id = "id=\"app-stylesheet-" + ResourceLevel.Page.ToString().ToLower() + "-" + DateTime.UtcNow.ToString("yyyyMMddHHmmssfff") + "-" + count.ToString("00") + "\" ";
string id = "";
if (!HttpContext.Request.Query.ContainsKey("method") || (HttpContext.Request.Query.ContainsKey("method") && HttpContext.Request.Query["method"] == "old"))
{
count++;
id = "id=\"app-stylesheet-" + ResourceLevel.Page.ToString().ToLower() + "-" + DateTime.UtcNow.ToString("yyyyMMddHHmmssfff") + "-" + count.ToString("00") + "\" ";
}
HeadResources += "<link " + id + "rel=\"stylesheet\" href=\"" + resource.Url + "\"" + (!string.IsNullOrEmpty(resource.Integrity) ? " integrity=\"" + resource.Integrity + "\"" : "") + (!string.IsNullOrEmpty(resource.CrossOrigin) ? " crossorigin=\"" + resource.CrossOrigin + "\"" : "") + " type=\"text/css\"/>" + Environment.NewLine;
}
}