From f8ab8867504c5f7eef077c2ee3f8f17dd6c56204 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Sat, 16 May 2020 22:11:58 -0400 Subject: [PATCH] Fixed issue with loading resources --- Oqtane.Client/Themes/BlazorTheme/Default.razor | 6 ------ Oqtane.Client/Themes/OqtaneTheme/Default.razor | 10 +--------- Oqtane.Server/wwwroot/js/interop.js | 12 ++++++++---- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/Oqtane.Client/Themes/BlazorTheme/Default.razor b/Oqtane.Client/Themes/BlazorTheme/Default.razor index 4fa2a01d..2ed0d1fb 100644 --- a/Oqtane.Client/Themes/BlazorTheme/Default.razor +++ b/Oqtane.Client/Themes/BlazorTheme/Default.razor @@ -37,10 +37,4 @@ return resources; } } - - protected override async Task OnParametersSetAsync() - { - //await IncludeCSS("Theme.css"); - } - } \ No newline at end of file diff --git a/Oqtane.Client/Themes/OqtaneTheme/Default.razor b/Oqtane.Client/Themes/OqtaneTheme/Default.razor index f6238a17..67d53081 100644 --- a/Oqtane.Client/Themes/OqtaneTheme/Default.razor +++ b/Oqtane.Client/Themes/OqtaneTheme/Default.razor @@ -25,16 +25,8 @@ { List resources = new List(); resources.Add(new Resource { ResourceType = ResourceType.Stylesheet, Url = "https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/cyborg/bootstrap.min.css", Integrity = "sha384-l7xaoY0cJM4h9xh1RfazbgJVUZvdtyLWPueWNtLAphf/UbBgOVzqbOTogxPwYLHM", CrossOrigin = "anonymous" }); - resources.Add(new Resource { ResourceType = ResourceType.Stylesheet, Url = "Themes/" + GetType().Namespace + "/Theme.css" }); + resources.Add(new Resource { ResourceType = ResourceType.Stylesheet, Url = "Themes/" + GetType().Namespace + "/Theme.css", Integrity = "", CrossOrigin = "" }); return resources; } } - - protected override async Task OnParametersSetAsync() - { - // go to https://www.bootstrapcdn.com/bootswatch/ and take your favorite theme - // - //await LoadBootstrapTheme("https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/cyborg/bootstrap.min.css","sha384-l7xaoY0cJM4h9xh1RfazbgJVUZvdtyLWPueWNtLAphf/UbBgOVzqbOTogxPwYLHM"); - //await IncludeCSS("Theme.css"); - } } diff --git a/Oqtane.Server/wwwroot/js/interop.js b/Oqtane.Server/wwwroot/js/interop.js index 36b6c4f3..3f42cd11 100644 --- a/Oqtane.Server/wwwroot/js/interop.js +++ b/Oqtane.Server/wwwroot/js/interop.js @@ -62,10 +62,10 @@ window.interop = { link.id = id; } link.rel = rel; - link.href = url; if (type !== "") { link.type = type; } + link.href = url; if (integrity !== "") { link.integrity = integrity; } @@ -78,9 +78,6 @@ window.interop = { if (link.rel !== rel) { link.setAttribute('rel', rel); } - if (link.href !== url) { - link.setAttribute('href', url); - } if (type !== "") { if (link.type !== type) { link.setAttribute('type', type); @@ -88,6 +85,11 @@ window.interop = { } else { link.removeAttribute('type'); } + if (link.href !== url) { + link.removeAttribute('integrity'); + link.removeAttribute('crossorigin'); + link.setAttribute('href', url); + } if (integrity !== "") { if (link.integrity !== integrity) { link.setAttribute('integrity', integrity); @@ -136,6 +138,8 @@ window.interop = { else { if (src !== "") { if (script.src !== src) { + script.removeAttribute('integrity'); + script.removeAttribute('crossorigin'); script.src = src; } if (integrity !== "") {