AB#5822 Clean up

This commit is contained in:
Bjarke Berg
2020-03-31 16:28:13 +02:00
parent 94f4c6b372
commit c75c86ab27
4 changed files with 13 additions and 12 deletions

View File

@@ -947,7 +947,9 @@ namespace Umbraco.Core
/// <returns>The filtered string.</returns>
public static string ReplaceFirst(this string text, string search, string replace)
{
var pos = text.IndexOf(search);
if (text == null) throw new ArgumentNullException(nameof(text));
var pos = text.IndexOf(search, StringComparison.InvariantCulture);
if (pos < 0)
return text;

View File

@@ -28,18 +28,18 @@ namespace Umbraco.Infrastructure.Media
//Only put quality here, if we don't have a format specified.
//Otherwise we need to put quality at the end to avoid it being overridden by the format.
if (options.Quality != null && hasFormat == false) imageProcessorUrl.Append("&quality=").Append(options.Quality);
if (options.HeightRatio != null) imageProcessorUrl.Append("&heightratio=").Append(options.HeightRatio.Value.ToString(CultureInfo.InvariantCulture));
if (options.WidthRatio != null) imageProcessorUrl.Append("&widthratio=").Append(options.WidthRatio.Value.ToString(CultureInfo.InvariantCulture));
if (options.Width != null) imageProcessorUrl.Append("&width=").Append(options.Width);
if (options.Height != null) imageProcessorUrl.Append("&height=").Append(options.Height);
if (options.Quality.HasValue && hasFormat == false) imageProcessorUrl.Append("&quality=").Append(options.Quality);
if (options.HeightRatio.HasValue) imageProcessorUrl.Append("&heightratio=").Append(options.HeightRatio.Value.ToString(CultureInfo.InvariantCulture));
if (options.WidthRatio.HasValue) imageProcessorUrl.Append("&widthratio=").Append(options.WidthRatio.Value.ToString(CultureInfo.InvariantCulture));
if (options.Width.HasValue) imageProcessorUrl.Append("&width=").Append(options.Width);
if (options.Height.HasValue) imageProcessorUrl.Append("&height=").Append(options.Height);
if (options.UpScale == false) imageProcessorUrl.Append("&upscale=false");
if (options.AnimationProcessMode != null) imageProcessorUrl.Append("&animationprocessmode=").Append(options.AnimationProcessMode);
if (options.FurtherOptions != null) imageProcessorUrl.Append(options.FurtherOptions);
if (!string.IsNullOrWhiteSpace(options.AnimationProcessMode)) imageProcessorUrl.Append("&animationprocessmode=").Append(options.AnimationProcessMode);
if (!string.IsNullOrWhiteSpace(options.FurtherOptions)) imageProcessorUrl.Append(options.FurtherOptions);
//If furtherOptions contains a format, we need to put the quality after the format.
if (options.Quality != null && hasFormat) imageProcessorUrl.Append("&quality=").Append(options.Quality);
if (options.CacheBusterValue != null) imageProcessorUrl.Append("&rnd=").Append(options.CacheBusterValue);
if (options.Quality.HasValue && hasFormat) imageProcessorUrl.Append("&quality=").Append(options.Quality);
if (!string.IsNullOrWhiteSpace(options.CacheBusterValue)) imageProcessorUrl.Append("&rnd=").Append(options.CacheBusterValue);
return imageProcessorUrl.ToString();
}

View File

@@ -9,7 +9,7 @@ using Umbraco.Web.Common.ActionResults;
namespace Umbraco.Web.BackOffice.Filters
{
public class MinifyJavaScriptResult : ActionFilterAttribute
public class MinifyJavaScriptResultAttribute : ActionFilterAttribute
{
public override async Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next)
{

View File

@@ -71,7 +71,6 @@ module.exports = {
assets: "./src/assets/**"
}
},
root: "../Umbraco.Web.UI.NetCore/wwwroot/",
roots: ["../Umbraco.Web.UI/", "../Umbraco.Web.UI.NetCore/wwwroot/"],
targets: {
js: "Umbraco/js/",