Improved CSS handling

This commit is contained in:
Shaun Walker
2019-09-21 22:15:44 -04:00
parent 054495056d
commit 5f62957752
15 changed files with 142 additions and 39 deletions

View File

@ -42,13 +42,13 @@ namespace Oqtane.Shared
}
}
public Task AddCSS(string filename)
public Task AddCSS(string id, string url)
{
try
{
jsRuntime.InvokeAsync<string>(
"interop.addCSS",
filename);
id, url);
return Task.CompletedTask;
}
catch
@ -57,13 +57,13 @@ namespace Oqtane.Shared
}
}
public Task RemoveCSS(string filepattern)
public Task RemoveCSS(string pattern)
{
try
{
jsRuntime.InvokeAsync<string>(
"interop.removeCSS",
filepattern);
pattern);
return Task.CompletedTask;
}
catch

View File

@ -35,7 +35,7 @@
{
// remove any custom CSS
var interop = new Interop(jsRuntime);
await interop.RemoveCSS("Themes/");
await interop.RemoveCSS("Modules/");
await interop.RemoveCSS("Theme:");
await interop.RemoveCSS("Module:");
}
}

View File

@ -191,5 +191,10 @@ namespace Oqtane.Shared
return "";
}
}
public static string CreateIdFromUrl(string value)
{
return value.Replace("/", "_").Replace("\\", "_").Replace(".", "_");
}
}
}