diff --git a/src/Umbraco.Configuration/Models/HostingSettings.cs b/src/Umbraco.Configuration/Models/HostingSettings.cs
index 4a156cee6a..7cfc08d2d4 100644
--- a/src/Umbraco.Configuration/Models/HostingSettings.cs
+++ b/src/Umbraco.Configuration/Models/HostingSettings.cs
@@ -22,6 +22,6 @@ namespace Umbraco.Configuration.Models
/// Gets a value indicating whether umbraco is running in [debug mode].
///
/// true if [debug mode]; otherwise, false.
- public bool DebugMode => _configuration.GetValue(Prefix+":Debug", false);
+ public bool DebugMode => _configuration.GetValue(Prefix+"Debug", false);
}
}
diff --git a/src/Umbraco.Core/CompositionExtensions.cs b/src/Umbraco.Core/CompositionExtensions.cs
index bea78f82ed..a16abf76ac 100644
--- a/src/Umbraco.Core/CompositionExtensions.cs
+++ b/src/Umbraco.Core/CompositionExtensions.cs
@@ -1,6 +1,13 @@
using Umbraco.Core.Composing;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Web.Actions;
+using Umbraco.Web.ContentApps;
using Umbraco.Web.Dashboards;
+using Umbraco.Web.Editors;
+using Umbraco.Web.HealthCheck;
+using Umbraco.Web.Routing;
+using Umbraco.Web.Sections;
+using Umbraco.Web.Tour;
namespace Umbraco.Core
{
@@ -9,6 +16,72 @@ namespace Umbraco.Core
#region Collection Builders
+ ///
+ /// Gets the actions collection builder.
+ ///
+ /// The composition.
+ ///
+ internal static ActionCollectionBuilder Actions(this Composition composition)
+ => composition.WithCollectionBuilder();
+
+ ///
+ /// Gets the content apps collection builder.
+ ///
+ /// The composition.
+ ///
+ public static ContentAppFactoryCollectionBuilder ContentApps(this Composition composition)
+ => composition.WithCollectionBuilder();
+
+ ///
+ /// Gets the content finders collection builder.
+ ///
+ /// The composition.
+ ///
+ public static ContentFinderCollectionBuilder ContentFinders(this Composition composition)
+ => composition.WithCollectionBuilder();
+
+ ///
+ /// Gets the editor validators collection builder.
+ ///
+ /// The composition.
+ ///
+ internal static EditorValidatorCollectionBuilder EditorValidators(this Composition composition)
+ => composition.WithCollectionBuilder();
+
+ ///
+ /// Gets the health checks collection builder.
+ ///
+ /// The composition.
+ public static HealthCheckCollectionBuilder HealthChecks(this Composition composition)
+ => composition.WithCollectionBuilder();
+
+ ///
+ /// Gets the TourFilters collection builder.
+ ///
+ public static TourFilterCollectionBuilder TourFilters(this Composition composition)
+ => composition.WithCollectionBuilder();
+
+ ///
+ /// Gets the url providers collection builder.
+ ///
+ /// The composition.
+ public static UrlProviderCollectionBuilder UrlProviders(this Composition composition)
+ => composition.WithCollectionBuilder();
+
+ ///
+ /// Gets the media url providers collection builder.
+ ///
+ /// The composition.
+ public static MediaUrlProviderCollectionBuilder MediaUrlProviders(this Composition composition)
+ => composition.WithCollectionBuilder();
+
+ ///
+ /// Gets the backoffice sections/applications collection builder.
+ ///
+ /// The composition.
+ public static SectionCollectionBuilder Sections(this Composition composition)
+ => composition.WithCollectionBuilder();
+
///
/// Gets the components collection builder.
///
diff --git a/src/Umbraco.Web/HybridUmbracoContextAccessor.cs b/src/Umbraco.Core/HybridUmbracoContextAccessor.cs
similarity index 87%
rename from src/Umbraco.Web/HybridUmbracoContextAccessor.cs
rename to src/Umbraco.Core/HybridUmbracoContextAccessor.cs
index bb8e2d6993..1ad4777460 100644
--- a/src/Umbraco.Web/HybridUmbracoContextAccessor.cs
+++ b/src/Umbraco.Core/HybridUmbracoContextAccessor.cs
@@ -5,7 +5,7 @@ namespace Umbraco.Web
///
/// Implements a hybrid .
///
- internal class HybridUmbracoContextAccessor : HybridAccessorBase, IUmbracoContextAccessor
+ public class HybridUmbracoContextAccessor : HybridAccessorBase, IUmbracoContextAccessor
{
///
/// Initializes a new instance of the class.
diff --git a/src/Umbraco.Core/Runtime/IRuntimeMinifier.cs b/src/Umbraco.Core/Runtime/IRuntimeMinifier.cs
index 53d9bda179..b76f2007b6 100644
--- a/src/Umbraco.Core/Runtime/IRuntimeMinifier.cs
+++ b/src/Umbraco.Core/Runtime/IRuntimeMinifier.cs
@@ -1,6 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Web;
+using System.Collections.Generic;
+using System.Threading.Tasks;
using Umbraco.Core.Assets;
namespace Umbraco.Core.Runtime
@@ -10,23 +9,23 @@ namespace Umbraco.Core.Runtime
string GetHashValue { get; }
//return type HtmlHelper
- void RequiresCss(string filePath, string bundleName);
+ void RequiresCss(string bundleName, params string[] filePaths);
//return type IHtmlString
//IClientDependencyPath[]
string RenderCssHere(string bundleName);
// return type HtmlHelper
- void RequiresJs(string filePath, string bundleName);
+ void RequiresJs(string bundleName, params string[] filePaths);
// return type IHtmlString
string RenderJsHere(string bundleName);
- IEnumerable GetAssetPaths(AssetType assetType, List attributes);
+ Task> GetAssetPathsAsync(AssetType assetType, List attributes);
- string Minify(string src, AssetType assetType);
+ Task MinifyAsync(string fileContent, AssetType assetType);
void Reset();
- string GetScriptForBackOffice();
- IEnumerable GetAssetList();
+ Task GetScriptForBackOfficeAsync();
+ Task> GetAssetListAsync();
}
}
diff --git a/src/Umbraco.Infrastructure/Models/ImageProcessorImageUrlGenerator.cs b/src/Umbraco.Infrastructure/Models/ImageSharpImageUrlGenerator.cs
similarity index 98%
rename from src/Umbraco.Infrastructure/Models/ImageProcessorImageUrlGenerator.cs
rename to src/Umbraco.Infrastructure/Models/ImageSharpImageUrlGenerator.cs
index f88309d7e3..72652ab236 100644
--- a/src/Umbraco.Infrastructure/Models/ImageProcessorImageUrlGenerator.cs
+++ b/src/Umbraco.Infrastructure/Models/ImageSharpImageUrlGenerator.cs
@@ -5,7 +5,7 @@ using Umbraco.Core.Models;
namespace Umbraco.Web.Models
{
- public class ImageProcessorImageUrlGenerator : IImageUrlGenerator
+ public class ImageSharpImageUrlGenerator : IImageUrlGenerator
{
public string GetImageUrl(ImageUrlGenerationOptions options)
{
diff --git a/src/Umbraco.Web/JavaScript/AssetInitialization.cs b/src/Umbraco.Infrastructure/RuntimeMinification/AssetInitialization.cs
similarity index 52%
rename from src/Umbraco.Web/JavaScript/AssetInitialization.cs
rename to src/Umbraco.Infrastructure/RuntimeMinification/AssetInitialization.cs
index e80fd5e7d7..74931dff54 100644
--- a/src/Umbraco.Web/JavaScript/AssetInitialization.cs
+++ b/src/Umbraco.Infrastructure/RuntimeMinification/AssetInitialization.cs
@@ -1,34 +1,34 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq;
-using System.Web;
+using System.Threading.Tasks;
using Umbraco.Core;
using Umbraco.Core.Assets;
+using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Runtime;
-using Umbraco.Web.Composing;
using Umbraco.Web.PropertyEditors;
namespace Umbraco.Web.JavaScript
{
- internal abstract class AssetInitialization
+ public abstract class AssetInitialization
{
private readonly IRuntimeMinifier _runtimeMinifier;
+ private readonly PropertyEditorCollection _propertyEditorCollection;
- public AssetInitialization(IRuntimeMinifier runtimeMinifier)
+ public AssetInitialization(IRuntimeMinifier runtimeMinifier, PropertyEditorCollection propertyEditorCollection)
{
_runtimeMinifier = runtimeMinifier;
+ _propertyEditorCollection = propertyEditorCollection;
}
- protected IEnumerable ScanPropertyEditors(AssetType assetType, HttpContextBase httpContext)
+ protected async Task> ScanPropertyEditorsAsync(AssetType assetType)
{
- if (httpContext == null) throw new ArgumentNullException(nameof(httpContext));
- var attributes = Current.PropertyEditors
+ var attributes = _propertyEditorCollection
.SelectMany(x => x.GetType().GetCustomAttributes(false))
.Where(x => x.AssetType == assetType)
.Select(x => x.DependencyFile)
.ToList();
- return _runtimeMinifier.GetAssetPaths(assetType, attributes);
+ return await _runtimeMinifier.GetAssetPathsAsync(assetType, attributes);
}
}
}
diff --git a/src/Umbraco.Web/JavaScript/CssInitialization.cs b/src/Umbraco.Infrastructure/RuntimeMinification/CssInitialization.cs
similarity index 59%
rename from src/Umbraco.Web/JavaScript/CssInitialization.cs
rename to src/Umbraco.Infrastructure/RuntimeMinification/CssInitialization.cs
index 76b42e336e..000079de5b 100644
--- a/src/Umbraco.Web/JavaScript/CssInitialization.cs
+++ b/src/Umbraco.Infrastructure/RuntimeMinification/CssInitialization.cs
@@ -2,19 +2,25 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Threading.Tasks;
using System.Web;
using Umbraco.Core.Assets;
using Umbraco.Core.Manifest;
+using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Runtime;
namespace Umbraco.Web.JavaScript
{
- internal class CssInitialization : AssetInitialization
+ public class CssInitialization : AssetInitialization
{
private readonly IManifestParser _parser;
private readonly IRuntimeMinifier _runtimeMinifier;
- public CssInitialization(IManifestParser parser, IRuntimeMinifier runtimeMinifier) : base(runtimeMinifier)
+ public CssInitialization(
+ IManifestParser parser,
+ IRuntimeMinifier runtimeMinifier,
+ PropertyEditorCollection propertyEditorCollection)
+ : base(runtimeMinifier, propertyEditorCollection)
{
_parser = parser;
_runtimeMinifier = runtimeMinifier;
@@ -23,20 +29,20 @@ namespace Umbraco.Web.JavaScript
///
/// Processes all found manifest files, and outputs css inject calls for all css files found in all manifests.
///
- public string GetStylesheetInitialization(HttpContextBase httpContext)
+ public async Task GetStylesheetInitializationAsync(Uri requestUrl)
{
- var files = GetStylesheetFiles(httpContext);
+ var files = await GetStylesheetFilesAsync(requestUrl);
return WriteScript(files);
}
- public IEnumerable GetStylesheetFiles(HttpContextBase httpContext)
+ public async Task> GetStylesheetFilesAsync(Uri requestUrl)
{
var stylesheets = new HashSet();
- var optimizedManifest = JavaScriptHelper.OptimizeAssetCollection(_parser.Manifest.Stylesheets, AssetType.Css, httpContext, _runtimeMinifier);
+ var optimizedManifest = await JavaScriptHelper.OptimizeAssetCollectionAsync(_parser.Manifest.Stylesheets, AssetType.Css, requestUrl, _runtimeMinifier);
foreach (var stylesheet in optimizedManifest)
stylesheets.Add(stylesheet);
- foreach (var stylesheet in ScanPropertyEditors(AssetType.Css, httpContext))
+ foreach (var stylesheet in await ScanPropertyEditorsAsync(AssetType.Css))
stylesheets.Add(stylesheet);
return stylesheets.ToArray();
diff --git a/src/Umbraco.Web/JavaScript/JavaScriptHelper.cs b/src/Umbraco.Infrastructure/RuntimeMinification/JavaScriptHelper.cs
similarity index 76%
rename from src/Umbraco.Web/JavaScript/JavaScriptHelper.cs
rename to src/Umbraco.Infrastructure/RuntimeMinification/JavaScriptHelper.cs
index 3ee6767b68..0862fd23a5 100644
--- a/src/Umbraco.Web/JavaScript/JavaScriptHelper.cs
+++ b/src/Umbraco.Infrastructure/RuntimeMinification/JavaScriptHelper.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
-using System.Web;
+using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core;
@@ -11,6 +11,7 @@ using Umbraco.Core.Assets;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Core.Runtime;
+using Umbraco.Infrastructure.RuntimeMinification;
namespace Umbraco.Web.JavaScript
{
@@ -28,13 +29,12 @@ namespace Umbraco.Web.JavaScript
///
/// Gets the JS initialization script to boot the back office application
///
- ///
///
///
/// The angular module name to boot
///
///
- public static string GetJavascriptInitialization(HttpContextBase httpContext, IEnumerable scripts, string angularModule, IGlobalSettings globalSettings, IIOHelper ioHelper)
+ public static string GetJavascriptInitialization(IEnumerable scripts, string angularModule, IGlobalSettings globalSettings, IIOHelper ioHelper)
{
var jarray = new StringBuilder();
jarray.AppendLine("[");
@@ -80,9 +80,9 @@ namespace Umbraco.Web.JavaScript
return resources.Where(x => x.Type == JTokenType.String).Select(x => x.ToString());
}
- internal static IEnumerable OptimizeTinyMceScriptFiles(HttpContextBase httpContext, IRuntimeMinifier runtimeMinifier)
+ public static async Task> OptimizeTinyMceScriptFilesAsync(Uri requestUrl, IRuntimeMinifier runtimeMinifier)
{
- return OptimizeScriptFiles(httpContext, GetTinyMceInitialization(), runtimeMinifier);
+ return await OptimizeScriptFilesAsync(requestUrl, GetTinyMceInitialization(), runtimeMinifier);
}
@@ -90,7 +90,7 @@ namespace Umbraco.Web.JavaScript
/// Returns the default config as a JArray
///
///
- internal static IEnumerable GetPreviewInitialization()
+ public static IEnumerable GetPreviewInitialization()
{
var resources = JsonConvert.DeserializeObject(Resources.PreviewInitialize);
return resources.Where(x => x.Type == JTokenType.String).Select(x => x.ToString());
@@ -100,30 +100,27 @@ namespace Umbraco.Web.JavaScript
///
/// Returns a list of optimized script paths
///
- ///
+ ///
///
///
///
///
/// Used to cache bust and optimize script paths
///
- public static IEnumerable OptimizeScriptFiles(HttpContextBase httpContext, IEnumerable scriptFiles, IRuntimeMinifier runtimeMinifier)
+ public static async Task> OptimizeScriptFilesAsync(Uri requestUrl, IEnumerable scriptFiles, IRuntimeMinifier runtimeMinifier)
{
var scripts = new HashSet();
foreach (var script in scriptFiles)
scripts.Add(script);
- scripts = new HashSet(OptimizeAssetCollection(scripts, AssetType.Javascript, httpContext, runtimeMinifier));
+ scripts = new HashSet(await OptimizeAssetCollectionAsync(scripts, AssetType.Javascript, requestUrl, runtimeMinifier));
return scripts.ToArray();
}
- internal static IEnumerable OptimizeAssetCollection(IEnumerable assets, AssetType assetType, HttpContextBase httpContext, IRuntimeMinifier runtimeMinifier)
+ internal static async Task> OptimizeAssetCollectionAsync(IEnumerable assets, AssetType assetType, Uri requestUrl, IRuntimeMinifier runtimeMinifier)
{
- if (httpContext == null) throw new ArgumentNullException(nameof(httpContext));
-
- var requestUrl = httpContext.Request.Url;
- if (requestUrl == null) throw new ArgumentException("HttpContext.Request.Url is null.", nameof(httpContext));
+ if (requestUrl == null) throw new ArgumentNullException(nameof(requestUrl));
var dependencies = assets.Where(x => x.IsNullOrWhiteSpace() == false).Select(x =>
{
@@ -140,7 +137,7 @@ namespace Umbraco.Web.JavaScript
}).ToList();
- return runtimeMinifier.GetAssetPaths(assetType, dependencies);;
+ return await runtimeMinifier.GetAssetPathsAsync(assetType, dependencies);
}
}
}
diff --git a/src/Umbraco.Web/JavaScript/JsInitialization.cs b/src/Umbraco.Infrastructure/RuntimeMinification/JsInitialization.cs
similarity index 68%
rename from src/Umbraco.Web/JavaScript/JsInitialization.cs
rename to src/Umbraco.Infrastructure/RuntimeMinification/JsInitialization.cs
index 3183ae03c2..f32d5c6c92 100644
--- a/src/Umbraco.Web/JavaScript/JsInitialization.cs
+++ b/src/Umbraco.Infrastructure/RuntimeMinification/JsInitialization.cs
@@ -1,11 +1,14 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Linq;
-using System.Web;
+using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core.Assets;
using Umbraco.Core.Manifest;
+using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Runtime;
+using Umbraco.Infrastructure.RuntimeMinification;
namespace Umbraco.Web.JavaScript
{
@@ -13,12 +16,12 @@ namespace Umbraco.Web.JavaScript
/// Reads from all defined manifests and ensures that any of their initialization is output with the
/// main Umbraco initialization output.
///
- internal class JsInitialization : AssetInitialization
+ public class JsInitialization : AssetInitialization
{
private readonly IManifestParser _parser;
private readonly IRuntimeMinifier _runtimeMinifier;
- public JsInitialization(IManifestParser parser, IRuntimeMinifier runtimeMinifier) : base(runtimeMinifier)
+ public JsInitialization(IManifestParser parser, IRuntimeMinifier runtimeMinifier, PropertyEditorCollection propertyEditorCollection) : base(runtimeMinifier, propertyEditorCollection)
{
_parser = parser;
_runtimeMinifier = runtimeMinifier;
@@ -27,7 +30,7 @@ namespace Umbraco.Web.JavaScript
///
/// Returns a list of optimized script paths for the back office
///
- ///
+ ///
///
///
///
@@ -36,7 +39,7 @@ namespace Umbraco.Web.JavaScript
///
/// Used to cache bust and optimize script paths for the back office
///
- public IEnumerable OptimizeBackOfficeScriptFiles(HttpContextBase httpContext, IEnumerable umbracoInit, IEnumerable additionalJsFiles = null)
+ public async Task> OptimizeBackOfficeScriptFilesAsync(Uri requestUrl, IEnumerable umbracoInit, IEnumerable additionalJsFiles = null)
{
var scripts = new HashSet();
foreach (var script in umbracoInit)
@@ -47,9 +50,9 @@ namespace Umbraco.Web.JavaScript
foreach (var script in additionalJsFiles)
scripts.Add(script);
- scripts = new HashSet(JavaScriptHelper.OptimizeAssetCollection(scripts, AssetType.Javascript, httpContext, _runtimeMinifier));
+ scripts = new HashSet(await JavaScriptHelper.OptimizeAssetCollectionAsync(scripts, AssetType.Javascript, requestUrl, _runtimeMinifier));
- foreach (var script in ScanPropertyEditors(AssetType.Javascript, httpContext))
+ foreach (var script in await ScanPropertyEditorsAsync(AssetType.Javascript))
scripts.Add(script);
return scripts.ToArray();
@@ -59,7 +62,7 @@ namespace Umbraco.Web.JavaScript
/// Returns the default config as a JArray
///
///
- internal static IEnumerable GetDefaultInitialization()
+ public static IEnumerable GetDefaultInitialization()
{
var resources = JsonConvert.DeserializeObject(Resources.JsInitialize);
return resources.Where(x => x.Type == JTokenType.String).Select(x => x.ToString());
diff --git a/src/Umbraco.Web/JavaScript/JsInitialize.js b/src/Umbraco.Infrastructure/RuntimeMinification/JsInitialize.js
similarity index 100%
rename from src/Umbraco.Web/JavaScript/JsInitialize.js
rename to src/Umbraco.Infrastructure/RuntimeMinification/JsInitialize.js
diff --git a/src/Umbraco.Web/JavaScript/Main.js b/src/Umbraco.Infrastructure/RuntimeMinification/Main.js
similarity index 100%
rename from src/Umbraco.Web/JavaScript/Main.js
rename to src/Umbraco.Infrastructure/RuntimeMinification/Main.js
diff --git a/src/Umbraco.Web/JavaScript/PreviewInitialize.js b/src/Umbraco.Infrastructure/RuntimeMinification/PreviewInitialize.js
similarity index 100%
rename from src/Umbraco.Web/JavaScript/PreviewInitialize.js
rename to src/Umbraco.Infrastructure/RuntimeMinification/PreviewInitialize.js
diff --git a/src/Umbraco.Web/PropertyEditors/PropertyEditorAssetAttribute.cs b/src/Umbraco.Infrastructure/RuntimeMinification/PropertyEditorAssetAttribute.cs
similarity index 100%
rename from src/Umbraco.Web/PropertyEditors/PropertyEditorAssetAttribute.cs
rename to src/Umbraco.Infrastructure/RuntimeMinification/PropertyEditorAssetAttribute.cs
diff --git a/src/Umbraco.Web/JavaScript/Resources.Designer.cs b/src/Umbraco.Infrastructure/RuntimeMinification/Resources.Designer.cs
similarity index 84%
rename from src/Umbraco.Web/JavaScript/Resources.Designer.cs
rename to src/Umbraco.Infrastructure/RuntimeMinification/Resources.Designer.cs
index f11839f6ca..8653210a9d 100644
--- a/src/Umbraco.Web/JavaScript/Resources.Designer.cs
+++ b/src/Umbraco.Infrastructure/RuntimeMinification/Resources.Designer.cs
@@ -8,7 +8,7 @@
//
//------------------------------------------------------------------------------
-namespace Umbraco.Web.JavaScript {
+namespace Umbraco.Infrastructure.RuntimeMinification {
using System;
@@ -19,7 +19,7 @@ namespace Umbraco.Web.JavaScript {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@@ -39,7 +39,7 @@ namespace Umbraco.Web.JavaScript {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Umbraco.Web.JavaScript.Resources", typeof(Resources).Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Umbraco.Infrastructure.RuntimeMinification.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -76,9 +76,9 @@ namespace Umbraco.Web.JavaScript {
///
/// 'lib/angular-route/angular-route.js',
/// 'lib/angular-cookies/angular-cookies.js',
+ /// 'lib/angular-aria/angular-aria.min.js',
/// 'lib/angular-touch/angular-touch.js',
- /// 'lib/angular-sanitize/angular-sanitize.js',
- /// 'lib/an [rest of string was truncated]";.
+ /// 'lib/angula [rest of string was truncated]";.
///
internal static string JsInitialize {
get {
@@ -149,9 +149,18 @@ namespace Umbraco.Web.JavaScript {
///
/// Looks up a localized string similar to [
- /// '../lib/tinymce/tinymce.min.js',
- ///]
- ///.
+ /// 'lib/tinymce/tinymce.min.js',
+ ///
+ /// 'lib/tinymce/plugins/paste/plugin.min.js',
+ /// 'lib/tinymce/plugins/anchor/plugin.min.js',
+ /// 'lib/tinymce/plugins/charmap/plugin.min.js',
+ /// 'lib/tinymce/plugins/table/plugin.min.js',
+ /// 'lib/tinymce/plugins/lists/plugin.min.js',
+ /// 'lib/tinymce/plugins/advlist/plugin.min.js',
+ /// 'lib/tinymce/plugins/hr/plugin.min.js',
+ /// 'lib/tinymce/plugins/autolink/plugin.min.js',
+ /// 'lib/tinymce/plugins/directionality/plugin.min.js',
+ /// 'lib/tinymce/plugins/t [rest of string was truncated]";.
///
internal static string TinyMceInitialize {
get {
diff --git a/src/Umbraco.Infrastructure/RuntimeMinification/Resources.resx b/src/Umbraco.Infrastructure/RuntimeMinification/Resources.resx
new file mode 100644
index 0000000000..e51c3b9d92
--- /dev/null
+++ b/src/Umbraco.Infrastructure/RuntimeMinification/Resources.resx
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ jsinitialize.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8
+
+
+ Main.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
+
+
+ previewinitialize.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8
+
+
+ servervariables.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8
+
+
+ TinyMceInitialize.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8
+
+
diff --git a/src/Umbraco.Web/JavaScript/ServerVariables.js b/src/Umbraco.Infrastructure/RuntimeMinification/ServerVariables.js
similarity index 100%
rename from src/Umbraco.Web/JavaScript/ServerVariables.js
rename to src/Umbraco.Infrastructure/RuntimeMinification/ServerVariables.js
diff --git a/src/Umbraco.Web/JavaScript/ServerVariablesParser.cs b/src/Umbraco.Infrastructure/RuntimeMinification/ServerVariablesParser.cs
similarity index 85%
rename from src/Umbraco.Web/JavaScript/ServerVariablesParser.cs
rename to src/Umbraco.Infrastructure/RuntimeMinification/ServerVariablesParser.cs
index 8f27f58143..38669c166c 100644
--- a/src/Umbraco.Web/JavaScript/ServerVariablesParser.cs
+++ b/src/Umbraco.Infrastructure/RuntimeMinification/ServerVariablesParser.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
+using Umbraco.Infrastructure.RuntimeMinification;
namespace Umbraco.Web.JavaScript
{
@@ -13,7 +14,7 @@ namespace Umbraco.Web.JavaScript
internal const string Token = "##Variables##";
- internal static string Parse(Dictionary items)
+ public static string Parse(Dictionary items)
{
var vars = Resources.ServerVariables;
diff --git a/src/Umbraco.Web/JavaScript/TinyMceInitialize.js b/src/Umbraco.Infrastructure/RuntimeMinification/TinyMceInitialize.js
similarity index 100%
rename from src/Umbraco.Web/JavaScript/TinyMceInitialize.js
rename to src/Umbraco.Infrastructure/RuntimeMinification/TinyMceInitialize.js
diff --git a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
index 3d99c4918f..96fc25a527 100644
--- a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
+++ b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
@@ -43,10 +43,23 @@
+
+ True
+ True
+ Resources2.resx
+
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
diff --git a/src/Umbraco.Tests/Models/ImageProcessorImageUrlGeneratorTest.cs b/src/Umbraco.Tests/Models/ImageProcessorImageUrlGeneratorTest.cs
index 30ead90de9..fd6e48fc06 100644
--- a/src/Umbraco.Tests/Models/ImageProcessorImageUrlGeneratorTest.cs
+++ b/src/Umbraco.Tests/Models/ImageProcessorImageUrlGeneratorTest.cs
@@ -30,7 +30,7 @@ namespace Umbraco.Tests.Models
private static readonly ImageUrlGenerationOptions.CropCoordinates Crop = new ImageUrlGenerationOptions.CropCoordinates(0.58729977382575338m, 0.055768992440203169m, 0m, 0.32457553600198386m);
private static readonly ImageUrlGenerationOptions.FocalPointPosition Focus1 = new ImageUrlGenerationOptions.FocalPointPosition(0.80827067669172936m, 0.96m);
private static readonly ImageUrlGenerationOptions.FocalPointPosition Focus2 = new ImageUrlGenerationOptions.FocalPointPosition(0.41m, 0.4275m);
- private static readonly ImageProcessorImageUrlGenerator Generator = new ImageProcessorImageUrlGenerator();
+ private static readonly ImageSharpImageUrlGenerator Generator = new ImageSharpImageUrlGenerator();
[Test]
public void GetCropUrl_CropAliasTest()
diff --git a/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCoreComposer.cs b/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCoreComposer.cs
index fc38e429a0..ec10ced961 100644
--- a/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCoreComposer.cs
+++ b/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCoreComposer.cs
@@ -2,8 +2,16 @@ using Microsoft.AspNetCore.Http;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Hosting;
+using Umbraco.Core.Models;
+using Umbraco.Core.Models.PublishedContent;
using Umbraco.Net;
using Umbraco.Core.Runtime;
+using Umbraco.Core.Security;
+using Umbraco.Web.Models;
+using Umbraco.Web.Models.PublishedContent;
+using Umbraco.Web.PropertyEditors;
+using Umbraco.Web.Routing;
+using Umbraco.Web.Templates;
namespace Umbraco.Web.BackOffice.AspNetCore
{
@@ -22,6 +30,37 @@ namespace Umbraco.Web.BackOffice.AspNetCore
// Our own netcore implementations
composition.RegisterUnique();
composition.RegisterUnique();
+ composition.RegisterUnique();
+
+
+ // register the http context and umbraco context accessors
+ // we *should* use the HttpContextUmbracoContextAccessor, however there are cases when
+ // we have no http context, eg when booting Umbraco or in background threads, so instead
+ // let's use an hybrid accessor that can fall back to a ThreadStatic context.
+ composition.RegisterUnique();
+
+ // register the umbraco context factory
+ // composition.RegisterUnique();
+ composition.RegisterUnique();
+
+ composition.RegisterUnique();
+ composition.RegisterUnique();
+ composition.RegisterUnique();
+ composition.RegisterUnique();
+
+ composition.UrlProviders()
+ .Append()
+ .Append();
+
+ composition.MediaUrlProviders()
+ .Append();
+
+ composition.RegisterUnique();
+
+ // register properties fallback
+ composition.RegisterUnique();
+
+ composition.RegisterUnique();
}
}
}
diff --git a/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCorePasswordHasher.cs b/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCorePasswordHasher.cs
new file mode 100644
index 0000000000..7a26dac8e5
--- /dev/null
+++ b/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCorePasswordHasher.cs
@@ -0,0 +1,20 @@
+using Microsoft.AspNetCore.Identity;
+using IPasswordHasher = Umbraco.Core.Security.IPasswordHasher;
+
+namespace Umbraco.Web.BackOffice.AspNetCore
+{
+ public class AspNetCorePasswordHasher : IPasswordHasher
+ {
+ private PasswordHasher