Removes unneeded methods/properties in abstraction, removes unneeded usages of it, changes everything to pre-defined bundles, fixes cdf implementation and reduces reflection, renames namespace

This commit is contained in:
Shannon
2020-04-02 17:41:00 +11:00
parent e42c63693f
commit 32deaa12d2
57 changed files with 766 additions and 830 deletions

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Umbraco.Infrastructure.WebAssets;
namespace Umbraco.Web.JavaScript
{
public class ServerVariablesParser
{
/// <summary>
/// Allows developers to add custom variables on parsing
/// </summary>
public static event EventHandler<Dictionary<string, object>> Parsing;
internal const string Token = "##Variables##";
public static string Parse(Dictionary<string, object> items)
{
var vars = Resources.ServerVariables;
//Raise event for developers to add custom variables
Parsing?.Invoke(null, items);
var json = JObject.FromObject(items);
return vars.Replace(Token, json.ToString());
}
}
}