Skip to content

Commit 26e01f7

Browse files
Upgrade OC (#20)
1 parent 5acc080 commit 26e01f7

File tree

8 files changed

+70
-49
lines changed

8 files changed

+70
-49
lines changed

Common.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<VersionSuffix Condition="'$(VersionSuffix)'!='' AND '$(GITHUB_RUN_ID)' != ''">$(VersionSuffix)-$(GITHUB_RUN_ID)</VersionSuffix>
99
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1010
<NoWarn>$(NoWarn);CS1591</NoWarn>
11-
<TargetFramework>netcoreapp3.1</TargetFramework>
1211
<LangVersion>Latest</LangVersion>
1312
<DebugType>portable</DebugType>
1413
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>

Directory.Build.targets

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<Project>
22

33
<ItemGroup>
4-
<PackageReference Update="OrchardCore.Admin.Abstractions" Version="1.0.0-rc2-15621" />
5-
<PackageReference Update="OrchardCore.Application.Cms.Targets" Version="1.0.0-rc2-15621" />
6-
<PackageReference Update="OrchardCore.ContentFields" Version="1.0.0-rc2-15621" />
7-
<PackageReference Update="OrchardCore.ContentLocalization.Abstractions" Version="1.0.0-rc2-15621"/>
8-
<PackageReference Update="OrchardCore.Data.Abstractions" Version="1.0.0-rc2-15621"/>
9-
<PackageReference Update="OrchardCore.Deployment.Abstractions" Version="1.0.0-rc2-15621" />
10-
<PackageReference Update="OrchardCore.Html" Version="1.0.0-rc2-15621" />
11-
<PackageReference Update="OrchardCore.Logging.NLog" Version="1.0.0-rc2-15621" />
12-
<PackageReference Update="OrchardCore.Module.Targets" Version="1.0.0-rc2-15621" />
13-
<PackageReference Update="OrchardCore.Navigation.Core" Version="1.0.0-rc2-15621" />
14-
<PackageReference Update="OrchardCore.Recipes.Abstractions" Version="1.0.0-rc2-15621" />
15-
<PackageReference Update="OrchardCore.ResourceManagement" Version="1.0.0-rc2-15621" />
4+
<PackageReference Update="OrchardCore.Admin.Abstractions" Version="1.0.0-rc2-16154" />
5+
<PackageReference Update="OrchardCore.Application.Cms.Targets" Version="1.0.0-rc2-16154" />
6+
<PackageReference Update="OrchardCore.ContentFields" Version="1.0.0-rc2-16154" />
7+
<PackageReference Update="OrchardCore.ContentLocalization.Abstractions" Version="1.0.0-rc2-16154"/>
8+
<PackageReference Update="OrchardCore.Data.Abstractions" Version="1.0.0-rc2-16154"/>
9+
<PackageReference Update="OrchardCore.Deployment.Abstractions" Version="1.0.0-rc2-16154" />
10+
<PackageReference Update="OrchardCore.Html" Version="1.0.0-rc2-16154" />
11+
<PackageReference Update="OrchardCore.Logging.NLog" Version="1.0.0-rc2-16154" />
12+
<PackageReference Update="OrchardCore.Module.Targets" Version="1.0.0-rc2-16154" />
13+
<PackageReference Update="OrchardCore.Navigation.Core" Version="1.0.0-rc2-16154" />
14+
<PackageReference Update="OrchardCore.Recipes.Abstractions" Version="1.0.0-rc2-16154" />
15+
<PackageReference Update="OrchardCore.ResourceManagement" Version="1.0.0-rc2-16154" />
1616
</ItemGroup>
1717
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using Microsoft.Extensions.Options;
2+
using OrchardCore.ResourceManagement;
3+
4+
namespace ThisNetWorks.OrchardCore.CKEditor.Sample.Web.ResourceManifests
5+
{
6+
/// <summary>
7+
/// This is an example of how to override the admin css
8+
/// We register existing adminstyles under an unused style name, set the corrected dependencies
9+
/// Then register admin with our own style sheet, and take a dependency on the newly defined theadmin stylesheet.
10+
/// </summary>
11+
public class CKEditorTheAdminResourceManagementOptionsConfiguration : IConfigureOptions<ResourceManagementOptions>
12+
{
13+
private static ResourceManifest _theAdminManifest;
14+
private static ResourceManifest _adminManifest;
15+
16+
static CKEditorTheAdminResourceManagementOptionsConfiguration()
17+
{
18+
_theAdminManifest = new ResourceManifest();
19+
20+
_theAdminManifest
21+
.DefineStyle("theadmin")
22+
.SetUrl("~/TheAdmin/Styles/TheAdmin.min.css", "~/TheAdmin/Styles/TheAdmin.css")
23+
.SetDependencies("jQuery-ui");
24+
25+
_adminManifest = new ResourceManifest();
26+
27+
_adminManifest
28+
.DefineStyle("admin")
29+
.SetUrl("~/styles/CKEditorAdminStyles.css", "~/styles/CKEditorAdminStyles.css")
30+
.SetDependencies("theadmin");
31+
}
32+
33+
public void Configure(ResourceManagementOptions options)
34+
{
35+
options.ResourceManifests.Add(_theAdminManifest);
36+
options.ResourceManifests.Add(_adminManifest);
37+
}
38+
}
39+
}

samples/ThisNetWorks.OrchardCore.CKEditor.Sample.Web/ResourceManifests/CKEditorTheAdminResourceManifest.cs

Lines changed: 0 additions & 27 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
1+
using Microsoft.Extensions.Options;
12
using OrchardCore.ResourceManagement;
23

3-
namespace ThisNetWorks.OrchardCore.CKEditor.Sample.web.ResourceManifests
4+
namespace ThisNetWorks.OrchardCore.CKEditor.Sample.Web.ResourceManifests
45
{
56
/// <summary>
67
/// This is an example of how to override the <script asp-name="ckeditorclassic"> tag helper
78
/// Register this class as an IResourceManifestProvider with the urls to your custom build of CKEditor and it will replace the default custom build.
89
/// </summary>
9-
public class ClassicEditorResourceManifest : IResourceManifestProvider
10+
public class ClassicEditorResourceManagementOptionsConfiguration : IConfigureOptions<ResourceManagementOptions>
1011
{
11-
public void BuildManifests(IResourceManifestBuilder builder)
12+
private static ResourceManifest _manifest;
13+
14+
static ClassicEditorResourceManagementOptionsConfiguration()
1215
{
13-
var manifest = builder.Add();
16+
_manifest = new ResourceManifest();
1417

15-
manifest
18+
_manifest
1619
.DefineScript("CKEditorClassic")
1720
.SetUrl("https://cdn.ckeditor.com/ckeditor5/20.0.0/classic/ckeditor.js")
1821
.SetCdn("https://cdn.ckeditor.com/ckeditor5/20.0.0/classic/ckeditor.js", "https://cdn.ckeditor.com/ckeditor5/20.0.0/classic/ckeditor.js")
1922
.SetVersion("20.0.0");
23+
24+
}
25+
26+
public void Configure(ResourceManagementOptions options)
27+
{
28+
options.ResourceManifests.Add(_manifest);
2029
}
2130
}
2231
}

samples/ThisNetWorks.OrchardCore.CKEditor.Sample.Web/Startup.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Microsoft.AspNetCore.Builder;
22
using Microsoft.Extensions.DependencyInjection;
33
using Microsoft.Extensions.Hosting;
4+
using Microsoft.Extensions.Options;
45
using OrchardCore.ResourceManagement;
56
using ThisNetWorks.OrchardCore.CKEditor.Sample.Web.ResourceManifests;
67

@@ -14,10 +15,10 @@ public void ConfigureServices(IServiceCollection services)
1415

1516
/// This is an example of how to override the <script asp-name="ckeditorclassic"> tag helper
1617
/// Register a IResourceManifestProvider with the urls to your custom build of CKEditor and it will replace the default custom build registration in the editor view.
17-
// .ConfigureServices(tenantServices => tenantServices.AddScoped<IResourceManifestProvider, ClassicEditorResourceManifest>())
18+
.ConfigureServices(tenantServices => tenantServices.AddTransient<IConfigureOptions<ResourceManagementOptions>, ClassicEditorResourceManagementOptionsConfiguration>())
1819

1920
// This registers a custom style sheet for the admin with some specific styles for using in the CKEditor with a custom paragraph / heading toolbar.
20-
.ConfigureServices(tenantServices => tenantServices.AddScoped<IResourceManifestProvider, CKEditorTheAdminResourceManifest>())
21+
.ConfigureServices(tenantServices => tenantServices.AddTransient<IConfigureOptions<ResourceManagementOptions>, CKEditorTheAdminResourceManagementOptionsConfiguration>())
2122
;
2223
}
2324

samples/ThisNetWorks.OrchardCore.CKEditor.Sample.Web/ThisNetWorks.OrchardCore.CKEditor.Sample.Web.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net5.0</TargetFramework>
55
<TieredCompilation>true</TieredCompilation>
66
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
77
<PreserveCompilationReferences>true</PreserveCompilationReferences>

src/ThisNetWorks.OrchardCore.CKEditor/ThisNetWorks.OrchardCore.CKEditor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFrameworks>net5.0;netcoreapp3.1</TargetFrameworks>
55
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
66
</PropertyGroup>
77

0 commit comments

Comments
 (0)