mirror of https://github.com/abpframework/abp.git
8 changed files with 144 additions and 17 deletions
@ -0,0 +1,31 @@ |
|||
using System; |
|||
using System.Collections.Concurrent; |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling |
|||
{ |
|||
public class BundleContributorOptions |
|||
{ |
|||
public ConcurrentDictionary<Type, BundleContributorCollection> AllExtensions { get; } |
|||
|
|||
public BundleContributorOptions() |
|||
{ |
|||
AllExtensions = new ConcurrentDictionary<Type, BundleContributorCollection>(); |
|||
} |
|||
|
|||
public BundleContributorCollection Extensions<TContributor>() |
|||
{ |
|||
return Extensions(typeof(TContributor)); |
|||
} |
|||
|
|||
public BundleContributorCollection Extensions([NotNull] Type contributorType) |
|||
{ |
|||
Check.NotNull(contributorType, nameof(contributorType)); |
|||
|
|||
return AllExtensions.GetOrAdd( |
|||
contributorType, |
|||
_ => new BundleContributorCollection() |
|||
); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Prismjs |
|||
{ |
|||
public class PrismjsStyleBundleContributor : BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.AddIfNotContains("/libs/prismjs/themes/prism-okaidia.css"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
|
|||
namespace Volo.Docs.Bundling |
|||
{ |
|||
public class PrismjsScriptBundleContributorDocsExtension : BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.AddIfNotContains("/libs/prismjs/plugins/toolbar/prism-toolbar.js"); |
|||
context.Files.AddIfNotContains("/libs/prismjs/plugins/show-language/prism-show-language.js"); |
|||
context.Files.AddIfNotContains("/libs/prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard.js"); |
|||
context.Files.AddIfNotContains("/libs/prismjs/plugins/line-highlight/prism-line-highlight.js"); |
|||
context.Files.AddIfNotContains("/libs/prismjs/components/prism-csharp.js"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
|
|||
namespace Volo.Docs.Bundling |
|||
{ |
|||
public class PrismjsStyleBundleContributorDocsExtension : BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.AddIfNotContains("/libs/prismjs/plugins/line-highlight/prism-line-highlight.css"); |
|||
context.Files.AddIfNotContains("/libs/prismjs/plugins/toolbar/prism-toolbar.css"); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue