Update: Use Generics for Compiled View
Also standardize inclusion of StyleSheets/Scripts for Plugin Resources
This commit is contained in:
@@ -13,18 +13,18 @@ namespace Disco.Services.Plugins.Features.UIExtension.Results
|
||||
public class PluginResourceCssResult : UIExtensionResult
|
||||
{
|
||||
private string _resource;
|
||||
private HtmlString _resourceUrl;
|
||||
private string _resourceUrl;
|
||||
|
||||
public PluginResourceCssResult(PluginFeatureManifest Source, string Resource)
|
||||
: base(Source)
|
||||
{
|
||||
this._resource = Resource;
|
||||
this._resourceUrl = new HtmlString(Source.PluginManifest.WebResourceUrl(Resource));
|
||||
this._resourceUrl = Source.PluginManifest.WebResourceUrl(Resource);
|
||||
|
||||
var deferredBundles = HttpContext.Current.Items[Bundle.UIExtensionCssKey] as List<HtmlString>;
|
||||
var deferredBundles = HttpContext.Current.Items[Bundle.UIExtensionCssKey] as List<string>;
|
||||
if (deferredBundles == null)
|
||||
{
|
||||
deferredBundles = new List<HtmlString>();
|
||||
deferredBundles = new List<string>();
|
||||
HttpContext.Current.Items[Bundle.UIExtensionCssKey] = deferredBundles;
|
||||
}
|
||||
if (!deferredBundles.Contains(this._resourceUrl))
|
||||
|
||||
@@ -11,22 +11,22 @@ namespace Disco.Services.Plugins.Features.UIExtension.Results
|
||||
public class PluginResourceScriptResult : UIExtensionResult
|
||||
{
|
||||
private string _resource;
|
||||
private HtmlString _resourceUrl;
|
||||
private string _resourceUrl;
|
||||
private bool _placeInPageHead;
|
||||
|
||||
public PluginResourceScriptResult(PluginFeatureManifest Source, string Resource, bool PlaceInPageHead)
|
||||
: base(Source)
|
||||
{
|
||||
this._resource = Resource;
|
||||
this._resourceUrl = new HtmlString(Source.PluginManifest.WebResourceUrl(Resource));
|
||||
this._resourceUrl = Source.PluginManifest.WebResourceUrl(Resource);
|
||||
this._placeInPageHead = PlaceInPageHead;
|
||||
|
||||
if (this._placeInPageHead)
|
||||
{
|
||||
var deferredBundles = HttpContext.Current.Items[Bundle.UIExtensionScriptsKey] as List<HtmlString>;
|
||||
var deferredBundles = HttpContext.Current.Items[Bundle.UIExtensionScriptsKey] as List<string>;
|
||||
if (deferredBundles == null)
|
||||
{
|
||||
deferredBundles = new List<HtmlString>();
|
||||
deferredBundles = new List<string>();
|
||||
HttpContext.Current.Items[Bundle.UIExtensionScriptsKey] = deferredBundles;
|
||||
}
|
||||
if (!deferredBundles.Contains(this._resourceUrl))
|
||||
|
||||
Reference in New Issue
Block a user