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:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user