moves classes to sep files
This commit is contained in:
@@ -6,56 +6,12 @@ using System.Text;
|
||||
using System.Web;
|
||||
using ClientDependency.Core;
|
||||
using ClientDependency.Core.Config;
|
||||
using ClientDependency.Core.FileRegistration.Providers;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Web.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Web.UI.JavaScript
|
||||
{
|
||||
/// <summary>
|
||||
/// A custom renderer that only outputs a dependency path instead of script tags - for use with the js loader with yepnope
|
||||
/// </summary>
|
||||
public class DependencyPathRenderer : StandardRenderer
|
||||
{
|
||||
public override string Name
|
||||
{
|
||||
get { return "Umbraco.DependencyPathRenderer"; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to delimit each dependency so we can split later
|
||||
/// </summary>
|
||||
public const string Delimiter = "||||";
|
||||
|
||||
/// <summary>
|
||||
/// Override because the StandardRenderer replaces & with & but we don't want that so we'll reverse it
|
||||
/// </summary>
|
||||
/// <param name="allDependencies"></param>
|
||||
/// <param name="paths"></param>
|
||||
/// <param name="jsOutput"></param>
|
||||
/// <param name="cssOutput"></param>
|
||||
/// <param name="http"></param>
|
||||
public override void RegisterDependencies(List<IClientDependencyFile> allDependencies, HashSet<IClientDependencyPath> paths, out string jsOutput, out string cssOutput, HttpContextBase http)
|
||||
{
|
||||
base.RegisterDependencies(allDependencies, paths, out jsOutput, out cssOutput, http);
|
||||
|
||||
jsOutput = jsOutput.Replace("&", "&");
|
||||
cssOutput = cssOutput.Replace("&", "&");
|
||||
}
|
||||
|
||||
protected override string RenderSingleJsFile(string js, IDictionary<string, string> htmlAttributes)
|
||||
{
|
||||
return js + Delimiter;
|
||||
}
|
||||
|
||||
protected override string RenderSingleCssFile(string css, IDictionary<string, string> htmlAttributes)
|
||||
{
|
||||
return css + Delimiter;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal abstract class AssetInitialization
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
50
src/Umbraco.Web/UI/JavaScript/DependencyPathRenderer.cs
Normal file
50
src/Umbraco.Web/UI/JavaScript/DependencyPathRenderer.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using ClientDependency.Core;
|
||||
using ClientDependency.Core.FileRegistration.Providers;
|
||||
|
||||
namespace Umbraco.Web.UI.JavaScript
|
||||
{
|
||||
/// <summary>
|
||||
/// A custom renderer that only outputs a dependency path instead of script tags - for use with the js loader with yepnope
|
||||
/// </summary>
|
||||
public class DependencyPathRenderer : StandardRenderer
|
||||
{
|
||||
public override string Name
|
||||
{
|
||||
get { return "Umbraco.DependencyPathRenderer"; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to delimit each dependency so we can split later
|
||||
/// </summary>
|
||||
public const string Delimiter = "||||";
|
||||
|
||||
/// <summary>
|
||||
/// Override because the StandardRenderer replaces & with & but we don't want that so we'll reverse it
|
||||
/// </summary>
|
||||
/// <param name="allDependencies"></param>
|
||||
/// <param name="paths"></param>
|
||||
/// <param name="jsOutput"></param>
|
||||
/// <param name="cssOutput"></param>
|
||||
/// <param name="http"></param>
|
||||
public override void RegisterDependencies(List<IClientDependencyFile> allDependencies, HashSet<IClientDependencyPath> paths, out string jsOutput, out string cssOutput, HttpContextBase http)
|
||||
{
|
||||
base.RegisterDependencies(allDependencies, paths, out jsOutput, out cssOutput, http);
|
||||
|
||||
jsOutput = jsOutput.Replace("&", "&");
|
||||
cssOutput = cssOutput.Replace("&", "&");
|
||||
}
|
||||
|
||||
protected override string RenderSingleJsFile(string js, IDictionary<string, string> htmlAttributes)
|
||||
{
|
||||
return js + Delimiter;
|
||||
}
|
||||
|
||||
protected override string RenderSingleCssFile(string css, IDictionary<string, string> htmlAttributes)
|
||||
{
|
||||
return css + Delimiter;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user