Improvements to add support for script type and data-* attributes. Also added Script and Stylesheet classes to simplify Resource declarations.
This commit is contained in:
30
Oqtane.Shared/Models/Stylesheet.cs
Normal file
30
Oqtane.Shared/Models/Stylesheet.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Stylesheet inherits from Resource and offers constructors with parameters specific to Stylesheets
|
||||
/// </summary>
|
||||
public class Stylesheet : Resource
|
||||
{
|
||||
private void SetDefaults()
|
||||
{
|
||||
this.ResourceType = ResourceType.Stylesheet;
|
||||
this.Location = ResourceLocation.Head;
|
||||
}
|
||||
|
||||
public Stylesheet(string Href)
|
||||
{
|
||||
SetDefaults();
|
||||
this.Url = Href;
|
||||
}
|
||||
|
||||
public Stylesheet(string Href, string Integrity, string CrossOrigin)
|
||||
{
|
||||
SetDefaults();
|
||||
this.Url = Href;
|
||||
this.Integrity = Integrity;
|
||||
this.CrossOrigin = CrossOrigin;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user