Client Dependency Framework updated to 1.5 (beta).
Shandem fixed backwards compatibility in CDF 1.5. Sync'd the assembly and config. Updated 'CanvasClientDependencyProvider' class (from CDF 1.4 source).
This commit is contained in:
@@ -10,9 +10,9 @@ NOTES:
|
||||
* Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config
|
||||
* A new version will invalidate both client and server cache and create new persisted files
|
||||
-->
|
||||
<clientDependency version="1">
|
||||
<clientDependency version="1" fileDependencyExtensions=".js,.css">
|
||||
|
||||
<fileRegistration defaultProvider="LoaderControlProvider" fileDependencyExtensions=".js,.css">
|
||||
<fileRegistration defaultProvider="LoaderControlProvider">
|
||||
<providers>
|
||||
<add name="PageHeaderProvider" type="ClientDependency.Core.FileRegistration.Providers.PageHeaderProvider, ClientDependency.Core"/>
|
||||
<add name="LazyLoadProvider" type="ClientDependency.Core.FileRegistration.Providers.LazyLoadProvider, ClientDependency.Core"/>
|
||||
@@ -30,15 +30,16 @@ NOTES:
|
||||
to disk so that on any subsequent request (when output cache expires) that these files don't have
|
||||
to be recreated again and will be based on the persisted file on disk. This saves on processing time.
|
||||
-->
|
||||
<compositeFiles defaultProvider="CompositeFileProcessor" compositeFileHandlerPath="DependencyHandler.axd">
|
||||
<providers>
|
||||
<compositeFiles defaultProvider="defaultFileProcessingProvider" compositeFileHandlerPath="~/DependencyHandler.axd">
|
||||
<fileProcessingProviders>
|
||||
<add name="CompositeFileProcessor"
|
||||
type="ClientDependency.Core.CompositeFiles.Providers.CompositeFileProcessingProvider, ClientDependency.Core"
|
||||
enableCssMinify="true"
|
||||
enableJsMinify="true"
|
||||
persistFiles="true"
|
||||
compositeFilePath="~/App_Data/TEMP/ClientDependency" />
|
||||
</providers>
|
||||
compositeFilePath="~/App_Data/TEMP/ClientDependency"
|
||||
urlType="Base64QueryStrings" />
|
||||
</fileProcessingProviders>
|
||||
|
||||
<!--
|
||||
Defines the mime types to compress when requested by the client.
|
||||
|
||||
Binary file not shown.
@@ -2,79 +2,73 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ClientDependency.Core;
|
||||
using ClientDependency.Core.FileRegistration.Providers;
|
||||
using umbraco.presentation;
|
||||
using ClientDependency.Core;
|
||||
|
||||
namespace umbraco.presentation.LiveEditing
|
||||
{
|
||||
public class CanvasClientDependencyProvider : LazyLoadProvider
|
||||
{
|
||||
public CanvasClientDependencyProvider()
|
||||
: base()
|
||||
{}
|
||||
|
||||
public new const string DefaultName = "CanvasProvider";
|
||||
|
||||
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
|
||||
/// <summary>
|
||||
/// override to never render out the dependency handler address (no compression, combination, etc...)
|
||||
/// </summary>
|
||||
/// <param name="jsDependencies"></param>
|
||||
/// <param name="http"></param>
|
||||
/// <param name="htmlAttributes"></param>
|
||||
/// <returns></returns>
|
||||
protected override string RenderJsDependencies(IEnumerable<IClientDependencyFile> jsDependencies, System.Web.HttpContextBase http, IDictionary<string, string> htmlAttributes)
|
||||
{
|
||||
base.Initialize(name, config);
|
||||
if (!jsDependencies.Any())
|
||||
return string.Empty;
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
foreach (var dependency in jsDependencies)
|
||||
{
|
||||
sb.Append(RenderSingleJsFile(string.Format("'{0}','{1}'", dependency.FilePath, string.Empty), new Dictionary<string, string>()));
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// override to never render out the dependency handler address (no compression, combination, etc...)
|
||||
/// </summary>
|
||||
/// <param name="cssDependencies"></param>
|
||||
/// <param name="http"></param>
|
||||
/// <param name="htmlAttributes"></param>
|
||||
/// <returns></returns>
|
||||
protected override string RenderCssDependencies(List<ClientDependency.Core.IClientDependencyFile> cssDependencies)
|
||||
protected override string RenderCssDependencies(IEnumerable<IClientDependencyFile> cssDependencies, System.Web.HttpContextBase http, IDictionary<string, string> htmlAttributes)
|
||||
{
|
||||
if (cssDependencies.Count == 0)
|
||||
if (!cssDependencies.Any())
|
||||
return string.Empty;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
var sb = new StringBuilder();
|
||||
|
||||
foreach (IClientDependencyFile dependency in cssDependencies)
|
||||
foreach (var dependency in cssDependencies)
|
||||
{
|
||||
sb.Append(RenderSingleCssFile(dependency.FilePath));
|
||||
sb.Append(RenderSingleCssFile(dependency.FilePath, new Dictionary<string, string>()));
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// override to never render out the dependency handler address (no compression, combination, etc...)
|
||||
/// </summary>
|
||||
/// <param name="jsDependencies"></param>
|
||||
/// <returns></returns>
|
||||
protected override string RenderJsDependencies(List<ClientDependency.Core.IClientDependencyFile> jsDependencies)
|
||||
{
|
||||
if (jsDependencies.Count == 0)
|
||||
return string.Empty;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (IClientDependencyFile dependency in jsDependencies)
|
||||
{
|
||||
sb.Append(RenderSingleJsFile(string.Format("'{0}','{1}'", dependency.FilePath, string.Empty)));
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
protected override string RenderSingleCssFile(string css)
|
||||
protected override string RenderSingleCssFile(string css, IDictionary<string, string> htmlAttributes)
|
||||
{
|
||||
if (UmbracoContext.Current.LiveEditingContext.Enabled)
|
||||
return base.RenderSingleCssFile(css);
|
||||
return base.RenderSingleCssFile(css, new Dictionary<string, string>());
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
protected override string RenderSingleJsFile(string js)
|
||||
protected override string RenderSingleJsFile(string js, IDictionary<string, string> htmlAttributes)
|
||||
{
|
||||
if (UmbracoContext.Current.LiveEditingContext.Enabled)
|
||||
return base.RenderSingleJsFile(js);
|
||||
return base.RenderSingleJsFile(js, new Dictionary<string, string>());
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user