moves classes to sep files

This commit is contained in:
Shannon
2014-01-08 14:04:30 +11:00
parent 326d81286a
commit 96e00bc1eb
3 changed files with 51 additions and 44 deletions

View File

@@ -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 &amp; 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("&amp;", "&");
cssOutput = cssOutput.Replace("&amp;", "&");
}
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>